Exemplo n.º 1
0
 public void OnStart()
 {
     zone = GameObject.GetGameObjectByName("scp_zone").RequireComponent<CZone>();
     rand = new Random();
     target = null;
     speed = new Vector3(.3f,.8f,-.5f);
     sound = gameObject.RequireComponent<CSound>();
     fx = GameObject.GetGameObjectByName("Camera").RequireComponent<CArtifactFX>();
     sound.PlayIndependentEvent("CREATURE_CLOSE.vente", true, 1);
 }
    public static bool UpdateOptionsMenu(float dt, GameObject pointerObj, ref int index, Vector3 offset, CSound sound)
    {
        if (Input.GetTriggered(0, "MenuBack") != 0.0f)
            return true;

        if (Input.GetTriggered(0, "MenuSelect") != 0.0f)
        {
            switch (index)
            {
                case 0: // Fullscreen
                    {
                        bool isFullscreen = Engine.getInstance().GetGameWnd().IsFullScreen();
                        Engine.getInstance().GetGameWnd().SetFullScreen(!isFullscreen);
                        Common.GetMenuFullscreenX().setEnabled(!isFullscreen);
                    }
                    break;
                case 2: // Mute
                    {
                        bool isMute = AudioManager.getInstance().GetMuteSound();
                        //AudioManager.getInstance().SetMuteMusic(!isMute);
                        AudioManager.getInstance().SetMuteSound(!AudioManager.getInstance().GetMuteSound());

                        Common.GetMenuMuteX().setEnabled(!isMute);

                        SetVolumeText();
                    }
                    break;
            }
        }
        if (index == 1) // over volume
        {
            if (Common.TriggeredLeft() || Common.TriggeredRight())
            {
                float currVolume = AudioManager.getInstance().GetSoundVolume();
                if (Common.TriggeredLeft())
                {
                    currVolume -= 0.1f;
                    if (currVolume < 0.0f)
                        currVolume = 0.0f;
                }
                else
                {
                    currVolume += 0.1f;
                    if (currVolume > 1.0f)
                        currVolume = 1.0f;

                    if (AudioManager.getInstance().GetMuteSound())
                    {
                        AudioManager.getInstance().SetMuteSound(false);
                        Common.GetMenuMuteX().setEnabled(false);
                    }
                }
                AudioManager.getInstance().SetSoundVolume(currVolume);
                // Might be mute, so get the actual vol again
                SetVolumeText();

                Common.GetMenuMuteX().setEnabled(AudioManager.getInstance().GetMuteSound()); // Show updated mute or not
            }
        }

        if (Common.TriggeredUp() || Common.TriggeredDown())
        {
            sound.PlayIndependentEvent("BUTTON_GREEN.vente", false, 0);

            if (Common.TriggeredDown())
            {
                if (index < 2)
                    ++index;
            }
            else
            {
                if (index != 0)
                    --index;
            }
            PositionOptionsPointer(pointerObj, index, offset);
        }

        return false; // No back button pressed (stay in options menu)
    }
    public void OnStart()
    {
        mSound = gameObject.RequireComponent<CSound>();
        mSound.PlayIndependentEvent("MUSIC_HUB_LOOP.vente", false, 0);

        menuPointer = GameObject.GetGameObjectByName(Common.prefix + menuPointerName);
        Common.SetOpacityToGameObject(0.0f, menuPointer);
        menuPointerInitPos = new Vector3(-2.75f, 1.23f, -0.11f);
        menuPointer.transform.SetPosition(menuPointerInitPos);
        screenImage = GameObject.GetGameObjectByName(Common.prefix + screenImageName);
        screenImageMesh = screenImage.RequireComponent<CDiffuseRenderer>();
        fadeScreen = GameObject.GetGameObjectByName(Common.prefix + fadeScreenName);
        Common.SetOpacityToGameObject(fadeOpacity, fadeScreen); // Start with full black

        Common.GetMenuFullscreenX().setEnabled(false);
        Common.GetMenuMuteX().setEnabled(false);
        Common.GetMenuVolumeFont().setEnabled(false);

        mLoadingFirstTime = true;
        mPrevMainMenuState = -1;
        mMainMenuState = -1;
    }
 public void OnStart()
 {
     sound = gameObject.RequireComponent<CSound>();
     fx = Common.GetStealthPlayerCamera().RequireComponent<CArtifactFX>();
     sound.PlayIndependentEvent("CREATURE_CLOSE.vente", true, 1);
 }
Exemplo n.º 5
0
 public void OnStart()
 {
     sound_ = gameObject.RequireComponent<CSound>();
     sound_.PlayIndependentEvent(soundtoplay, false, 0);
 }