Пример #1
0
        private void OnTriggerEnter(Collider other)
        {
            bool isDeadLineCollission = other.CompareTag("DeadLine");

            bool isDeadLineCollissionCross = other.CompareTag("DeadLineCross");

            if (isDeadLineCollission || isDeadLineCollissionCross)
            {
                Destroy(gameObject);
                GameObject pl  = GameObject.Find("Player");
                Player     ply = (Player)pl.GetComponent(typeof(Player));
                ply.AddReward(1f);
            }
        }