예제 #1
0
 // Use this for initialization
 public override void Start()
 {
     _trackedObject = GetComponent <SteamVR_TrackedObject>();
     _gunDisplay    = GetComponentInChildren <GunDisplay>();
     device         = SteamVR_Controller.Input((int)_trackedObject.index);
     base.Start();
 }
예제 #2
0
    private void Awake()
    {
        switch (gameObject.name)
        {
        case "Gun":
            GunInstance = this;
            break;

        case "Clip":
            ClipInstance = this;
            break;

        case "Ammo":
            AmmoInstance = this;
            break;
        }

        textMesh = GetComponent <TextMeshProUGUI>();
    }
 void Start()
 {
     base.Start();
     _gunDisplay = GetComponentInChildren <GunDisplay>();
 }