Beispiel #1
0
    // ---- inherited handlers ----

    void Awake()
    {
        if (Raycaster.instance != null)
        {
            throw new UnityException("Singleton error: instance already set");
        }

        // quick and easy singleton
        Raycaster.instance = this;

        if (Raycaster.sorter == null)
        {
            Raycaster.sorter = new RaycastDistanceSorter();
        }
    }
Beispiel #2
0
    // ---- inherited handlers ----
    void Awake()
    {
        if (Raycaster.instance != null)
            throw new UnityException("Singleton error: instance already set");

        // quick and easy singleton
        Raycaster.instance = this;

        if (Raycaster.sorter == null)
            Raycaster.sorter = new RaycastDistanceSorter();
    }