Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        timer  = 0;
        speech = GameObject.Find("SpeechRecognition").GetComponent <SpeechRecognition01>();
        uiH    = GameObject.Find("UIH1").GetComponent <UIHistory>();
        ava    = GameObject.Find("Witch character").GetComponent <AvatarSpells>();

        ambienceEvent = FMODUnity.RuntimeManager.CreateInstance(ambiencePath);

        ambienceCounter = 0;
        ambienceGoal    = (int)Random.Range(3600f, 4800f);
        ambienceEvent.start();
    }
Beispiel #2
0
    void Start()
    {
        //assigns the UI components that will display the spell history
        his  = GetComponent <Image>();
        his2 = GameObject.Find("UIH2").GetComponent <Image>();
        his3 = GameObject.Find("UIH3").GetComponent <Image>();
        his4 = GameObject.Find("UIH4").GetComponent <Image>();

        //assigns UI components for each type of player action
        right   = GameObject.Find("rightUI").GetComponent <SpriteRenderer>();
        left    = GameObject.Find("leftUI").GetComponent <SpriteRenderer>();
        jump    = GameObject.Find("jumpUI").GetComponent <SpriteRenderer>();
        climb   = GameObject.Find("climbUI").GetComponent <SpriteRenderer>();
        fire    = GameObject.Find("fireUI").GetComponent <SpriteRenderer>();
        water   = GameObject.Find("waterUI").GetComponent <SpriteRenderer>();
        wind    = GameObject.Find("windUI").GetComponent <SpriteRenderer>();
        ice     = GameObject.Find("iceUI").GetComponent <SpriteRenderer>();
        earth   = GameObject.Find("earthUI").GetComponent <SpriteRenderer>();
        grow    = GameObject.Find("growUI").GetComponent <SpriteRenderer>();
        shrink  = GameObject.Find("shrinkUI").GetComponent <SpriteRenderer>();
        hint    = GameObject.Find("hintUI").GetComponent <SpriteRenderer>();
        restore = GameObject.Find("restoreUI").GetComponent <SpriteRenderer>();
        spirit  = GameObject.Find("spiritUI").GetComponent <SpriteRenderer>();

        //helper functions
        speech = GameObject.Find("SpeechRecognition").GetComponent <SpeechRecognition01>();
        mov    = GameObject.Find("Witch character").GetComponent <Movement>();
        ava    = GameObject.Find("Witch character").GetComponent <AvatarSpells>();

        check    = true;
        canSpell = true;

        //initializes an empty UI history box
        Sprite dummy = GameObject.Find("emptyUI").GetComponent <SpriteRenderer>();

        his.sprite  = dummy;
        his2.sprite = dummy;
        his3.sprite = dummy;
        his4.sprite = dummy;
    }