예제 #1
0
 protected override void GetHit()
 {
     _body.SetActive(false);
     _shell.SetActive(true);
     anim           = _shellAnim;
     curStage       = CurStage.shell;
     shellState     = ShellState.idle;
     _isShellMoving = false;
     StartCoroutine("OnRecover");
 }
예제 #2
0
        /// <summary>Tries to give transformations</summary>
        protected virtual void TryGiveTransformations()
        {
            if (CurStage == null)
            {
                return;
            }

            RandUtilities.PushState();

            foreach (var tfGiver in CurStage.GetAllTransformers())
            {
                if (tfGiver.TryTransform(pawn, this))
                {
                    break; //try each one, one by one. break at first one that succeeds
                }
            }
            RandUtilities.PopState();
        }
예제 #3
0
        /// <summary>Tries to give transformations</summary>
        protected virtual void TryGiveTransformations()
        {
            if (CurStage == null)
            {
                return;
            }
            if (!CanMutatePawn)
            {
                return;
            }

            foreach (var tfGiver in CurStage.GetAllTransformers())
            {
                if (tfGiver.TryTransform(pawn, this))
                {
                    break; //try each one, one by one. break at first one that succeeds
                }
            }
        }
예제 #4
0
    void Recover()
    {
        _shell.SetActive(false);
        _body.SetActive(true);

        if (transform.localScale.x * dir.x == 1)
        {
            var scale = transform.localScale;
            scale.x *= -dir.x;
            transform.localScale = scale;
        }

        isHit    = false;
        curStage = CurStage.body;

        speed = _normalSpeed;
        anim  = _bodyAnim;

        StopCoroutine("OnRecover");
    }