//private PointerEventData eventData=new PointerEventData(EventSystem.current); /// <summary> /// /// </summary> public void Start(string i_fmt) { m_VirtualButton = CrossInputManager.VirtualButtonReference(this, string.Format(i_fmt, key)); m_Graphic = m_Button.GetComponent <Graphic>(); m_ColorOri = m_Graphic.color; Update(); }
void Update() { peakMagnitudeTime += Time.deltaTime; if (peakMagnitudeTime > MAX_PEAK_MAGNITUDE_TIME) { ResetPhysicsPeaks(); } float triggerAxis = CrossInputManager.GetAxis(triggerName); if (triggerAxis > 0) { if (throwObject == null) { SpawnThrowObject(); isMaxTriggerAxisReached = false; ResetPhysicsPeaks(); } if (isMaxTriggerAxisReached == false) { UpdateThrowObjectScale(); } if (triggerAxis >= MAX_TRIGGER_AXIS) { isMaxTriggerAxisReached = true; } } else if (throwObject != null) { ReleaseThrowObject(); } }
public void OnStart(XHawkServiceBase i_tracker) { tracker = i_tracker; if (!string.IsNullOrEmpty(poseName)) { pose = CrossInputManager.VirtualPoseReference(i_tracker, poseName, true); } }
private void UpdateThrowObjectScale() { float triggerAxis = CrossInputManager.GetAxis(triggerName); float triggerPercent = Mathf.Clamp01(triggerAxis / MAX_TRIGGER_AXIS); float scale = Mathf.SmoothStep(0.0f, 1.0f, triggerPercent) * throwObjectInitialScale; SetThrowObjectScale(scale); }
/// <summary> /// /// </summary> public override void StartInput() { XHawkServiceBase.main.Register(blobId, this); m_Pose = CrossInputManager.VirtualPoseReference( this, string.Format(device.fmtJoy, poseName), true ); }
/// <summary> /// /// </summary> public void Start(string i_fmt) { int i = keys.Length; while (i-- > 0) { m_VirtualAxes[i] = CrossInputManager.VirtualAxisReference(this, string.Format(i_fmt, keys[i])); } Update(); }
/// <summary> /// /// </summary> protected virtual void Update() { if (true) { m_HandStretch = HandJoint.N2A(1.0f - CrossInputManager.GetAxis(triggerName)); // Inverse the trigger value. for (int i = 0, imax = m_HandCtrl.fingers.Length; i < imax; ++i) { m_HandCtrl.fingers[i].Stretch(m_HandStretch); } } }
/// <summary> /// /// </summary> public override void StartInput() { if (canReset) { device.resetables.Add(this); } m_Pose = CrossInputManager.VirtualPoseReference( this, string.Format(device.fmtJoy, poseName), true ); }
//#if ALPHA // protected SpringAlgorithm m_SpringAlgorithm; //#endif #endregion Fields #region Unity Messages /// <summary> /// /// </summary> protected virtual void Start() { m_Pose = CrossInputManager.VirtualPoseReference(poseName); if (m_Pose == null) { Log.e("PoseMover", string.Format("Invalid Pose@{0}", poseName)); Object.Destroy(this); return; } if (m_Transform == null) { m_Transform = transform; } //if(useWorldSpace) }
/// <summary> /// /// </summary> protected virtual void Start() { if (animator == null) { animator = transform.parent.GetComponent <HandAnimator>(); //??? } if (handAnchor == null) { handAnchor = transform; } // m_Pose = CrossInputManager.VirtualPoseReference(poseName); m_HandTrans = animator.joints[handType].bone; m_HandCtrl = animator.GetHandController(handType); m_HandLocalRot = m_HandTrans.localRotation; //??? }
/// <summary> /// /// </summary> public override void StartInput() { // m_Buttons = new VirtualButton[m_NumButtons]; for (int i = 0; i < m_NumButtons; ++i) { m_Buttons[i] = CrossInputManager.VirtualButtonReference( this, string.Format(device.fmtJoy, buttonName[i]), true ); } m_ButtonValuePrev = m_ButtonValue = 0; // device.buttons.AddRange(buttonName); }
/// <summary> /// /// </summary> public override void StartInput() { // m_Axes = new VirtualAxis[m_NumAxes]; m_AxesValue = new float[m_NumAxes]; for (int i = 0; i < m_NumAxes; ++i) { m_Axes[i] = CrossInputManager.VirtualAxisReference( this, string.Format(device.fmtJoy, axisName[i]), true ); m_AxesValue[i] = 0.0f; } // device.axes.AddRange(axisName); }
/// <summary> /// /// </summary> public override void StartInput() { // m_Axis = CrossInputManager.VirtualAxisReference( this, string.Format(device.fmtJoy, axisName), true ); // m_Button = CrossInputManager.VirtualButtonReference( this, string.Format(device.fmtJoy, buttonName), true ); // device.axes.Add(axisName); device.buttons.Add(buttonName); }
public bool GetAnyDown() { int i, imax; i = 0; imax = keys.Length; while (i < imax) { if (Input.GetKeyDown(keys[i])) { return(true); } ++i; } i = 0; imax = buttons.Length; while (i < imax) { if (CrossInputManager.GetButtonDown(buttons[i])) { return(true); } ++i; } return(false); }
/// <summary> /// /// </summary> protected virtual void Update() { if (Physics.Raycast(target.position, target.rotation * s_Fwd, out m_HitInfo, distance, layerMask)) { // UIDelegate ui = m_HitInfo.transform.GetComponent <UIDelegate>(); if (ui == null) { return; } // Raw // Enter first time. if (m_HitInfo.collider != m_HitInfoPrev.collider) { if (ui.onPointerEnter != null) { ui.onPointerEnter(m_PointerData); } if (m_HitInfoPrev.transform != null) { UIDelegate uiPrev = m_HitInfoPrev.transform.GetComponent <UIDelegate>(); if (uiPrev != null) { if (uiPrev.onPointerExit != null) { uiPrev.onPointerExit(m_PointerData); } } } } // if (CrossInputManager.GetButtonDown(button0)) { if (ui.onPointerDown != null) { ui.onPointerDown(m_PointerData); } m_TimeClick = Time.time + clickTime; } else if (CrossInputManager.GetButtonUp(button0)) { if (ui.onPointerUp != null) { ui.onPointerUp(m_PointerData); } if (Time.time <= m_TimeClick) { if (ui.onPointerClick != null) { ui.onPointerClick(m_PointerData); } m_TimeClick = float.MaxValue; } } m_HitInfoPrev = m_HitInfo; } else { // Copy if (m_HitInfoPrev.transform != null) { UIDelegate uiPrev = m_HitInfoPrev.transform.GetComponent <UIDelegate>(); if (uiPrev != null) { if (uiPrev.onPointerExit != null) { uiPrev.onPointerExit(m_PointerData); } } m_HitInfoPrev = s_HitInfo; } } }
/// <summary> /// /// </summary> public void Start(string i_fmt) { m_VirtualPose = CrossInputManager.VirtualPoseReference(this, string.Format(i_fmt, key)); Update(); }
void Start() { virtualPose = CrossInputManager.VirtualPoseReference(poseName); }