void ProceedToNextState() { _healthController.isIndestructible = !IsEmerging; Renderer.enabled = !IsSubmerging; if (IsUnderwater) { AnimatorInstance.SetTrigger("Emerge"); _timerDuration = emergeDuration; WarpToRandomNearbyWaterTile(); } else if (IsEmerging) { AnimatorInstance.SetTrigger("Surface"); _timerDuration = surfaceDuration; FacePlayer(); _enemy.Attack(); } else if (IsSurfaced) { AnimatorInstance.SetTrigger("Submerge"); _timerDuration = submergeDuration; } else if (IsSubmerging) { AnimatorInstance.SetTrigger("Underwater"); _timerDuration = underwaterDuration; ReplenishHealth(); } }
void AssignSkinForDungeonNum(int num) { if (num < 1 || num > 9) { num = 1; } AnimatorInstance.SetInteger("DungeonNum", num); }
IEnumerator OpenEye() { //print(" ~ OpenEye ~"); AnimatorInstance.SetTrigger("OpenEye"); yield return(new WaitForSeconds(openEyeDuration)); CloseEye(); }
void ProceedToNextState() { if (_enemy.IsParalyzed) { ProceedToNextStateAfterDelay(0.01f); return; } _enemy.meleeDamage = IsEmerging ? _normalMeleeDamage : 0; _enemyMove.enabled = IsEmerging; _enemyAI_Random.enabled = IsEmerging; _healthController.isIndestructible = !IsEmerging; Renderer.enabled = !IsSubmerging; if (IsUnderground) { PlaceOnscreen(); WarpToRandomNearbySandTile(); AnimatorInstance.SetTrigger("Emerge"); ProceedToNextStateAfterDelay(emergeDuration); } else if (IsEmerging) { AnimatorInstance.SetTrigger("Surface"); ProceedToNextStateAfterDelay(surfaceDuration); } else if (IsSurfaced) { AnimatorInstance.SetTrigger("Submerge"); ProceedToNextStateAfterDelay(submergeDuration); } else if (IsSubmerging) { PlaceOffscreen(); AnimatorInstance.SetTrigger("Underground"); ProceedToNextStateAfterDelay(undergroundDuration); } }
void AssignSkinForDungeonNum(int num) { num = Mathf.Clamp(num, 1, WorldInfo.NUM_DUNGEONS); AnimatorInstance.SetInteger("DungeonNum", num); }
bool IsAnimationState(string tag) { return(AnimatorInstance.GetCurrentAnimatorStateInfo(0).IsTag(tag)); }
void UpdatePose() { string animName = VulnerableToArrow ? "NextHurtPose" : "NextPose"; AnimatorInstance.SetTrigger(animName); }
void CloseEye() { AnimatorInstance.SetTrigger("CloseEye"); }