Пример #1
0
    public virtual void OnTriggerEnter2D(Collider2D other)
    {
        if (other.isTrigger)
        {
            return;
        }

        switch (sceneToLoad)
        {
        case "Level1":
            OnPlayerLoadScene(other);
            break;

        case "Level2":
            if (bag.OnCheckBag())
            {
                return;
            }
            OnPlayerLoadScene(other);
            break;

        case "Level3":
            if (!bag.OnCheckBag())
            {
                return;
            }
            OnPlayerLoadScene(other);

            break;

        case "Level5":
            if (other.CompareTag("Car"))
            {
                sceneObjectLoader.NextScene(sceneToLoad);
            }
            break;
        }
    }