Ejemplo n.º 1
0
    private void Awake()
    {
        if (UIInstance == null)
        {
            UIInstance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(this.gameObject);
        }

        StartCoroutine(FadeImageSet());
    }
Ejemplo n.º 2
0
    protected void Awake()                //싱글톤 오브젝트를 만들자!
    {
        PlayManageAwake();

        if (Instance == null)           //Static 변수를 지정하고 이것이 없을경우 - PlayManage 스크립트를 저장하고 이것이 전 범위적인 싱글톤 오브젝트가 된다.
        {
            DontDestroyOnLoad(this.gameObject);
            LoadData();
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(this.gameObject);   //싱글톤 오브젝트가 있을경우 다른 오브젝트를 제거.
        }
        UIB = GameObject.FindGameObjectWithTag("UIBase").GetComponent <UIBaseManage>();
    }