コード例 #1
0
 private void Awake()
 {
     if (_instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
         DontDestroyOnLoad(this);
     }
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     if (DontDestroyCanvas.Canvas == null)
     {
         Canvas = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
     DontDestroyOnLoad(this.gameObject);
 }
コード例 #3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(transform.gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #4
0
 void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
コード例 #5
0
 void Awake()
 {
     if (dontDestroyCanvas == null)
     {
         DontDestroyOnLoad(gameObject);
         dontDestroyCanvas = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #6
0
ファイル: DontDestroyCanvas.cs プロジェクト: 0MNIP0TENT/Edges
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
コード例 #7
0
    //Si rende non distruttibile al cambio di scena il canvas che contiene il text per visualizzare lo stato di connessione dell'Hololens
    void Awake()
    {
        DontDestroyOnLoad(this);

        if (playerInstance == null)
        {
            playerInstance = this;
        }
        else
        {
            DestroyObject(gameObject);
        }
    }
コード例 #8
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);
    }