StartAlphaFade() публичный статический Метод

Starts the fade from color newScreenOverlayColor. If isFadeIn, start fully opaque, else start transparent.
public static StartAlphaFade ( Color newScreenOverlayColor, bool isFadeIn, float fadeDuration ) : void
newScreenOverlayColor Color /// Target screen overlay Color. ///
isFadeIn bool
fadeDuration float /// Fade duration. ///
Результат void
Пример #1
0
    void FinishGivePiece()
    {
        collectable_UI.onFinish -= FinishGivePiece;
        collectable_UI.gameObject.SetActive(false);


        SaveManager.Instance.LevelCollectableLoaded = Application.loadedLevelName;

        if (posToShow == -1)
        {
            SaveManager.Instance.LevelToLoadVideoCollectable = SaveManager.Instance.LevelToLoadCollectable;
        }
        else
        {
            if (CollectablesManager.isCollectableReady(TypeLevel))
            {
                if (CollectablesManager.isCollectableFull(TypeLevel))
                {
                    SaveManager.Instance.LevelToLoadVideoCollectable = Door.NextScene;
                }
                else
                {
                    SaveManager.Instance.LevelToLoadVideoCollectable = SaveManager.Instance.LevelToLoadCollectable;
                }
            }
        }

        CameraFade.StartAlphaFade(Color.black, false, 0.2f);
        CameraFade.Instance.m_OnFadeFinish += LoadLevel;
    }
Пример #2
0
 void Update()
 {
     if (battingResult == BattingResult.CHANGE && Input.GetMouseButtonDown(0))
     {
         CameraFade.StartAlphaFade(Color.black, false, 0.5f, 0, () => { Application.LoadLevel("Title"); });
     }
 }
Пример #3
0
 // Update is called once per frame
 void Update()
 {
     waitUpdate += 1;
     waitUpdate %= 10;
     if (waitUpdate == 1)
     {
         StaticManager.updateAvailableStage();
         getStaticData();
         updateMaterial();
     }
     if (onMouse)
     {
         if (Input.GetMouseButtonDown(0) && StaticManager.stageAvailable[level - 1, stage - 1])
         {
             if (stageExist && !Input.GetKey(KeyCode.LeftShift))
             {
                 string stageName = "Stage-" + level.ToString() + "," + stage.ToString();
                 TitlePhaseController.phase = "Game";
                 CameraFade.StartAlphaFade(Color.white, false, 1f, 0f, () => { Application.LoadLevel(stageName); });
             }
             else
             {
                 StaticManager.stageClear[level - 1, stage - 1] = true;
                 StaticManager.saveData();
             }
         }
     }
 }
Пример #4
0
    private void OnPlayerDied(PlayerType param)
    {
        _advanceCountdown = advanceLevelDelayLevelDeath;
        _nextLevelName    = _levelSequence[_currentLevel];

        CameraFade.StartAlphaFade(Color.black, false, _advanceCountdown, 2f, () => { Application.LoadLevel(_nextLevelName); });
    }
Пример #5
0
 public void OpenSceneWithFader()
 {
     CameraFade.StartAlphaFade(Color.black, false, 1f, 0f, () =>
     {
         SceneManager.LoadScene(sceneIndex);
     });
 }
Пример #6
0
    void Start()
    {
        CameraFade.StartAlphaFade(Color.black, true, 3f, 0f);
        if (_instance != null)
        {
            Destroy(gameObject);
            return;
        }

        for (var i = 0; i < _levelSequence.Length; i++)
        {
            if (_levelSequence[i] == Application.loadedLevelName)
            {
                _currentLevel = i;
            }
        }

        _instance = this;

        Object.DontDestroyOnLoad(this);

        GameEventMgr.Instance.AddListener <PlayerType>(GameEvents.PlayerFinishedLevel, OnFinishedLevel);
        GameEventMgr.Instance.AddListener <PlayerType>(GameEvents.PlayerDied, OnPlayerDied);
        GameEventMgr.Instance.AddListener(GameEvents.PlayerHitMaxFear, OnPlayerHitMaxFear);
    }
Пример #7
0
 void Update()
 {
     if (Input.GetKeyDown("x"))
     {
         CameraFade.StartAlphaFade(Color.black, false, 1f, 0f, () => { GameState.Instance.loadStartScreen(); });
     }
 }
Пример #8
0
 // Use this for initialization
 void Start()
 {
     pathFollower      = transform.parent.GetComponent <PathFollower>();
     pathFollower.path = paths[currentPath];
     ball = GameObject.Find("DisplayBall");
     CameraFade.StartAlphaFade(Color.black, true, 5);
 }
Пример #9
0
 public void ChangeLevel()
 {
     CameraShake.Instance.StopShake();
     Time.timeScale = 1;
     CameraFade.StartAlphaFade(Color.black, false, 0.2f);
     CameraFade.Instance.m_OnFadeFinish += ActivateLevel;
 }
Пример #10
0
 void Start()
 {
     CameraFade.StartAlphaFade(Color.black, true, .5f);
     transform.position = currentCam.position;
     transform.rotation = currentCam.rotation;
     GetComponent <Camera> ().orthographicSize = currentCam.orthographicSize;
 }
Пример #11
0
 // Update is called once per frame
 void Update()
 {
     if (!fadeInStarted)
     {
         CameraFade.StartAlphaFade(Color.black, true, 2f, 0f, () => { fadeInCompleted = true; });
         fadeInStarted = true;
     }
     else
     {
         if (Application.CanStreamedLevelBeLoaded(1) && fadeInCompleted)
         {
             if (!fadeOutStarted)
             {
                 GameState.Instance.WaitThenCall(0.5f, () => {
                     CameraFade.StartAlphaFade(Color.black, false, 2f, 0f, () => { GameState.Instance.loadStartScreen(); });
                     fadeOutStarted = true;
                 });
             }
             tinyBar.transform.localScale = new Vector3(1, 1, 1);
         }
         else
         {
             Vector3 progTransform = new Vector3(Application.GetStreamProgressForLevel(1), 1, 1);
             tinyBar.transform.localScale = progTransform;
         }
     }
 }
Пример #12
0
    IEnumerator EnterPortal(float time)
    {
        yield return(StartCoroutine(new TimeCallBacks().WaitPause(time)));

        CameraFade.StartAlphaFade(Color.black, false, 0.2f);
        CameraFade.Instance.m_OnFadeFinish += LoadLevel;
    }
Пример #13
0
 public void GoToMain()
 {
     CameraFade.StartAlphaFade(Color.black, false, 1f, 0f, () =>
     {
         Debug.Log("Opening Scene");
         SceneManager.LoadScene(0);
     });
 }
 // Use this for initialization
 void Start()
 {
     LoadingAnimation.Color = GlobalData.Instance.SolidColors[GlobalData.Instance.GameMode];
     PersistentUtility.Instance.PeriodHashObtained += OnPeriodHashObtained;
     CameraFade.StartAlphaFade(Color.white, true, 1f, 0, () => {
         StartCoroutine(PersistentUtility.Instance.GetPeriodHash());
     });
 }
Пример #15
0
 public static void SceneSwitch(int index)
 {
     //OnFinishFade callback = GameManager.i.LoadLevel (index);
     //callback (index);
     CameraFade.StartAlphaFade(Color.black, false, 1f);
     GameManager.manager.StartCoroutine(LoadLevel(index));
     //GameManager.i.LoadLevel (index);
 }
Пример #16
0
 public void exitGameYes()
 {
     SaveManager.Instance.Save();
     SteamAPI.Shutdown();
     CameraFade.StartAlphaFade(Color.black, false, 0.2f, 0.2f);
     StartCoroutine(WaitSeconds());
     CameraFade.Instance.m_OnFadeFinish += QuitGame;
 }
Пример #17
0
    public void NewGameYes()
    {
        SaveManager.Instance.SetHistory();
        SaveManager.Instance.dataKlaus.SetCurrentLevel("W1L01-1");

        CameraFade.StartAlphaFade(Color.black, false, 0.2f, 0.2f);
        CameraFade.Instance.m_OnFadeFinish += ActivateManualty;
    }
Пример #18
0
    IEnumerator Splash()
    {
        yield return(new WaitForSeconds(secondsToWait));

        CameraFade.StartAlphaFade(Preferences.BgColor(), false, 2f, 0f, () => {
            SceneManager.LoadScene(nextLevel);
        });
    }
Пример #19
0
 private void LoadRaceCallback(LoadRaceMessage msg, float travelTime)
 {
     StopLobbyTimer();
     CameraFade.StartAlphaFade(Color.black, false, 0.3f, 0.05f, () =>
     {
         GoToStage();
     });
 }
Пример #20
0
    /*void OnGUI () {
     *      if(fuelUsed >0){
     *              GUI.Label(new Rect (10, 60, 100, 20), "Fuel Used: " +fuelUsed);
     *      }
     * }*/

    void OnLevelWasLoaded()
    {
        LoadCheckPoints();
        SaveState();

        Application.targetFrameRate = 50;
        CameraFade.StartAlphaFade(Color.black, true, 1.2f, 0f, () => { });
    }
Пример #21
0
 public void GoToScene(int i)
 {
     CameraFade.StartAlphaFade(Color.black, false, 1f, 0f, () =>
     {
         Debug.Log("Opening Scene: " + i);
         SceneManager.LoadScene(i);
     });
 }
Пример #22
0
    public void Die()
    {
        this.transform.position = new Vector3(999999.9f, 999999.9f);

        CameraFade.StartAlphaFade(Color.black, false, 2f, 0f, () => {
            SceneManager.LoadScene(this.actualLevel);
        });
    }
Пример #23
0
    /// <summary>
    /// Update this instance.
    /// </summary>
    void Update()
    {
        // Use last device which provided input.
        inputDevice = InputManager.ActiveDevice;
        if (inputDevice.Action1.WasPressed)
        {
            switch (selected)
            {
            case Selected.Done:
            default:
                // Load the next level
                CameraFade.StartAlphaFade(Color.black, false, 1.5f, 0.0f, () =>
                {
                    // Hide the stats UI
                    GameController.controller.hideStats();
                    // Enable the ability to pause
                    GameController.controller.enablePause();
                    // Enable control again
                    GameController.controller.setControllable(true);
                    if (nextLevel == "NinjaMorph")
                    {
                        Destroy(GameController.instance);
                    }
                    Application.LoadLevel(nextLevel);
                });
                break;
            }
        }

        switch (selected)
        {
        case Selected.Done:
        default:
            gameObject.GetComponent <PulseText>().selected = this.name == "DoneButton";
            break;
        }

        /* Not necessary currently
         * movementTrigger += deltaTime;
         * // Handle transitioning between the selected menu items
         * if (movementTrigger < 0.25f)
         *      return;
         * if (inputDevice.DPadDown.WasPressed ||
         *  inputDevice.LeftStick.Down.WasPressed)
         * {
         *      movementTrigger = 0.0f;
         *      if (selected == Selected.Restart)
         *              selected = Selected.MainMenu;
         * }
         * if (inputDevice.DPadUp.WasPressed ||
         *  inputDevice.LeftStick.Up.WasPressed)
         * {
         *      movementTrigger = 0.0f;
         *      if (selected == Selected.MainMenu)
         *              selected = Selected.Restart;
         * }
         */
    }
Пример #24
0
 /*
  *
  * Destination          : the position to translate to
  * Delay				: when to do it
  * BlackscreenDuration	: time of black
  * Onfinish				: Action to do on finish
  *
  */
 public void transalateWithFade(Vector3 destination, float delay, float fadeiInDuration, float fadeOutDuration, float blackScreenDuration, Action Onfinish)
 {
     CameraFade.StartAlphaFade(Color.black, false, fadeiInDuration, delay, () => {
         this.gameCamera.transform.Translate(destination);
         CameraFade.StartAlphaFade(Color.black, true, fadeOutDuration, blackScreenDuration, () => {
             Onfinish();
         });
     });
 }
 void OnMouseDown()
 {
     this.audioSource[0].clip = soundSelect;
     this.audioSource[0].Play();
     bgmFade = true;
     CameraFade.StartAlphaFade(Color.black, false, 0.5f, 0.2f, () => {
         SceneManager.LoadScene("Title");
     });
 }
Пример #26
0
 IEnumerator restart()
 {
     fallingOut = true;
     CameraFade.StartAlphaFade(Color.black, false, 1f, 0f);
     setRestartPlayerData();
     CameraFade.StartAlphaFade(Color.black, true, 1f, 0f);
     fallingOut = false;
     yield return(null);
 }
Пример #27
0
    public IEnumerator RestartBall()
    {
        yield return(new WaitForSeconds(ResetDelay));

        started        = false;
        rb.constraints = RigidbodyConstraints.FreezeAll;
        CameraFade.StartAlphaFade(Color.black, false, 2f, 2f, () => { SceneManager.LoadScene("Scene6_Score"); });
        moveTimer = 0.0f;
    }
Пример #28
0
 public void LoadMemory(string name)
 {
     SaveManager.Instance.SetHistory();
     SaveManager.Instance.comingFromHistoryArcadeMode = true;
     SaveManager.Instance.comingFromMemoryMode        = true;
     //SaveManager.Instance.dataKlaus.SetCurrentLevel(name);
     m_levelToLoad = name;
     CameraFade.StartAlphaFade(Color.black, false, 0.2f, 0.2f);
     CameraFade.Instance.m_OnFadeFinish += LoadLevel;
 }
Пример #29
0
 void Update()
 {
     if (Input.GetButtonDown("Escape"))
     {
         if (Application.loadedLevelName != "MainMenu")
         {
             CameraFade.StartAlphaFade(Color.black, false, 2f, 0f, () => { Application.LoadLevel("MainMenu"); });
         }
     }
 }
Пример #30
0
 void OnTriggerExit(Collider other)
 {
     if (other.gameObject.tag == "PlayerModel")
     {
         //カメラフェードクラスを使用
         CameraFade.StartAlphaFade(Color.white, false, 2f, 0f, () => {
             Application.LoadLevel("Stage" + NextStageNum);
         });
     }
 }