public void OnPointerClick(PointerEventData eventdata) // Executor { if (eventdata.button == PointerEventData.InputButton.Left) { if (intendant.GetMode() == intendant.CHOISE_MODE) { try { intendant.Alert(province_name); intendant.ProtagonistState = state; intendant.EnterPoliticalCoords(); foreach (GameObject slider in GameObject.FindGameObjectsWithTag("Slider")) { slider.GetComponent <SliderScript>().setState(state); } } catch (Exception) { intendant.Alert("It is neutral province"); intendant.EnterPoliticalCoordsCancel(); } } else if (intendant.GetMode() == intendant.CONSTRUCION_MODE && state == intendant.ProtagonistState) { intendant.OpenMenu(intendant.ConstructionMenu); intendant.SelectProvince(gameObject); } else if (intendant.GetMode() == intendant.ARMY_MODE && state == intendant.ProtagonistState) { // Debug.LogError(selected); intendant.SelectProvince(gameObject); } else if (intendant.GetMode() == intendant.DIPLOMACY_MODE && state != intendant.ProtagonistState) { intendant.SelectState(state); } else if (intendant.GetMode() == intendant.SEPARATISM_MODE && state == intendant.ProtagonistState) { intendant.SelectProvince(gameObject); } } else if (eventdata.button == PointerEventData.InputButton.Right) { intendant.selected_passive_province = gameObject; // Debug.LogError(gameObject); } // Debug.Log(province_name + " " + state.GetComponent<stategen>().state_name); }