예제 #1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Obstacle"))
        {
            ObstacleController obstacleCollider = other.gameObject.GetComponent <ObstacleController>();
            obstacleCollider.BackToStartPoint(startWall.transform.position);
        }
        else if (other.CompareTag("JumpingMonkey"))
        {
            JumpingMonkey jumpingMonkey = other.gameObject.GetComponent <JumpingMonkey>();
            jumpingMonkey.BackToStartPoint();
        }
        else if (other.CompareTag("Sphere"))
        {
            GameObject ball = other.gameObject.transform.parent.gameObject;
            ball.SetActive(false);

            ballManager.AddToPendingList(ball);
        }
    }
 // Start is called before the first frame update
 void Start()
 {
     jumpingMonkeyCS = jumpingMonkey.GetComponent <JumpingMonkey>();
 }