Exemplo n.º 1
0
        protected override void OnEvent(Event gameEvent)
        {
            switch (gameEvent.Type)
            {
            case EventType.RightTriggerClicked:
                ActivateSkill();
                break;

            case EventType.RightTriggerReleased:
                DeactivateSkill();
                break;

            case EventType.CharacterChanged:
                _characterControllerLocked = !_characterControllerLocked;
                break;

            case EventType.CharacterDied:
                _characterControllerLocked = true;
                break;

            case EventType.ChangeSkill:
                ChangeSkill((int)gameEvent.Parameter);
                break;
            }
            base.OnEvent(gameEvent);
        }
Exemplo n.º 2
0
 protected override void OnEvent(Event gameEvent)
 {
     if (gameEvent.Type == EventType.CharacterChanged)
     {
         _platform.Deactivate();
     }
     base.OnEvent(gameEvent);
 }
Exemplo n.º 3
0
 protected override void OnEvent(Event gameEvent)
 {
     if (gameEvent.Type == EventType.HeroPowerChanged)
     {
         SetupBar();
     }
     base.OnEvent(gameEvent);
 }
Exemplo n.º 4
0
 protected override void OnEvent(Event gameEvent)
 {
     if (gameEvent.Type == EventType.DamageByStaticObjectDone)
     {
         _canDealDamages  = false;
         _cooldownCounter = 0;
     }
     base.OnEvent(gameEvent);
 }
Exemplo n.º 5
0
 protected override void OnEvent(Event gameEvent)
 {
     switch (gameEvent.Type)
     {
     case EventType.CharacterDied:
         ShowDiedMenu();
         break;
     }
     base.OnEvent(gameEvent);
 }
Exemplo n.º 6
0
 protected override void OnEvent(Event gameEvent)
 {
     switch (gameEvent.Type)
     {
     case EventType.CharacterDied:
         _isPlayerDead = true;
         break;
     }
     base.OnEvent(gameEvent);
 }
Exemplo n.º 7
0
 protected override void OnEvent(Event gameEvent)
 {
     switch (gameEvent.Type)
     {
     case EventType.CharacterChanged:
         _isCharacterNow = !_isCharacterNow;
         SetObjectToFollow(_isCharacterNow ? _charTransform : _goodSoulTransform);
         break;
     }
     base.OnEvent(gameEvent);
 }
Exemplo n.º 8
0
        protected override void OnEvent(Event gameEvent)
        {
            if (gameEvent.Type == EventType.CharacterChanged)
            {
                _isControlled       = !_isControlled;
                _collider2D.enabled = _isControlled;

                if (_isControlled == false)
                {
                    BackToStartingPostion();
                }
                else
                {
                    iTween.Stop(gameObject);
                    _animator.enabled = false;
                    _animator.SetBool(AnimatorIsControlledBoolName, true);
                }
            }
            base.OnEvent(gameEvent);
        }
Exemplo n.º 9
0
        protected override void OnEvent(Event gameEvent)
        {
            if (gameEvent.Type == EventType.CharacterDied)
            {
                _characterMovementEnabled = false;
            }
            if (gameEvent.Type == EventType.CharacterChanged)
            {
                _characterMovementEnabled = !_characterMovementEnabled;
            }

            if (gameEvent.Type == EventType.ButtonClicked)
            {
                switch ((InputButton)gameEvent.Parameter)
                {
                case InputButton.Jump:
                    Jump();
                    break;
                }
            }
        }
Exemplo n.º 10
0
 protected override void OnEvent(Event gameEvent)
 {
     _currentSkillIndex = (int)gameEvent.Parameter;
     SetupCorrectSkill();
     base.OnEvent(gameEvent);
 }