void UpdateStateEnd(int roleIndex) { m_clicked [roleIndex] = false; if (m_state == DeformTools.ToolState.TwoHand) { m_state = DeformTools.ToolState.Idle; } if (IsWorkingHand(roleIndex)) { m_state = DeformTools.ToolState.Idle; m_workingHand = HandRole.Invalid; } }
void UpdateStateStart(int roleIndex) { m_clicked [roleIndex] = true; m_frameCount [roleIndex] = Time.frameCount; // if 2 clicked => two if (m_clicked [0] && m_clicked [1] && IsSimultaneous()) { m_state = DeformTools.ToolState.TwoHand; m_workingHand = HandRole.Invalid; return; } // if 1 clicked => one if (m_clicked [0] || m_clicked [1]) { m_state = DeformTools.ToolState.OneHand; if (m_workingHand == HandRole.Invalid) { m_workingHand = (HandRole)roleIndex; } } }