Ejemplo n.º 1
0
 public void OpenGameModeMenu()
 {
     if (intendant.GetMode() != intendant.CHOISE_MODE)
     {
         bool onview = GameModeMenu.activeSelf;
         if (onview)
         {
             GameModeMenu.SetActive(false);
         }
         else
         {
             intendant.OpenMenu(GameModeMenu);
         }
         try
         {
             intendant.selected_province.GetComponent <provincegen>().selected = false;
             intendant.selected_province = null;
             Debug.Log("opened");
             intendant.selected_state.GetComponent <stategen>().ChangeSelection();
             intendant.selected_state = null;
             Debug.Log("finished");
         }
         catch (Exception) { }
         try
         {
             intendant.selected_state.GetComponent <stategen>().ChangeSelection();
             intendant.selected_state = null;
         }
         catch (Exception)
         { }
     }
 }
Ejemplo n.º 2
0
    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);
    }