protected override void GetHit() { _body.SetActive(false); _shell.SetActive(true); anim = _shellAnim; curStage = CurStage.shell; shellState = ShellState.idle; _isShellMoving = false; StartCoroutine("OnRecover"); }
/// <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(); }
/// <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 } } }
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"); }