コード例 #1
0
    protected override void Flee()
    {
        _cow.cowAnimationState = Cow.COW_ANIMATIONSTATE.COW_RUN;

        if ((_cow.transform.position - _cow.target.transform.position).magnitude >= 10)
        {
            _cow.target = null;
            _cow.ChangeState(new CowAlertState());
        }
    }
コード例 #2
0
    protected override void Eat()
    {
        base.Eat();
        _cow.cowAnimationState = Cow.COW_ANIMATIONSTATE.COW_EAT;

        if (_drinkTimer >= _drinkDuration)
        {
            _cow.ChangeState(new CowPatrolState());
        }
    }
コード例 #3
0
    protected override void Sleeping()
    {
        base.Sleeping();
        _cow.cowAnimationState = Cow.COW_ANIMATIONSTATE.COW_SLEEP_START;

        if (_sleepTimer >= _sleepDuration)
        {
            _cow.ChangeState(new CowAwakenState());
        }
    }
コード例 #4
0
    protected override void Awaken()
    {
        base.Awaken();
        _cow.cowAnimationState = Cow.COW_ANIMATIONSTATE.COW_SLEEP_END;

        if (_wakeUpTimer >= _wakeUpDuration)
        {
            _cow.ChangeState(new CowIdleState());
        }
    }
コード例 #5
0
    protected override void FindWater()
    {
        _cow.FindWater();
        _cow.cowAnimationState = Cow.COW_ANIMATIONSTATE.COW_WALK;

        if (_cow._navMeshAgent.remainingDistance <= 0f)
        {
            _cow.ChangeState(new CowDrinkState());
        }
    }
コード例 #6
0
    protected override void Alert()
    {
        base.Alert();

        _cow.cowAnimationState = Cow.COW_ANIMATIONSTATE.COW_IDLE;

        if (_alertTimer >= _alertDuration)
        {
            _cow.ChangeState(new CowPatrolState());
        }
    }
コード例 #7
0
    protected override void Patrol()
    {
        base.Patrol();
        _cow.Destination();
        _cow.cowAnimationState = Cow.COW_ANIMATIONSTATE.COW_WALK;

        if (_patrolTimer >= _patrolDuration)
        {
            _cow.ChangeState(new CowIdleState());
        }
    }
コード例 #8
0
 protected override void TakeDamage()
 {
     if (!_tookDamage)
     {
         _cow.TakeDamage(5);
         _cow.cowAnimationState = Cow.COW_ANIMATIONSTATE.COW_HIT;
         _tookDamage            = true;
     }
     else
     {
         _cow.ChangeState(new CowIdleState());
     }
 }
コード例 #9
0
    protected override void Idle()
    {
        base.Idle();

        if (_idleType == 1)
        {
            _cow.cowAnimationState = Cow.COW_ANIMATIONSTATE.COW_IDLE;
        }
        else
        {
            _cow.cowAnimationState = Cow.COW_ANIMATIONSTATE.COW_IDLE_SEARCH;
        }

        if (_idleTimer >= _idleDuration)
        {
            _cow.ChangeState(new CowPatrolState());
        }
    }