Beispiel #1
0
    public void InitButton(ChoiceHolder choiceScript, int letterIndex)
    {
        buttonScript.Init(choiceScript);

        optionID   = letterIndex;
        buttonText = "Default Option";

        UpdateText();
        UpdateName();
    }
Beispiel #2
0
    public void Init(ChoiceHolder choiceScript)     //called when in editor mode
    {
                #if UNITY_EDITOR
        this.choiceScript = choiceScript;

        Button myButton = GetComponent <Button> ();

        UnityAction taskOnClick = System.Delegate.CreateDelegate(typeof(UnityAction), this, "TaskOnClick") as UnityAction;
        UnityEventTools.AddPersistentListener(myButton.onClick, taskOnClick);
                #endif
    }
    void OnEnable()
    {
        choiceHolder = (ChoiceHolder)target;
        choiceHolder.Insp_Enabled();

        prevChoiceCount = choiceHolder.createdOptions.Count;
        createdOptions.Clear();
        for (int i = 0; i < prevChoiceCount; i++)
        {
            ChoiceOption editorOption = EditorOptionFromOption(choiceHolder.createdOptions [i]);
            createdOptions.Add(editorOption);
        }
    }
Beispiel #4
0
    void Start()
    {
        // points to very first conversation
        //Prep work
        dailog = GameObject.Find("Dialog").GetComponent <TextMeshProUGUI>();

        if (buttons.Length < 5)
        {
            Debug.Log("Need 5 buttons");
        }

        choice1       = buttons[0].text;
        choice1Button = buttons[0].button;

        choice2       = buttons[1].text;
        choice2Button = buttons[1].button;

        choice3       = buttons[2].text;
        choice3Button = buttons[2].button;

        choice4       = buttons[3].text;
        choice4Button = buttons[3].button;

        choice5       = buttons[4].text;
        choice5Button = buttons[4].button;

        choiceHold = GameObject.Find("Choicelist").GetComponent <ChoiceHolder>();

        textList = new List <TextMeshProUGUI> {
            choice1, choice2, choice3, choice4, choice5
        };
        buttonList = new List <Button> {
            choice1Button, choice2Button, choice3Button, choice4Button, choice5Button
        };

        dailogE = GameObject.Find("Overview").GetComponent <DailogEvents>();

        dateList = new List <List <string> > {
            choiceHold.dateA, choiceHold.dateB, choiceHold.dateC
        };
        //Begins dailog system
        GrabText();
    }
Beispiel #5
0
    void Start()
    {
        // points to very first conversation
        //Prep work
        dailog = GameObject.Find("Dialog").GetComponent <TextMeshProUGUI>();

        // grabs pointer from playerprefs
        //____________________________________________________________________
        //____________________________________________________________________

        /*
         * // kills after testing    the game should work with out a hitch during normal play experince
         * PlayerPrefs.SetInt("Pointer", 1);
         *
         * //tempt delete later
         * PlayerPrefs.SetInt("Date", 0);
         */
        //____________________________________________________________________
        //____________________________________________________________________

        pointer = PlayerPrefs.GetInt("Pointer", 1);
        // grabs date from playerprefs
        currentDate = PlayerPrefs.GetInt("Date", 0);



        //  use to set pointer to be used inbtween scens  PlayerPrefs.SetInt("Pointer", 20);

        if (buttons.Length < 5)
        {
            Debug.Log("Need 5 buttons");
        }

        choice1       = buttons[0].text;
        choice1Button = buttons[0].button;

        choice2       = buttons[1].text;
        choice2Button = buttons[1].button;

        choice3       = buttons[2].text;
        choice3Button = buttons[2].button;

        choice4       = buttons[3].text;
        choice4Button = buttons[3].button;

        choice5       = buttons[4].text;
        choice5Button = buttons[4].button;

        choiceHold = GameObject.Find("Choicelist").GetComponent <ChoiceHolder>();

        textList = new List <TextMeshProUGUI> {
            choice1, choice2, choice3, choice4, choice5
        };
        buttonList = new List <Button> {
            choice1Button, choice2Button, choice3Button, choice4Button, choice5Button
        };

        dailogE = GameObject.Find("Overview").GetComponent <DailogEvents>();

        dateList = new List <List <string> > {
            choiceHold.dateA, choiceHold.dateB, choiceHold.dateC
        };

        //Begins dailog system
        GrabText();
    }