Пример #1
0
    // Check if we reached the goal object
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Goal")                   //If the collided object is a goal object...
        {
            gManager.RemoveGoal(other.gameObject); //Remove goal from scene and goal list

            points++;                              //Increment points
            pointsText.text = points.ToString();   //Update points display
        }
    }