Exemple #1
0
    void Start()
    {
        // clear any input from previous screens
        Input.ResetInputAxes();

        // make sure the progress throbber from the
        // board list is cleared
        State.TaskDone("GetBoardList");

        // cache instance references
        gridManager    = GameObject.FindGameObjectWithTag("GridManager").GetComponentInChildren <ActorGridManager>();
        audioManager   = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();
        trinketManager = GameObject.FindGameObjectWithTag("TrinketManager").GetComponentInChildren <ActorTrinketManager>();

        // find the GUI objects
        flowerSelectorObject    = GameObject.Find(flowerSelector).GetComponentInChildren <RectTransform>();
        flowerSelectorImage     = GameObject.Find(flowerSelector).GetComponentInChildren <Image>();
        dialogPanelText         = GameObject.Find(dialogPanel).GetComponentInChildren <Text>();
        blueSelectTransform     = GameObject.Find(blueSelectButton).GetComponentInChildren <RectTransform>();
        redSelectTransform      = GameObject.Find(redSelectButton).GetComponentInChildren <RectTransform>();
        yellowSelectTransform   = GameObject.Find(yellowSelectButton).GetComponentInChildren <RectTransform>();
        boardNameField          = GameObject.Find(boardNameInput).GetComponentInChildren <InputField>();
        saveBoardTextObject     = GameObject.Find(saveBoardText).GetComponentInChildren <Text>();
        ratioTextObject         = GameObject.Find(ratioText).GetComponentInChildren <Text>();
        gemsRemainingTextObject = GameObject.Find(gemsRemaining).GetComponentInChildren <Text>();
        foundTrinketTextObject  = GameObject.Find(foundTrinketText).GetComponentInChildren <Text>();
        trinketImageObject      = GameObject.Find(trinketImage).GetComponentInChildren <Image>();

        // reset the board
        ResetBoard();
    }
Exemple #2
0
    void Start()
    {
        audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();
        audioManager.playScreenLoaded();
        State.gameBoardMine = true;
        Language.TranslateScreen();
        Debug.LogFormat("Current State Gameboard Category:{0}", State.gameBoardCategory);
        switch (State.gameBoardCategory)
        {
        case GameBoardCategory.campaign:
            beginnerToggle.isOn = true;
            break;

        case GameBoardCategory.mine:
            myToggle.isOn = true;
            break;

        case GameBoardCategory.newest:
            newToggle.isOn = true;
            break;

        case GameBoardCategory.popular:
            popularToggle.isOn = true;
            break;
        }
        YardListUpdate(true);
    }
Exemple #3
0
 void Start()
 {
     audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();
     audioManager.playScreenLoaded();
     Language.TranslateScreen();
     State.gameState = GameState.credits;
 }
Exemple #4
0
    void Awake()
    {
        if (singleton == null)
        {
            DontDestroyOnLoad(gameObject);
            singleton = this;

            maxMusicVolume       = State.GetMusicVolume();
            maxSoundEffectVolume = State.GetSoundEffectsVolume();

#if UNITY_ANDROID && !UNITY_EDITOR
            AndroidNativeAudio.makePool(3);
#endif
            // cache reference to music source and sound effects sources
            GameObject[] effects = GameObject.FindGameObjectsWithTag("SoundEffectSource");
            foreach (GameObject e in effects)
            {
                SoundEffectSources.Add(e.GetComponentInChildren <AudioSource>());
            }

            // start loading sounds
            StartCoroutine("LoadSounds");
        }
        else if (singleton != this)
        {
            Destroy(gameObject);
        }
    }
    public void ClickSounds(bool enabled)
    {
        PlayButtonClick();
        ActorAudioManager audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();

        audioManager.SetMusicOn(!enabled);
        audioManager.SetSoundsOn(!enabled);
    }
    public void Start()
    {
        audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();
        audioManager.playScreenLoaded();

        GameObject.Find("MusicVolumeSlider").GetComponent <Slider>().value   = State.GetMusicVolume();
        GameObject.Find("EffectsVolumeSlider").GetComponent <Slider>().value = State.GetSoundEffectsVolume();

        Language.TranslateScreen();
        State.gameState = GameState.settings;
    }
Exemple #7
0
    // Use this for initialization
    void Start()
    {
        audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();
        audioManager.playScreenLoaded();
        Language.TranslateScreen();
        State.gameState = GameState.chapters;

        StartCoroutine("ShowBeginnerBoards");

        go = GameObject.FindGameObjectWithTag(StoryTextTag);
        if (go)
        {
            StoryText = go.GetComponentInChildren <Text>();
        }

        SetFontSize(PlayerPrefs.HasKey(PreferredFontSizeKey) ? PlayerPrefs.GetInt(PreferredFontSizeKey) : defaultFontSize);
    }
Exemple #8
0
    private void Start()
    {
        audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();
        audioManager.playScreenLoaded();

        // only show voting button when the board is not mine
        ActorGameManager.ShowGroup(voteForBoardButton, !State.gameBoardMine);

        // update sub-panels based on activity
        UpdateSubPanels();

        // only show the social buttons when the player is age 15 or older
        ActorGameManager.ShowGroup(twitterButton, State.GetAgeFifteenOrOlder());
        ActorGameManager.ShowGroup(facebookButton, State.GetAgeFifteenOrOlder());

        Language.TranslateScreen();

        // set board name
        GameObject.Find(boardNameText).GetComponent <Text>().text = State.GetBoardDisplayName();

        // cache board number
        boardNumber = State.GetBoardNumber();
    }
Exemple #9
0
    // Use this for initialization
    void Start()
    {
        audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();

        LoadingText = LoadingImage.GetComponent <Text>();
        VersionText = GameObject.FindGameObjectWithTag("VersionText").GetComponentInChildren <Text>();
        TrackedBundleVersionInfo currentRunningVersion = new TrackedBundleVersion().current;

        Debug.LogWarningFormat("***CURRENT VERSION: {0}", currentRunningVersion.ToString());
        VersionText.text = "Version " + currentRunningVersion.ToString();


        // show the age verification if age not set yet
        if (!State.AgeKeySet())
        {
            ShowAgeVerification();
        }
        else
        {
            ageSet      = true;
            languageSet = true;
        }
    }
Exemple #10
0
 void Start()
 {
     audioManager   = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();
     chapterManager = GameObject.FindGameObjectWithTag("ChapterListManager").GetComponentInChildren <ActorChapterListManager>();
 }
Exemple #11
0
 void Start()
 {
     audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();
     audioManager.playScreenLoaded();
 }
Exemple #12
0
 void Start()
 {
     audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponentInChildren <ActorAudioManager>();
     UpdateGemCountDisplay();
 }