protected override void Start() { if (!Application.Current.IsEditor) { MaterialComponent materialComponent = this.Owner.FindComponent <MaterialComponent>(); materialComponent.Material = materialComponent.Material.Clone(); this.material = materialComponent.Material; this.holoHandsDecorator = new HoloHandsLocal(this.material); this.material.ActiveDirectivesNames = directivesAnimating; this.meshRenderer = this.Owner.FindComponent <MeshRenderer>(); this.camera = this.Managers.RenderManager.ActiveCamera3D; CursorManager cursorManager = Owner.Scene.Managers.FindManager <CursorManager>(); foreach (Cursor c in cursorManager.Cursors) { TrackXRJoint joint = c.Owner.FindComponent <TrackXRJoint>(); if (joint != null && joint.Handedness == this.Handedness) { this.trackXRJoint = joint; this.cursorMeshRenderer = c.Owner.FindComponent <MeshRenderer>(); break; } } } }
/// <inheritdoc/> protected override void Start() { if (!Application.Current.IsEditor) { var materialComponent = this.Owner.FindComponent <MaterialComponent>(); materialComponent.Material = materialComponent.Material.Clone(); this.material = materialComponent.Material; this.holoHandsDecorator = new HoloHandsLocal(this.material); this.material.ActiveDirectivesNames = this.directivesAnimating; this.meshRenderer = this.Owner.FindComponent <MeshRenderer>(); foreach (var c in Cursor.ActiveCursors) { var joint = c.Owner.FindComponent <TrackXRJoint>(); if (joint != null && joint.Handedness == this.Handedness) { this.trackXRJoint = joint; this.cursorMeshRenderer = c.Owner.FindComponentInChildren <MeshRenderer>(); break; } } } }