Exemplo n.º 1
0
 public void ShowOptions()
 {
     Console.WriteLine("a. " + Option1.ToString());
     Console.WriteLine("b. " + Option2.ToString());
     Console.WriteLine("c. " + Option3.ToString());
     Console.WriteLine("d. " + Option4.ToString());
 }
Exemplo n.º 2
0
 //Обновление сцен
 void update_window()
 {
     //условие на скрытие кнопок и их заполнение
     if (current.MassageButton1 != null)
     {
         Option1.Show();
         Option1.Text = current.MassageButton1;
     }
     else
     {
         Option1.Hide();
     }
     if (current.MassageButton2 != null)
     {
         Option2.Show();
         Option2.Text = current.MassageButton2;
     }
     else
     {
         Option2.Hide();
     }
     if (current.MassageButton3 != null)
     {
         Option3.Show();
         Option3.Text = current.MassageButton3;
     }
     else
     {
         Option3.Hide();
     }
     this.BackgroundImage = current.Image;//обновление фона
 }
Exemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        Text1 = Option1.GetComponentInChildren <TextMeshProUGUI>();
        Text2 = Option2.GetComponentInChildren <TextMeshProUGUI>();
        Text3 = Option3.GetComponentInChildren <TextMeshProUGUI>();
        Text4 = Option4.GetComponentInChildren <TextMeshProUGUI>();

        Option1.onClick.AddListener(() => Button1(input));
        Option2.onClick.AddListener(() => Button2(input));
        Option3.onClick.AddListener(() => Button3(input));
        Option4.onClick.AddListener(() => Button4(input));

        Money    = 100;
        Space    = 60;
        Military = 60;
        Alliance = 60;

        Events.Add(new Event("4. April 1949", "NATO has formed", "USA has formed an anti soviet alliance, called NATO, what is our response?", "Ask to Join Nato?", "Start making your own", "Your proposal was rejected", "Creation of the Warsaw pact has begun"));
        Events.Add(new Event("4. October 1957", "Into Space!", "The Sputnik 1 project has been a huge success, and everyone looks to the USSR", "With such success the project must escalate", "We have achieved what we needed", "Project funding increased", "Project funding decreased"));
        TimeStopped       = false;
        Timer.currentYear = 1949;
        History.text      = "";
    }
Exemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        switch (CurrentStage)
        {
        case EVENT_STAGE.NO_EVENT:

            if (CurrentEvent)
            {
                CurrentStage = EVENT_STAGE.CHOOSE_OPTION;
            }

            break;

        case EVENT_STAGE.CHOOSE_OPTION:

            EventPanel.SetActive(true);
            Option1.SetActive(true);
            Option2.SetActive(true);
            Option3.SetActive(true);

            // Apply UI/Text
            Title.text       = CurrentEvent.GetComponent <EventBase>().Title;
            Description.text = CurrentEvent.GetComponent <EventBase>().Description;
            Option1.GetComponentInChildren <Text>().text = CurrentEvent.transform.GetChild(0).GetComponent <EventOption>().Description;
            Option2.GetComponentInChildren <Text>().text = CurrentEvent.transform.GetChild(1).GetComponent <EventOption>().Description;
            Option3.GetComponentInChildren <Text>().text = CurrentEvent.transform.GetChild(2).GetComponent <EventOption>().Description;

            if (Option3.GetComponentInChildren <Text>().text == "")
            {
                Option3.SetActive(false);
            }

            if (Option2.GetComponentInChildren <Text>().text == "")
            {
                Option2.SetActive(false);
            }

            if (Option1.GetComponentInChildren <Text>().text == "")
            {
                Option1.SetActive(false);
                CurrentEvent.transform.GetChild(0).gameObject.GetComponent <EventOption>().DoEffect();
                CurrentStage = EVENT_STAGE.OUTCOME;
            }

            if (i_ChosenOption != 0)
            {
                CurrentEvent.transform.GetChild(i_ChosenOption - 1).gameObject.GetComponent <EventOption>().DoEffect();
                SelectedOption = CurrentEvent.transform.GetChild(i_ChosenOption - 1).gameObject;

                CurrentStage = EVENT_STAGE.OUTCOME;
            }
            break;

        case EVENT_STAGE.OUTCOME:

            if (SelectedOption)
            {
                Description.text = SelectedOption.GetComponent <EventOption>().GetSelectedOutcome().GetComponent <EventOutcome>().Description;
            }

            Option1.SetActive(false);
            Option2.SetActive(false);
            Option3.SetActive(false);
            EndButton.SetActive(true);

            Destroy(CurrentEvent);

            break;
        }
    }