Example #1
0
    public void Change(GameData.GameState state)
    {
        switch (state)
        {
        case GameData.GameState.Battle:
            Stream = battleMusic;
            Play();
            Playing = true;
            break;

        case GameData.GameState.TitleScreen:
            Stream = titleScreenMusic;
            Play();
            Playing = true;
            break;

        case GameData.GameState.Village:
            Stream = villageMusic;
            Play();
            Playing = true;
            break;

        case GameData.GameState.None:
            Playing = false;
            break;
        }
    }
Example #2
0
 private void OnGameStateChanged(GameData.GameState newState)
 {
     if (newState == GameData.GameState.GameOver)
     {
         InputListener.ButtonDown += StartGame;
     }
     else
     {
         InputListener.ButtonDown -= StartGame;
     }
 }
Example #3
0
 private void OnGameStateChanged(GameData.GameState state)
 {
     if (state == GameData.GameState.GameOver)
     {
         m_inputField.enabled = true;
     }
     else
     {
         m_inputField.enabled = false;
     }
 }
Example #4
0
 private void OnGameStateChanged(GameData.GameState state)
 {
     if (state == GameData.GameState.GameOver)
     {
         gameObject.SetActive(true);
     }
     else
     {
         gameObject.SetActive(false);
     }
 }
Example #5
0
 private void OnGameStateChanged(GameData.GameState state)
 {
     if (state == GameData.GameState.GameOver)
     {
         SetBottomAnchorY(m_startPosition);
     }
     else
     {
         SetBottomAnchorY(0);
     }
 }
Example #6
0
    void OnStateChanged(GameData.GameState newState)
    {
        switch (newState)
        {
        case GameData.GameState.Unplanted:
            GetComponent <Image>().color = Color.green;
            break;

        case GameData.GameState.Planted:
            GetComponent <Image>().color = Color.red;
            break;

        case GameData.GameState.GameOver:
            GetComponent <Image>().color = Color.white;
            break;
        }
    }
Example #7
0
    public void PreInit(GameData.GameState targetState, GeneralDialogue dialogue, Func <Clue, bool> findClue)
    {
        findClueEvent = findClue;

        background.color = ColorTools.LerpColorValues(Skinning.GetSkin(SkinTag.PICTO), ColorTools.Value.SV, new int[2] {
            8, 10
        });

        characterPortrait.Hide();
        characters.ForEach(item => item.Init(() => ChangeCharacter(item.character)));

        ColorBlock block = dialogueScroll.colors;

        block.normalColor      = Skinning.GetSkin(SkinTag.SECONDARY_ELEMENT);
        block.highlightedColor = Skinning.GetSkin(SkinTag.SECONDARY_WINDOW);
        block.pressedColor     = Skinning.GetSkin(SkinTag.CONTRAST);
        dialogueScroll.colors  = block;

        scrollButton.Init(this);

        block                      = scrollButton.button.colors;
        block.normalColor          = Skinning.GetSkin(SkinTag.PRIMARY_ELEMENT);
        block.highlightedColor     = Skinning.GetSkin(SkinTag.PRIMARY_WINDOW);
        block.pressedColor         = Skinning.GetSkin(SkinTag.CONTRAST);
        block.disabledColor        = block.normalColor;
        scrollButton.button.colors = block;

        // when you come back to shogun after defeat
        if (targetState != GameData.GameState.NORMAL)
        {
            // unlocks all clues
            foreach (Clue clue in dialogue.GetAllClues())
            {
                findClue.Invoke(clue);
                AddClueToList(clue, true);
            }
        }

        actualState = targetState;
    }
Example #8
0
    void SpawnConclusions(List <Conclusion> unlockableConclusions, GameData.GameState state)
    {
        conclusionsToUnlock = new List <Conclusion>();

        foreach (Conclusion conclusion in unlockableConclusions)
        {
            ConclusionCard spawned = Instantiate(cardPrefab, cardList);

            spawned.Init(conclusion);

            if (state == GameData.GameState.GAME_OVER_FINISHER)
            {
                spawned.ShowCard();
            }
            else
            {
                spawned.HideCard();
            }

            conclusionsToUnlock.Add(new Conclusion(conclusion.category, conclusion.correctedSubCategory, spawned));
        }
    }
Example #9
0
 private void Start()
 {
     state = GameData.LoadGame(slot);
 }
Example #10
0
 public GameScene(GameData.GameState ID, GameData gd) : base(ID, gd)
 {
 }
Example #11
0
 public Scene(GameData.GameState ID, GameData gd)
 {
     this.ID = ID;
     this.gd = gd;
 }
Example #12
0
File: Bomb.cs Project: Raful/CSBomb
 private void OnStateChanged(GameData.GameState newState)
 {
     InputListener.InterruptMainButton();
     m_buttonPressedTimer = 0;
 }
Example #13
0
 private void Start()
 {
     dropdown = GetComponentInChildren <Dropdown>();
     Language.SetLanguage(Language.Lang.enUS);
     state = GameData.LoadGame(slot);
 }
Example #14
0
 private void OnGameStateChanged(GameData.GameState newState)
 {
     SetTextOnUp();
 }
 public MainMenuScene(GameData.GameState ID, GameData gd) : base(ID, gd)
 {
 }
Example #16
0
    public void SpecificInit(bool useCheats, List <Clue> clueList, List <Conclusion> unlockableConclusions, List <ShogunCharacter> characters, string goodFeedback, string badFeedback, Action returnCallback, Action combatCallback, GameData.GameState actualState)
    {
        this.useCheats    = useCheats;
        toCombat          = combatCallback;
        goodDeityFeedbcak = goodFeedback;
        badDeityFeedback  = badFeedback;

        SpawnKnobs(clueList, characters);
        SpawnConclusions(unlockableConclusions, actualState);

        deityWritter.SetAudio(() => AudioManager.PlaySound("Writting"), () => AudioManager.StopSound("Writting"));

        returnButton.onClick.AddListener(() =>
        {
            returnCallback.Invoke();
            SetStateCursor(false);
            AudioManager.PlaySound("Button");
        });

        combatButton.onClick.AddListener(() =>
        {
            bool can = true;

            foreach (Conclusion conclusion in conclusionsToUnlock)
            {
                if (!conclusion.IsUnlocked(true))
                {
                    can = false;
                }
            }

            if (can)
            {
                SetStateCursor(false);

                if (actualState == GameData.GameState.NORMAL)
                {
                    Invoke(lineTries <= goodGameThreshold ? "StartGoodFeedback" : "StartBadFeedback", 2.55f);
                    anim.Play("GoodFeedback");
                    AudioManager.PlaySound("DeityDeduction");
                }
                else
                {
                    toCombat.Invoke();
                    AudioManager.PlaySound("Button");
                }
            }
            else
            {
                AudioManager.PlaySound("ConclusionFail");
            }
        });

        selectionPath  = new List <Path>();
        persistentPath = new List <Path>();
        selectedClues  = new List <Clue>();

        isSettingPath    = false;
        inFeedback       = false;
        clueDisplayTimer = 0;
        lineTries        = 0;

        foreach (TextMeshProUGUI child in transform.GetChildrenOfType <TextMeshProUGUI>())
        {
            if (child != deityWritter.GetComponent <TextMeshProUGUI>())
            {
                child.font        = streetFont;
                child.wordSpacing = 5;
            }
        }

        ResetPopup();
    }