public TalkAction(GameObject talker, AudioClip audio, GameObject currUI, int startPar, int numPar)
    {
        this.talker = talker;
        this.currUI = currUI;
        this.canvas = currUI.GetComponent <Canvas>();

        //find the ui text element
        Transform t = currUI.transform;

        foreach (Transform child in t)
        {
            if (child.name == "UIText")
            {
                this.text = child;
            }
        }

        this.dBox = text.GetComponent <OldDialogBox>();

        //set the new audio clip to the talker's voice
        this.voice      = talker.GetComponent <AudioSource> ();
        this.voice.clip = audio;
        this.startPar   = startPar;
        this.numPar     = numPar;
    }
示例#2
0
    public ActiveAction(GameObject thing, bool active, int startPar, int numPar)
        : this(thing, active)
    {
        this.gui    = true;
        this.currUI = thing;
        this.canvas = currUI.GetComponent <Canvas>();

        //find the ui text element
        Transform t = currUI.transform;

        foreach (Transform child in t)
        {
            if (child.name == "UIText")
            {
                this.text = child;
            }
        }

        this.dBox     = text.GetComponent <OldDialogBox>();
        this.startPar = startPar;
        this.numPar   = numPar;
    }