private void FixedUpdate() { KeepRotationWithCameraHeadset(); m_axis = CalculateAxis(); if (m_axis != Vector2.zero && m_lastRecordedAxis == Vector2.zero) { var args = new KaiTool_AxisChangeEventArgs(); args.m_axis = m_axis; OnStartAxisChange(args); } else if (m_axis == Vector2.zero && m_lastRecordedAxis != Vector2.zero) { var args = new KaiTool_AxisChangeEventArgs(); args.m_axis = Vector2.zero; OnStopAxisChange(args); } if (m_axis != Vector2.zero) { var args = new KaiTool_AxisChangeEventArgs(); args.m_axis = m_axis; OnAxisChanging(args); } Move(); m_lastRecordedAxis = m_axis; }
public void OnAxisChanging(KaiTool_AxisChangeEventArgs e) { if (m_axisChanging != null) { m_axisChanging.Invoke(); } if (m_AxisChangingEventHandle != null) { m_AxisChangingEventHandle(this, e); } }
public void OnStartAxisChange(KaiTool_AxisChangeEventArgs e) { if (m_startAxisChange != null) { m_startAxisChange.Invoke(); } if (m_startAxisChangeEventHandle != null) { m_startAxisChangeEventHandle(this, e); } }