plantilla base para movimiento básico
This commit is contained in:
Robii Aragon
2026-02-05 05:07:55 -08:00
parent 195b696771
commit 779f2c8b20
14443 changed files with 23840465 additions and 452 deletions

View File

@@ -0,0 +1,77 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class activateReactionSystem : applyEffectOnArea
{
[Space]
[Header ("Custom Settings")]
[Space]
public bool activateCustomAction;
public string customActionName;
public bool activateReaction;
public string reactionName;
public float damageToSendOnReaction;
public bool checkToActivateReactionSystemTemporally;
public bool useCustomDamageReactionID;
public int damageReactionID;
[Space]
[Header ("Other Settings")]
[Space]
public Transform mainReactionTransform;
public GameObject objectBlocked;
public override void applyEffect (GameObject objectToAffect)
{
playerComponentsManager currentPlayerComponentsManager = objectToAffect.GetComponent<playerComponentsManager> ();
if (currentPlayerComponentsManager != null) {
if (activateCustomAction) {
playerActionSystem currentPlayerActionSystem = currentPlayerComponentsManager.getPlayerActionSystem ();
if (currentPlayerActionSystem != null) {
currentPlayerActionSystem.activateCustomAction (customActionName);
}
}
if (activateReaction) {
damageHitReactionSystem currentDamageHitReactionSystem = currentPlayerComponentsManager.getDamageHitReactionSystem ();
if (currentDamageHitReactionSystem != null) {
if (mainReactionTransform == null) {
mainReactionTransform = transform;
}
bool currentDamageHitReactionSystemActiveState = currentDamageHitReactionSystem.getHitReactionActiveState ();
if (checkToActivateReactionSystemTemporally) {
currentDamageHitReactionSystem.setHitReactionActiveState (true);
}
if (objectBlocked == null) {
objectBlocked = gameObject;
}
if (useCustomDamageReactionID) {
currentDamageHitReactionSystem.activateDamageReactionByID (damageToSendOnReaction, mainReactionTransform.position, objectBlocked, damageReactionID);
} else {
currentDamageHitReactionSystem.checkReactionToTriggerExternally (damageToSendOnReaction, mainReactionTransform.position, objectBlocked);
}
if (checkToActivateReactionSystemTemporally) {
currentDamageHitReactionSystem.setHitReactionActiveState (currentDamageHitReactionSystemActiveState);
}
}
}
}
}
}