Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        EyeRokState state = currentState.Update(this);

        if (state != null)
        {
            currentState = state;

            currentState.OnEnter(this);
        }
    }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        Player = GameObject.FindGameObjectWithTag("Player");
        navAgent.updateRotation = false;
        navAgent.updateUpAxis   = false;

        LeftHandCollider  = LeftHand.GetComponent <BoxCollider2D>();
        RightHandCollider = RightHand.GetComponent <BoxCollider2D>();

        currentState = new EyeRokPatrol();
        currentState.OnEnter(this);
    }
Beispiel #3
0
 public override void SetDestination(Vector2 target)
 {
     base.SetDestination(target);
     StartCoroutine(EyeRokState.WaitForSeconds(3.0f, () => Destroy(gameObject)));
 }