Beispiel #1
0
    private void OnTriggerEnter(Collider other)
    {
        //print("striggerowalo kolizje");

        Hashtable gotPrey = new Hashtable();

        if (!LevelManager.EndOfTheGame)
        {
            //print("nazwa kolizji [" + other.GetComponent<Collider>().name + "]");
            if (
                other.name == EscapeBorderController.ActiveEscapeBorders.First.Value.Name ||
                other.name == EscapeBorderController.ActiveEscapeBorders.Last.Value.Name
                )
            {
                LevelManager.GameResult = false;
                gotPrey.Add("Predator1", false);
                gotPrey.Add("Predator2", false);
                gotPrey.Add("Predator3", false);
                gotPrey.Add("Predator4", false);
            }
            else if (other.name == Predator1.name || other.name == Predator2.name || other.name == Predator3.name || other.name == Predator4.name)
            {
                LevelManager.GameResult = true;
                gotPrey.Add("Predator1", (other.name == Predator1.name));
                gotPrey.Add("Predator2", (other.name == Predator2.name));
                gotPrey.Add("Predator3", (other.name == Predator3.name));
                gotPrey.Add("Predator4", (other.name == Predator4.name));
            }
            Predator1.SendScore((bool)gotPrey["Predator1"], LevelManager.GameResult);
            Predator2.SendScore((bool)gotPrey["Predator2"], LevelManager.GameResult);
            Predator3.SendScore((bool)gotPrey["Predator3"], LevelManager.GameResult);
            Predator4.SendScore((bool)gotPrey["Predator4"], LevelManager.GameResult);
        }
    }