Ejemplo n.º 1
0
 void Awake()
 {
     if (StaticRef == null) // if theres is not allerdaye a static ref makes this the static ref
     {
         DontDestroyOnLoad(gameObject);
         StaticRef = this;
     }
     else if (StaticRef != this) // is the allready is a ref , destory this
     {
         Destroy(this);
     }
 }
Ejemplo n.º 2
0
 void Awake()
 {
     if (StaticRef == null) // if theres is not allerdaye a static ref makes this the static ref
     {
         DontDestroyOnLoad(gameObject);
         StaticRef = this;
     }
     else if (StaticRef != this) // is the allready is a ref , destory this
     {
         Destroy(this);
     }
 }