private void Start() { startPos = transform.position; startRot = transform.rotation; controlEvents = GetComponent <VRTK_Control_UnityEvents>(); if (controlEvents == null) { controlEvents = gameObject.AddComponent <VRTK_Control_UnityEvents>(); } if (ValueText != null) { if (options.Count > 0) { ValueText.text = options[(int)GetValue()]; } else if (isInteger) { ValueText.text = ((int)GetValue()).ToString(); } else { ValueText.text = GetValue().ToString("0.00"); } } controlEvents.OnValueChanged.AddListener(HandleChange); }
private void Initialize() { controlEvents = GetComponent <VRTK_Control_UnityEvents>(); if (controlEvents == null) { controlEvents = gameObject.AddComponent <VRTK_Control_UnityEvents>(); } controlEvents.OnValueChanged.AddListener(HandleChange); }
void Start() { Textmesh.text = "Height (squeeze to slide)"; _events = GetComponent <VRTK_Control_UnityEvents>(); if (_events == null) { _events = gameObject.AddComponent <VRTK_Control_UnityEvents>(); } _events.OnValueChanged.AddListener(SliderHandler); }
private void Start() { controlEvents = GetComponent <VRTK_Control_UnityEvents>(); if (controlEvents == null) { controlEvents = gameObject.AddComponent <VRTK_Control_UnityEvents>(); } startLeaverRotation = this.transform.localRotation.eulerAngles.z; controlEvents.OnValueChanged.AddListener(HandleChange); }
private void Start() { transform.position = new Vector3(); controlEvents = GetComponent <VRTK_Control_UnityEvents>(); if (controlEvents == null) { controlEvents = gameObject.AddComponent <VRTK_Control_UnityEvents>(); } controlEvents.OnValueChanged.AddListener(HandleChange); }
private void Start() { controlEvents = GetComponent <VRTK_Control_UnityEvents>(); if (controlEvents == null) { controlEvents = gameObject.AddComponent <VRTK_Control_UnityEvents>(); } controlEvents.OnValueChanged.AddListener(HandleChange); StartCoroutine(SetUI()); }
private void Start() { posY = huaPian.localPosition.y; posZ = huaPian.localPosition.z; controlEvents = GetComponent <VRTK_Control_UnityEvents>(); if (controlEvents == null) { controlEvents = gameObject.AddComponent <VRTK_Control_UnityEvents>(); } controlEvents.OnValueChanged.AddListener(HandleChange); }
private void Start() { controlEvents = GetComponent <VRTK_Control_UnityEvents>(); if (controlEvents == null) { controlEvents = gameObject.AddComponent <VRTK_Control_UnityEvents>(); } controlEvents.OnValueChanged.AddListener(HandleChange); angle = 0; speed = 0; }
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); }
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); }