Esempio n. 1
0
    // Update is called once per frame
    private void Update()
    {
        _timer += Time.deltaTime;
        if (!(_timer > 1))
        {
            return;
        }

        _timer = 0;
        if (MyState == Monster2State.LookingForGold)
        {
            if (NearestGoldBag() == null)
            {
                return;
            }
            _groundMovingB.Move(NearestGoldBag().transform.position);
        }
        else
        {
            _groundMovingB.Move(EscapePosition);
            if (transform.position == EscapePosition && MyState == Monster2State.Escaping)
            {
                MyState = Monster2State.LookingForGold;
            }
        }
    }
Esempio n. 2
0
 private void Move(Vector3 position)
 {
     _groundMovingB.Move(position);
 }