Example #1
0
    //Applies selected difficulty setting
    public void SetDifficulty(LockDifficulty insert_Difficulty)
    {
        if (!m_Shell_Visual_Ref || !m_Plug_Visual_Ref)
        {
            Debug.LogError("[Error] Lock Visual references incomplete! Could not set game difficulty.");
            return;
        }
        if (!m_Opaque_Grey || !m_Opaque_Yellow || !m_Translucent_Grey || !m_Translucent_Yellow)
        {
            Debug.LogError("[Error] Material references incomplete! Could not set game difficulty.");
            return;
        }

        switch (insert_Difficulty)
        {
        case LockDifficulty.Default:
            m_Lockpick_Game_Difficulty  = LockDifficulty.Easy;
            m_Plug_Visual_Ref.material  = m_Translucent_Yellow;
            m_Shell_Visual_Ref.material = m_Translucent_Grey;
            break;

        case LockDifficulty.Easy:
            m_Lockpick_Game_Difficulty  = LockDifficulty.Easy;
            m_Plug_Visual_Ref.material  = m_Translucent_Yellow;
            m_Shell_Visual_Ref.material = m_Translucent_Grey;
            break;

        case LockDifficulty.Medium:
            m_Lockpick_Game_Difficulty  = LockDifficulty.Medium;
            m_Plug_Visual_Ref.material  = m_Opaque_Yellow;
            m_Shell_Visual_Ref.material = m_Translucent_Grey;
            break;

        case LockDifficulty.Hard:
            m_Lockpick_Game_Difficulty  = LockDifficulty.Hard;
            m_Plug_Visual_Ref.material  = m_Opaque_Yellow;
            m_Shell_Visual_Ref.material = m_Opaque_Grey;
            break;

        default:
            m_Lockpick_Game_Difficulty  = LockDifficulty.Easy;
            m_Plug_Visual_Ref.material  = m_Translucent_Yellow;
            m_Shell_Visual_Ref.material = m_Translucent_Grey;
            break;
        }
    }
Example #2
0
    //Checks selected dificulty from the difficulty drop down UI and applies the corresponding settings.
    public void ReadDifficulty()
    {
        if (!m_Shell_Visual_Ref || !m_Plug_Visual_Ref)
        {
            Debug.LogError("[Error] Lock Visual references incomplete! Could not set game difficulty.");
            return;
        }
        if (!m_Opaque_Grey || !m_Opaque_Yellow || !m_Translucent_Grey || !m_Translucent_Yellow)
        {
            Debug.LogError("[Error] Material references incomplete! Could not set game difficulty.");
            return;
        }
        if (!m_Difficulty_Dropdown_Result)
        {
            Debug.LogError("{Error] ...");
            return;
        }

        switch (m_Difficulty_Dropdown_Result.text)
        {
        case "Easy":
            m_Lockpick_Game_Difficulty  = LockDifficulty.Easy;
            m_Plug_Visual_Ref.material  = m_Translucent_Yellow;
            m_Shell_Visual_Ref.material = m_Translucent_Grey;
            break;

        case "Medium":
            m_Lockpick_Game_Difficulty  = LockDifficulty.Medium;
            m_Plug_Visual_Ref.material  = m_Opaque_Yellow;
            m_Shell_Visual_Ref.material = m_Translucent_Grey;
            break;

        case "Hard":
            m_Lockpick_Game_Difficulty  = LockDifficulty.Hard;
            m_Plug_Visual_Ref.material  = m_Opaque_Yellow;
            m_Shell_Visual_Ref.material = m_Opaque_Grey;
            break;

        default:
            m_Plug_Visual_Ref.material  = m_Translucent_Yellow;
            m_Shell_Visual_Ref.material = m_Translucent_Grey;
            break;
        }
    }