コード例 #1
0
    void Start()
    {
        hudCanvas = GameObject.FindGameObjectWithTag("HUD Canvas");
        toggleCanvas(false);

        // register with event processor
        eventProcessor = GameObject.Find("SpeechEventProcessor").GetComponent <SpeechEventProcessor>();
        if (eventProcessor != null)
        {
            eventProcessor.outputReceiver = this;
        }

        // register with event processor as action receiver
        if (eventProcessor != null)
        {
            eventProcessor.registerEventResponder(this);
        }
    }
コード例 #2
0
    void Start()
    {
        videoController = GameObject.Find("Video Player").GetComponent <VideoSystemController>();

        // get the buttons
        skipBackwardButton = GameObject.Find("StepBackButton").GetComponent <UnityEngine.UI.Button>();
        skipFowardButton   = GameObject.Find("StepForwardButton").GetComponent <UnityEngine.UI.Button>();
        playButton         = GameObject.Find("PlayButton").GetComponent <UnityEngine.UI.Button>();
        pauseButton        = GameObject.Find("PauseButton").GetComponent <UnityEngine.UI.Button>();
        stopButton         = GameObject.Find("StopButton").GetComponent <UnityEngine.UI.Button>();

        // set button states
        configureButtonForState(VideoPlayerState.stop);

        // register with event processor
        SpeechEventProcessor eventProcessor = GameObject.Find("SpeechEventProcessor").GetComponent <SpeechEventProcessor>();

        if (eventProcessor != null)
        {
            eventProcessor.registerEventResponder(this);
        }
    }