示例#1
0
        public void OnTriggerEnter2D(Collider2D other)
        {
            // When AI reaches the edge of its patrol area, turn around
            if (other.tag == "Edge")
            {
                // Make him turn around somehow...
                Debug.Log("Turning around");
                if (enemy.transform.localScale.x > 0)
                {
                    enemy.Move(-1, false);
                }
                else
                {
                    enemy.Move(1, false);
                }
            }

            // When AI reaches area where it's ability can be used, use it.
            if (other.tag == "AbilityProc")
            {
                enemy.specialAttack = true;
            }
        }