public void StickSelected(Stick stick) { if (m_FirstSelectedStick != null && stick == m_FirstSelectedStick && !m_HasGrabbedRing) { return; } SetStick(stick); if (m_FirstSelectedStick.CheckTopRing() == null) { ResetSelected(); return; } else { if (m_FirstSelectedStick && m_SecondSelectedStick) { if (RingCanBeAdded()) { //Debug.Log("Allowed"); Ring ringOnTop = m_FirstSelectedStick.RemoveTopRing(); m_SecondSelectedStick.AddRing(ringOnTop, m_StickBottom.position); } ResetSelected(); CheckForWin(); } } }
private void SetStick(Stick stick) { if (m_FirstSelectedStick == null) { m_FirstSelectedStick = stick; m_HasGrabbedRing = true; m_StoredRingPosition = m_FirstSelectedStick.CheckTopRing().transform.position; } else { m_SecondSelectedStick = stick; m_HasGrabbedRing = false; ResetGrabbedRing(); } }
private bool RingCanBeAdded() { return(m_SecondSelectedStick.CheckTopRing() == null || m_FirstSelectedStick.CheckTopRing().Size.x < m_SecondSelectedStick.CheckTopRing().Size.x); }