protected override void Awake()
    {
        base.Awake();

        if (instance != null)
        {
			GameObject go = instance.gameObject;

            go.SetActive(false);
            Destroy(go);
        }

        instance = this;
        DontDestroyOnLoad(gameObject);
    }
Exemplo n.º 2
0
    protected override void Awake()
    {
        base.Awake();

        if (instance != null)
        {
            GameObject go = instance.gameObject;

            go.SetActive(false);
            Destroy(go);
        }

        instance = this;
        DontDestroyOnLoad(gameObject);
    }
Exemplo n.º 3
0
    protected void FindEventSystems()
    {
        if (!Application.isPlaying && m_EventSystem == null)
        {
            m_EventSystem = FindObjectOfType <EventSystem>();

            if (m_EventSystem != null && !(m_EventSystem is SSEventSystemAutoDestroy))
            {
                GameObject go = m_EventSystem.gameObject;

                SSEventSystemAutoDestroy esad = go.AddComponent <SSEventSystemAutoDestroy>();

                DestroyImmediate(m_EventSystem);
                m_EventSystem = esad;
            }
        }
    }