protected virtual void OnEnable() { spinControl = (spinControl == null ? GetComponent <VRTK_BaseControllable>() : spinControl); spinControl.ValueChanged += ValueChanged; spinControl.MaxLimitReached += MaxLimitReached; spinControl.MinLimitReached += MinLimitReached; }
// Start is called before the first frame update void Start() { controller = (controller == null ? GetComponent <VRTK_BaseControllable>() : controller); controller.MaxLimitReached += Controller_MaxLimitReached; gameObject.GetComponent <VRTK_InteractableObject>().grabAttachMechanicScript = gameObject.GetComponent <VRTK_TrackObjectGrabAttach>(); gameObject.AddComponent <Rigidbody>(); }
protected virtual void OnEnable() { controllable = (controllable == null ? GetComponent <VRTK_BaseControllable>() : controllable); controllable.ValueChanged += ValueChanged; controllable.MaxLimitReached += MaxLimitReached; controllable.MinLimitReached += MinLimitReached; }
// Start is called before the first frame update void Start() { count = 0; controllable = (controllable == null ? GetComponent <VRTK_BaseControllable>() : controllable); controllable.MaxLimitReached += Controllable_MaxLimitReached; controllable.MinLimitReached += Controllable_MinLimitReached; }
public virtual void OnEnable() { padPressed = false; controllable = GetComponent <VRTK_BaseControllable>(); oscPad = oscTransmitObject as OscPadTransmitter; rb = GetComponent <Rigidbody>(); }
protected virtual void OnEnable() { leverControl = (leverControl == null ? GetComponent <VRTK_BaseControllable>() : leverControl); if (leverControl != null) { leverControl.MaxLimitReached += MaxLimitReached; leverControl.MinLimitReached += MinLimitReached; } }
protected override void OnEnable() { base.OnEnable(); oscAddress = string.IsNullOrEmpty(oscAddress) ? string.Format("/slider") : oscAddress; // Set up name and address controlObject = controlObject ?? gameObject; // Set up Control Object controllable = controlObject.GetComponent <VRTK_BaseControllable>(); ManageListeners(true); }
protected override void OnEnable() { base.OnEnable(); // Initialize Controller members oscAddress = string.IsNullOrEmpty(oscAddress) ? string.Format("/pad") : oscAddress; // Set up name and address rb = controlObject.GetComponent <Rigidbody>(); // Get Rigidbody from control object controllable = controlObject.GetComponent <VRTK_BaseControllable>(); padPressed = false; // Pad is not pressed by default }
// Start is called before the first frame update void Start() { if (gameObject.GetComponent <HeaterGrabAction>()) { gameObject.GetComponents <HeaterGrabAction>()[1].enabled = false; } started = false; //gameObject.transform.parent = NewParent; controller = (controller == null ? GetComponent <VRTK_BaseControllable>() : controller); controller.MaxLimitReached += Controller_MaxLimitReached; }
protected virtual void OnEnable() { #pragma warning disable 0618 if (GetComponent <VRTK_Control>() != null && GetComponent <VRTK_Control_UnityEvents>() == null) { controlEvents = gameObject.AddComponent <VRTK_Control_UnityEvents>(); } controlEvents = GetComponent <VRTK_Control_UnityEvents>(); #pragma warning restore 0618 controllableEvents = GetComponent <VRTK_BaseControllable>(); ManageListeners(true); }
protected virtual void SetPositionTarget(VRTK_BaseControllable obj, float newTarget) { if (obj.GetType() == typeof(VRTK_PhysicsPusher)) { VRTK_PhysicsPusher physicsObj = obj as VRTK_PhysicsPusher; physicsObj.positionTarget = newTarget; } else if (obj.GetType() == typeof(VRTK_ArtificialPusher)) { VRTK_ArtificialPusher artificialObj = obj as VRTK_ArtificialPusher; artificialObj.SetPositionTarget(newTarget); } }
protected virtual void SetStayPressed(VRTK_BaseControllable obj, bool state) { if (obj.GetType() == typeof(VRTK_PhysicsPusher)) { VRTK_PhysicsPusher physicsObj = obj as VRTK_PhysicsPusher; physicsObj.stayPressed = state; } else if (obj.GetType() == typeof(VRTK_ArtificialPusher)) { VRTK_ArtificialPusher artificialObj = obj as VRTK_ArtificialPusher; artificialObj.SetStayPressed(state); } }
protected virtual void OnEnable() { // Set up event callbacks. controllable = (controllable == null ? GetComponent <VRTK_BaseControllable>() : controllable); controllable.ValueChanged += ValueChanged; // controllable.RestingPointReached += RestingPointReached; // Might Want These Later /////////////////////////////////////////////////////////////////////// // controllable.MaxLimitReached += MaxLimitReached; // controllable.MinLimitReached += MinLimitReached; }
// Start is called before the first frame update void Start() { if (type == ButtonType.forButton) { manager = GameObject.Find("For Loops").GetComponent <LoopManager>(); } else { whileManager = GameObject.Find("While Loops").GetComponent <WhileLoopManager>(); } controllable = transform.GetChild(1).GetComponent <VRTK_BaseControllable>(); controllable.MaxLimitReached += Controllable_MaxLimitReached; }
protected virtual void OnEnable() { controllable = (controllable == null ? GetComponent <VRTK_BaseControllable>() : controllable); if (controllable != null) { controllable.MaxLimitReached += MaxLimitReached; controllable.MinLimitReached += MinLimitReached; } if (TextDescriptorOpen && TextDescriptorClosed) { TextDescriptorClosed.SetActive(true); TextDescriptorOpen.SetActive(false); ToggleTextDescriptors(); } }
public override void OnEnter() { var go = Fsm.GetOwnerDefaultTarget(gameObject); #pragma warning disable 0618 if (go.GetComponent <VRTK_Control>() != null && go.GetComponent <VRTK_Control_UnityEvents>() == null) { controlEvents = go.AddComponent <VRTK_Control_UnityEvents>(); } controlEvents = go.GetComponent <VRTK_Control_UnityEvents>(); #pragma warning restore 0618 controllableEvents = go.GetComponent <VRTK_BaseControllable>(); ManageListeners(true); }
// Start is called before the first frame update void Start() { foreach (Collider col in Pump.GetComponents <Collider>()) { col.enabled = false; } foreach (Collider col in ColActivate.GetComponents <Collider>()) { col.enabled = false; } foreach (GameObject obj in Triggers) { obj.SetActive(false); } controllable = (controllable == null ? GetComponent <VRTK_BaseControllable>() : controllable); controllable.MaxLimitReached += Controllable_MaxLimitReached; controllable.MinLimitExited += Controllable_MinLimitExited; }
protected virtual void MaxLimitReached(object sender, ControllableEventArgs e) { VRTK_BaseControllable senderButton = sender as VRTK_BaseControllable; VRTK_Logger.Info(senderButton.name + " was pushed"); }
protected virtual void OnEnable() { controllableEvents = GetComponent <VRTK_BaseControllable>(); ManageListeners(true); }
protected virtual void OnEnable() { steeringWheel = (steeringWheel == null ? GetComponent <VRTK_BaseControllable>() : steeringWheel); steeringWheel.ValueChanged += ValueChanged; }
// Start is called before the first frame update void Start() { controller = gameObject.GetComponent <VRTK_BaseControllable>(); controller.ValueChanged += Controller_ValueChanged; }