示例#1
0
 /// <summary>
 /// Awake this instance.
 /// </summary>
 void Awake()
 {
     if (_kudanTracker == null)
     {
         _kudanTracker = FindObjectOfType <KudanTracker>();
     }
     if (_kudanTracker == null)
     {
         Debug.LogWarning("[KudanAR] Cannot find KudanTracker in scene", this);
     }
 }
示例#2
0
 void Awake()
 {
     // If there is no KudanTracker currently in the scene when it loads, make sure that this persists between scenes, then set the static reference of KudanTracker to this object.
     if (kudanTracker == null)
     {
         if (_makePersistent)
         {
             DontDestroyOnLoad(gameObject);
             kudanTracker = this;
         }
     }
     // If KudanTracker already exists in the scene, but this is not it, destroy this gameobject, because there should only be one KudanTracker in a scene at any one time.
     else if (kudanTracker != this)
     {
         Destroy(gameObject);
     }
 }