コード例 #1
0
 public void AddHint2(string line, DialogForks d)
 {
     if (theHintPages.Count == 0)
     {
         currentHintPage++;
         theHintPages.Add(new HintPage(line, d));
     }
     else if (theHintPages[currentHintPage].gameObjectsAdded < maxObjectsPerPage)
     {
         theHintPages[currentHintPage].AddHint(line, d);
     }
     else
     {
         currentHintPage++;
         theHintPages.Add(new HintPage(line, d));
     }
 }
コード例 #2
0
ファイル: DialogForks.cs プロジェクト: lendeuel/milgram
    public void AddQueuers(DialogForks d, int randomNum)
    {
        if (d.playInOrder)
        {
            playInOrder = true;
        }

        d.hasParent = true;

        d.takeAction();

        foreach (TheseDialogQueuers t in d.dialogQueuers)
        {
            // Add lines of this dialogQueuer with index of randomNum to a temp array of LineAndSpeaker
            LineAndSpeaker[] temp1 = dialogQueuers[randomNum].lines;

            // Add lines of t.dialogQueuer to a second temp array of LineAndSpeaker
            LineAndSpeaker[] temp2 = t.lines;

            // create new array of LineAndSpeaker with size of temp1 + temp2
            LineAndSpeaker[] both = new LineAndSpeaker[temp1.Length + temp2.Length];

            // Populate array with lineAndSpeakers from temp1 and temp2
            for (int i = 0; i < temp1.Length; i++)
            {
                both[i] = temp1[i];
            }

            for (int i = 0; i < temp2.Length; i++)
            {
                both[i + temp1.Length] = temp2[i];
            }

            // Set lines of this dialogQueuer to the last array
            t.getThisDialogQueuer().lines = both;

            dialogQueuers.Add(t);
        }
    }
コード例 #3
0
ファイル: Button.cs プロジェクト: lendeuel/milgram
    void OnMouseUp()
    {
        if (DataHolder.allowInteractions || action is TextScroller || action is LoadScene)
        {
            if (onClick.Length != 0)
            {
                int randomClip = UnityEngine.Random.Range(0, onClick.Length);
                source.clip = onClick[randomClip];
                source.Play();
            }

            action.takeAction();

            if (action is DialogForks && gameObject.CompareTag("HintElement"))
            {
                DialogForks d = action as DialogForks;

                if (d.dialogQueuers.Count == 0 || d.delete)
                {
                    GameObject.FindObjectOfType <NotepadManager>().RemoveHint(gameObject.GetComponent <Text>().text);
                }
            }
        }
    }
コード例 #4
0
    // This needs to determine what gameObject this Hint gets assigned to, only set the text on text, and the action on button action
    public void AddHint(string line, DialogForks d)
    {
        gameObjectsAdded++;

        hintFork.Add(new HintAndFork(line, d));
    }
コード例 #5
0
    public HintPage(string line, DialogForks d)
    {
        hintFork = new List <HintAndFork>();

        AddHint(line, d);
    }
コード例 #6
0
 public HintAndFork(string line, DialogForks d)
 {
     theString = line;
     theFork   = d;
 }