public void OnClickArrowDown(int _selectedFractionPart) { if (mode == InteractionMode.Changing || mode == InteractionMode.Initializing) { selectedFractionPart = (FractionPart)_selectedFractionPart; /* if (mode == InteractionMode.Initializing) Workspace.Instance.interfaces.SendMessage("ShowSuggestion", "");*/ if (_selectedFractionPart == (int)FractionPart.Numerator) DecreaseNumerator(); else if (_selectedFractionPart == (int)FractionPart.Denominator) { if (denominator == 0) return; DecreaseDenominator(); } if (null != equivalences) { foreach (GameObject eq in equivalences) { eq.GetComponent<RootElement>().SendMessage("DeleteCut", SendMessageOptions.DontRequireReceiver); eq.GetComponent<RootElement>().SendMessage("SetMode", InteractionMode.Changing, SendMessageOptions.DontRequireReceiver); eq.GetComponent<RootElement>().SendMessage("OnClickArrowDown", _selectedFractionPart); } } } else if (mode == InteractionMode.Partitioning) { BroadcastMessage("DecreasePartitions"); } Draw(zIndex); }
public void OnClickArrowUp(int _selectedFractionPart) { if (mode == InteractionMode.Changing || mode == InteractionMode.Initializing) { selectedFractionPart = (FractionPart)_selectedFractionPart; // Workspace.Instance.interfaces.SendMessage("ShowSuggestion", ""); if (denominator == 0) { mode = InteractionMode.Changing; Workspace.Instance.interfaces.SendMessage("EnableHUD"); Workspace.Instance.SendMessage("EnableInput"); } if (_selectedFractionPart == (int)FractionPart.Numerator) IncreaseNumerator(); else if (_selectedFractionPart == (int)FractionPart.Denominator) { IncreaseDenominator(); } //BroadcastMessage("IncreaseDenominator"); if (null != equivalences) { foreach (GameObject eq in equivalences) { // Debug.Log("Call of onclickArrowUp of " + eq.name); eq.GetComponent<RootElement>().SendMessage("DeleteCut", SendMessageOptions.DontRequireReceiver); eq.GetComponent<RootElement>().SendMessage("SetMode", InteractionMode.Changing, SendMessageOptions.DontRequireReceiver); eq.GetComponent<RootElement>().SendMessage("OnClickArrowUp", _selectedFractionPart); } } } else if (mode == InteractionMode.Partitioning) { BroadcastMessage("IncreasePartitions"); } Draw(zIndex); }
void OnSelectFractionPart(FractionPart part) { selectedFractionPart = part; PlaceButtons((int)part); }