示例#1
0
 void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }
示例#2
0
 void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(gameObject);
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
示例#3
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
示例#4
0
 private void Awake()
 {
     SaveLoad = GameObject.Find("SaveLoad").GetComponent <saveLoad>();
     bgms     = GameObject.Find("bgm").GetComponent <bgm>();
     body     = playStoreURL;
 }
示例#5
0
 // Use this for initialization
 void Start()
 {
     a1  = GetComponent <AudioSource>();
     ins = this;
 }