Exemplo n.º 1
0
        protected override void _React(MAnimal animal)
        {
            var mode = animal.Mode_Get(ID);

            if (mode == null || ID == null)
            {
                return;
            }

            switch (type)
            {
            case Mode_Reaction.Activate:
                animal.Mode_Activate(ID, AbilityIndex);
                break;

            case Mode_Reaction.Interrupt:
                if (animal.ActiveMode.ID == ID)
                {
                    animal.Mode_Interrupt();
                }
                break;

            case Mode_Reaction.SetActiveIndex:
                mode.AbilityIndex = AbilityIndex;
                break;

            case Mode_Reaction.ResetActiveIndex:
                mode.ResetAbilityIndex();
                break;

            case Mode_Reaction.Enable:
                animal.Mode_Enable(ID);
                break;

            case Mode_Reaction.Disable:
                animal.Mode_Disable(ID);
                break;

            case Mode_Reaction.CoolDown:
                mode.CoolDown.Value = coolDown;
                break;

            case Mode_Reaction.ForceActivate:
                animal.Mode_ForceActivate(ID, AbilityIndex);
                break;

            case Mode_Reaction.ActivateContinuously:
                animal.Mode_TryActivate(ID, AbilityIndex);
                animal.InputMode            = mode;
                animal.InputMode.InputValue = true;
                Debug.Log("ActivateContinuously");
                break;

            case Mode_Reaction.Stop:
                animal.Mode_Stop();
                break;

            default:
                break;
            }
        }