示例#1
0
    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();
        }
    }
示例#2
0
 void AssignSkinForDungeonNum(int num)
 {
     if (num < 1 || num > 9)
     {
         num = 1;
     }
     AnimatorInstance.SetInteger("DungeonNum", num);
 }
示例#3
0
    IEnumerator OpenEye()
    {
        //print(" ~ OpenEye ~");

        AnimatorInstance.SetTrigger("OpenEye");

        yield return(new WaitForSeconds(openEyeDuration));

        CloseEye();
    }
示例#4
0
    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);
        }
    }
示例#5
0
 void AssignSkinForDungeonNum(int num)
 {
     num = Mathf.Clamp(num, 1, WorldInfo.NUM_DUNGEONS);
     AnimatorInstance.SetInteger("DungeonNum", num);
 }
示例#6
0
 bool IsAnimationState(string tag)
 {
     return(AnimatorInstance.GetCurrentAnimatorStateInfo(0).IsTag(tag));
 }
示例#7
0
    void UpdatePose()
    {
        string animName = VulnerableToArrow ? "NextHurtPose" : "NextPose";

        AnimatorInstance.SetTrigger(animName);
    }
示例#8
0
 void CloseEye()
 {
     AnimatorInstance.SetTrigger("CloseEye");
 }