Example #1
0
    public void AddPlayer(Player player)
    {
        //We do this even if fog of war is currently disabled (so we can enable it at any time)
        m_IsExplored = true;

        //Also explore all our neighbours
        for (int i = 0; i <= (int)Direction.West; ++i)
        {
            Node neighbour = m_Neighbours[i];

            if (neighbour != null)
            {
                neighbour.Explore();
            }
        }

        //Nodes dissapear mode
        if (SaveGameManager.GetBool(SaveGameManager.SAVE_OPTION_NODESDISAPPEAR, false))
        {
            m_IsAccessible = false;
        }

        //Let the world know
        if (PlayerEnterEvent != null)
        {
            PlayerEnterEvent(player);
        }
    }
Example #2
0
    private void Start()
    {
        SaveGameManager.BoolVariableChangedEvent += OnSaveGameBoolVariableChanged;
        SaveGameManager.DeletedEvent             += OnDeleteSaveGame;

        if (m_Visuals != null)
        {
            m_Visuals.SetActive(SaveGameManager.GetBool(SaveGameManager.SAVE_OPTION_FOGOFWAR, true));
        }
    }
    private void OnPlayerInputMistake()
    {
        //Check if te option is enabled
        if (SaveGameManager.GetBool(SaveGameManager.SAVE_OPTION_NEWCHARSONMISTAKE, true) == false)
        {
            return;
        }

        if (m_LevelGenerator != null)
        {
            m_LevelGenerator.AssignNodeTextCharacters();
        }
    }
Example #4
0
    private void Start()
    {
        //Thanks to RequireComponent
        m_Toggle = GetComponent <Toggle>();

        SaveGameManager.DeletedEvent += OnDeleteSaveGame;

        //Init state
        bool isOn = SaveGameManager.GetBool(m_VariableName, m_DefaultValue);

        if (isOn != m_Toggle.isOn)
        {
            m_Toggle.isOn = isOn;
        }
    }
Example #5
0
    private void OnInputMistake()
    {
        //Check if te option is enabled
        if (SaveGameManager.GetBool(SaveGameManager.SAVE_OPTION_SCREENSHAKE, true) == false)
        {
            return;
        }

        if (m_ShakeRoutine != null)
        {
            StopCoroutine(m_ShakeRoutine);
        }

        m_ShakeRoutine = StartCoroutine(ShakeRoutine());
    }
Example #6
0
    private void UpdateVisualText()
    {
        //Function that manages all the visual stuff, so we don't spread this all over the place
        if (m_Text == null)
        {
            return;
        }

        m_Text.enabled = (m_Characters.Count == 0) && m_IsAccessible && m_IsVisible && (m_TextCharacter != '+'); //TEMP for alternative movement prototyping

        //Check if fog of war is enabled
        if (SaveGameManager.GetBool(SaveGameManager.SAVE_OPTION_FOGOFWAR, true))
        {
            //Only show the character once we've explored it
            if (m_IsExplored)
            {
                m_Text.text = m_TextCharacter.ToString();

                if (m_IsExit)
                {
                    m_Text.color = Color.yellow;
                }
                else
                {
                    m_Text.color = Color.white;
                }
            }
            else
            {
                m_Text.text  = "?";
                m_Text.color = Color.black;
            }
        }
        else
        {
            //Just show the character
            m_Text.text = m_TextCharacter.ToString();

            if (m_IsExit)
            {
                m_Text.color = Color.yellow;
            }
            else
            {
                m_Text.color = Color.white;
            }
        }
    }