static GameObject InitController(GameObject go, int index) { Controller ctrl = go.GetComponent <Controller>(); if (ctrl == null) { ctrl = go.AddComponent <Controller>(); } ctrl.Initialize(index); if (controllers == null) { controllers = new Controller[2]; } controllers[index] = ctrl; if (newPosesAppliedAction == null) { newPosesAppliedAction = SteamVR_Events.NewPosesAppliedAction(OnNewPosesApplied); newPosesAppliedAction.enabled = true; } return(go); }
/// <summary> /// Initializes references to Reference Manager and Laser Sight, sets this /// GameObject to the player ship reference in Reference Manager. /// </summary> private void Awake() { reference = FindObjectOfType <ReferenceManager>(); newPosesAppliedAction = SteamVR_Events.NewPosesAppliedAction(OnNewPosesApplied); if (reference == null) { Debug.LogError(GetType().Name + " - Could not find Reference Manager!"); } else { reference.playerShip = gameObject; reference.playerShipSource = source; reference.tooltips.ShipGrabbed(); SetWeapon((int)reference.gameSettings.selectedWeapon); if (reference.shipPickup) { reference.shipPickup.SetActive(false); } if (reference.powerUpStatus) { reference.powerUpStatus.BeginTracking(reference, hand); } if (reference.gameSettings.selectedGameMode == GameSettings.GameMode.SoloNormal) { if (reference.waveManager != null) { reference.waveManager.Run(); } else { Debug.LogError(GetType().Name + " - Reference.WaveManager is null. Cannot call Run()."); } } else { if (reference.countdown) { reference.countdown.SetActive(true); } else { Debug.LogError( GetType().Name + " - Reference.Countdown is null. Cannot enable."); } } StartCoroutine(IntroAudio()); reference.tooltips.SpawnProtectShip(); } }
//------------------------------------------------- //被VRTK抓取事件处理函数替代 //private void OnAttachedToHand(Hand attachedHand) //{ // hand = attachedHand; //} //------------------------------------------------- void Awake() { longBowAni = GetComponent <Animator>(); longBowAni.speed = 0; bowCollider = GetComponent <SphereCollider>(); newPosesAppliedAction = SteamVR_Events.NewPosesAppliedAction(OnNewPosesApplied); GetComponent <VRTK_InteractableObject>().InteractableObjectGrabbed += VRTKLongBow_InteractableObjectGrabbed; GetComponent <VRTK_InteractableObject>().InteractableObjectUngrabbed += VRTKLongBow_InteractableObjectUngrabbed; }
protected virtual void Awake() { if (MixCastCameras.Instance != null) { MixCastCameras.Instance.OnBeforeRender += LateUpdate; } #if MIXCAST_STEAMVR newPosesAppliedAction = SteamVR_Events.NewPosesAppliedAction(OnNewPosesApplied); isTrackedDeviceReady = true; #endif }
//------------------------------------------------- private void Awake() { newPosesAppliedAction = SteamVR_Events.NewPosesAppliedAction(OnNewPosesApplied); }
// Token: 0x06005DCE RID: 24014 RVA: 0x0020D23E File Offset: 0x0020B63E private void Awake() { this.newPosesAppliedAction = SteamVR_Events.NewPosesAppliedAction(new UnityAction(this.OnNewPosesApplied)); }