Beispiel #1
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #2
0
    //void Start () {}

    void Awake()
    {
        switch (handType)
        {
        case (HandType.LeftHand):
            if (TauController.LeftHand == null)
            {
                TauController.SetLeftHand(this);
            }
            else
            {
                Debug.Log("TauController.LeftHand is already set, ignoring duplicate");
            }
            break;

        case (HandType.RightHand):
            if (TauController.RightHand == null)
            {
                TauController.SetRightHand(this);
            }
            else
            {
                Debug.Log("TauController.RightHand is already set, ignoring duplicate");
            }
            break;

        case (HandType.AppItem):
            if (TauController.AppItem == null)
            {
                TauController.SetAppItem(this);
            }
            else
            {
                Debug.Log("TauController.AppItem is already set, ignoring duplicate");
            }
            break;
        }
    }