Inheritance: MonoBehaviour
Beispiel #1
0
    // On entre dans l'état de fin
    public override void OnEnter()
    {
        base.OnEnter();

        game.refs.transitionsTexts.timeOut.SetActive(true);
        game.refs.CameraAudio["timesUp"].clip = game.refs.sounds.TimesUp;
        game.refs.CameraAudio["timesUp"].Play();

        Timer.AddTimer(2, () => {
            cam.transalateWithFade(Vector3.zero, Quaternion.identity, 0, 1f, 1f, 1.5f,
                                   (/* OnFinish */) => {
                CameraFade.wannaDie();
            }, (/* OnFade */) => {
                game.refs.transitionsTexts.timeOut.SetActive(false);
                cam.zoom = 1;
                this.cam.CameraRotatingAroundComponent.StartEndlessRotation(
                    game.refs.positions.rotationCenter,
                    new Vector3(0, 1, 0),
                    game.refs.positions.fieldCenter,
                    game.refs.positions.cameraFirstPosition,
                    cam.game.settings.GameStates.MainState.IntroState.rotationSpeed / 100
                    );

                game.refs.managers.ui.currentState = UIManager.UIState.EndUI;
            }
                                   );
        });
    }
    void Start()
    {
        //連接MatchASourse
        Match_MultiSeletASourse = GetComponent <Match_MultiSelectASourse>();
        m_MoveItems             = Match_MultiSeletASourse.MoveItems;
        m_MatchPosItems         = Match_MultiSeletASourse.MatchPosItems;
        m_SceneSound            = Match_MultiSeletASourse.SceneSounds;
        m_otherAnimObj          = Match_MultiSeletASourse.OtherAnimObjs;
        m_ClickItems            = Match_MultiSeletASourse.clickData;


        //淡出相機
        m_CameraFade = this.gameObject.AddComponent <CameraFade>();
        //判斷播放背景音
        GamePublicAudioControl.Instance.PlaySceneMusic();
        //音量建大
        GamePublicAudioControl.Instance.UpSceneMusic();
        //判斷播放開頭提示音效
        PlaySceneSound(m_SceneSound.TipSound, m_SceneSound.TipSoundOnOff);

        //生成場景物件
        InstanceMoveItem(m_MoveItems, moveItmeObj);
        InstanceMatchPosItem(m_MatchPosItems, matchPosItemObj);
        InstanceOtherAnimObj(m_otherAnimObj);

        //生成場景物件找碴
        InstanceClickItem(m_ClickItems, ClickBtnPrefab);

        //點擊check按鈕事件
        GameEventSystem.Instance.OnPushCheckBtn += CheckPass;
    }
Beispiel #3
0
 void Start()
 {
     CameraFade.StartAlphaFade(Color.black, true, .5f);
     transform.position = currentCam.position;
     transform.rotation = currentCam.rotation;
     GetComponent <Camera> ().orthographicSize = currentCam.orthographicSize;
 }
Beispiel #4
0
 void OnDestroy()
 {
     if (CameraFade.InstanceExists())
     {
         CameraFade.Instance.m_OnFadeFinish -= LoadLevel;
     }
 }
    void Start()
    {
        //連接MatchASourse
        MatchASourse          = GetComponent <MatchASumSourse>();
        m_MoveItems           = MatchASourse.MoveItems;
        m_MatchPosItems       = MatchASourse.MatchPosItems;
        m_SceneSound          = MatchASourse.SceneSounds;
        m_otherAnimObj        = MatchASourse.OtherAnimObjs;
        m_isCloseBackToOriPos = MatchASourse.IsCloseBackToOriPos;
        m_MatchIdArrays       = MatchASourse.MatchIdArrays;
        //淡出相機
        m_CameraFade = this.gameObject.AddComponent <CameraFade>();
        //判斷播放背景音
        GamePublicAudioControl.Instance.PlaySceneMusic();
        //音量建大
        GamePublicAudioControl.Instance.UpSceneMusic();
        //判斷播放開頭提示音效
        PlaySceneSound(m_SceneSound.TipSound, m_SceneSound.TipSoundOnOff);

        //生成場景物件
        InstanceMoveItem(m_MoveItems, moveItmeObj);
        InstanceMatchPosItem(m_MatchPosItems, matchPosItemObj);
        InstanceOtherAnimObj(m_otherAnimObj);

        //點擊check按鈕事件
        GameEventSystem.Instance.OnPushCheckBtn += CheckPass;
    }
Beispiel #6
0
 void Update()
 {
     if (Input.GetKeyDown("x"))
     {
         CameraFade.StartAlphaFade(Color.black, false, 1f, 0f, () => { GameState.Instance.loadStartScreen(); });
     }
 }
Beispiel #7
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);
 }
Beispiel #8
0
    void Start()
    {
        //連接MatchCSourse
        MatchCSourse              = GetComponent <PermutationsSumSourse>();
        m_MoveItems               = MatchCSourse.MoveItems;
        m_MatchPosItems           = MatchCSourse.MatchPosItems;
        m_SceneSound              = MatchCSourse.SceneSounds;
        m_otherAnimObj            = MatchCSourse.OtherAnimObjs;
        m_removeItemObj           = MatchCSourse.removeItemObj;
        m_couldHaveSameChildCount = MatchCSourse.CouldHaveSameChildCount;
        m_didnotHaveSameMatchItem = MatchCSourse.DidnotHaveSameMatchItem;
        //淡出相機
        m_CameraFade = this.gameObject.AddComponent <CameraFade>();
        //判斷播放背景音
        GamePublicAudioControl.Instance.PlaySceneMusic();
        //音量建大
        GamePublicAudioControl.Instance.UpSceneMusic();
        //判斷播放開頭提示音效
        PlaySceneSound(m_SceneSound.TipSound, m_SceneSound.TipSoundOnOff);

        //生成場景物件
        InstanceMoveItem(m_MoveItems, moveItmeObj);
        InstanceMatchPosItem(m_MatchPosItems, matchPosItemObj);
        InstanceOtherAnimObj(m_otherAnimObj);
        InstanceRemoveObj(m_removeItemObj);

        //點擊check按鈕事件
        GameEventSystem.Instance.OnPushCheckBtn += CheckPass;
    }
Beispiel #9
0
    IEnumerator EnterPortal(float time)
    {
        yield return(StartCoroutine(new TimeCallBacks().WaitPause(time)));

        CameraFade.StartAlphaFade(Color.black, false, 0.2f);
        CameraFade.Instance.m_OnFadeFinish += LoadLevel;
    }
Beispiel #10
0
    public override bool OnBallOut()
    {
        Debug.Log("OUT");

        game.Ball.collider.enabled = false;

        //game.refs.transitionsTexts.ballOut.SetActive(true);
        Timer.AddTimer(1, () =>
        {
            game.Referee.StopPlayerMovement();
            cam.transalateWithFade(Vector3.zero, Quaternion.identity, 0f, 1f, 1f, 0.7f,
                                   (/* OnFinish */) => {
                //please, kill after usage x)
                CameraFade.wannaDie();
                cam.game.Referee.EnablePlayerMovement();
            }, (/* OnFade */) => {
                //cam.ChangeCameraState(CameraManager.CameraState.FREE);
                cam.zoom = 1;             //TODO cam settings
                //game.refs.transitionsTexts.ballOut.SetActive(false);
                cam.game.Referee.UnitToGiveBallTo = game.Ball.Team.opponent[2];
                cam.game.Referee.StartPlacement();
                game.Ball.collider.enabled = true;
            }
                                   );
        });

        return(true);
    }
    private Vector3 memoryPosition;    // 引く時のPositionを

    private void Start()
    {
        input          = new PlayerInput();
        move           = new PlayerTeleport();
        drawLine       = new DrawLine(line);
        rope           = new DrawrRope(line);
        pull           = new ControllerPull();
        cursorFunction = new CursorPosition();
        runaway        = new PlayerRunaway();
        anchorAction   = new AnchorShoot();
        postProcess    = eye.GetComponent <PostProcessingBehaviour>();
        cameraFade     = new CameraFade();
        playerMap      = new PlayerMap( );
        lineMt         = line.GetComponent <Renderer>().material;

        banCurcor.SetActive(false);
        cursor = pointCursor;

        goleMapSwitch = true;

        arrowCursor.SetActive(false);

        hibana.gameObject.SetActive(false);

        pullBody.SetActive(false);
        map.SetActive(false);
        particle.SetActive(false);

        viveDevice = SteamVR_Controller.Input((int)viveRightController.GetComponent <SteamVR_RenderModel>().index);
        fadeMt     = fadeObject.GetComponent <MeshRenderer>().material;
        FadeInStart();
    }
Beispiel #12
0
        private IEnumerator Start()
        {
            Camera camera = m_camInputsManager.CurrentCamera;

            m_cameraFade = camera.GetComponent <CameraFade>();
            m_camera     = camera.transform;

            m_pathWalker = camera.GetComponentInParent <PathWalker>();


            if (m_camInputsManager.CurrentInputName == "Touch")
            {
                m_selectionRadial = m_touch.GetComponent <SelectionRadial>();
                m_reticle         = m_touch.GetComponent <Reticle>();
            }
            else
            {
                m_selectionRadial = camera.GetComponent <SelectionRadial>();
                m_reticle         = camera.GetComponent <Reticle>();
            }
            SessionData.SetGameType(m_gameType);
            //loop to all phases
            while (true)
            {
                yield return(StartCoroutine(StartPhase()));

                yield return(StartCoroutine(PlayPhase()));

                yield return(StartCoroutine(EndPhase()));
            }
        }
Beispiel #13
0
 public void OpenSceneWithFader()
 {
     CameraFade.StartAlphaFade(Color.black, false, 1f, 0f, () =>
     {
         SceneManager.LoadScene(sceneIndex);
     });
 }
 void Awake()
 {
     if (mInstance == null)
     {
         mInstance = this as CameraFade;
         instance.Initialize();
     }
 }
Beispiel #15
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;
 }
Beispiel #16
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;
    }
Beispiel #17
0
    IEnumerator Splash()
    {
        yield return(new WaitForSeconds(secondsToWait));

        CameraFade.StartAlphaFade(Preferences.BgColor(), false, 2f, 0f, () => {
            SceneManager.LoadScene(nextLevel);
        });
    }
Beispiel #18
0
 public void GoToScene(int i)
 {
     CameraFade.StartAlphaFade(Color.black, false, 1f, 0f, () =>
     {
         Debug.Log("Opening Scene: " + i);
         SceneManager.LoadScene(i);
     });
 }
Beispiel #19
0
 public void GoToMain()
 {
     CameraFade.StartAlphaFade(Color.black, false, 1f, 0f, () =>
     {
         Debug.Log("Opening Scene");
         SceneManager.LoadScene(0);
     });
 }
 public static bool IsLoading()
 {
     if (CameraFade.IsFading())
     {
         return(true);
     }
     return(_isLoading);
 }
	void Awake()
	{
		if( mInstance == null )
		{
			mInstance = this as CameraFade;
			instance.init();
		}
	}
    public void SetLoadingScene(string sceneName)
    {
        LoadingScreenConfig.loadingSceneName = sceneName;
        CameraFade cameraFade = (CameraFade)((Component)this).get_gameObject().AddComponent <CameraFade>();

        cameraFade.Init();
        cameraFade.StartFadeTo(Color.get_black(), 1f, new Action(this.LoadTargetScene));
    }
    public override void Start()
    {
        base.Start();

        _cameraFade = Camera.main.GetComponent <CameraFade>();
        _cameraFade.OnFadeInCompleted  += OnFadeInCompleted;
        _cameraFade.OnFadeOutCompleted += OnFadeOutCompleted;
    }
Beispiel #24
0
 void Awake()
 {
     if (mInstance == null)
     {
         mInstance = this as CameraFade;
         instance.init();
     }
 }
Beispiel #25
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);
 }
Beispiel #26
0
 private void LoadRaceCallback(LoadRaceMessage msg, float travelTime)
 {
     StopLobbyTimer();
     CameraFade.StartAlphaFade(Color.black, false, 0.3f, 0.05f, () =>
     {
         GoToStage();
     });
 }
 // 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());
     });
 }
Beispiel #28
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, () => { });
    }
Beispiel #29
0
    public void Die()
    {
        this.transform.position = new Vector3(999999.9f, 999999.9f);

        CameraFade.StartAlphaFade(Color.black, false, 2f, 0f, () => {
            SceneManager.LoadScene(this.actualLevel);
        });
    }
Beispiel #30
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;
         * }
         */
    }
Beispiel #31
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);
 }
Beispiel #32
0
    //float FADE_DELAY = 0f;
    //float FADE_TIME = 1f;
    void Awake()
    {
        current = this;

        if (debug) {
            debugTools.SetActive(true);
            GetComponent<UnityEngine.UI.GraphicRaycaster>().enabled = true;
        }
    }
    void Start()
    {
        Physics.gravity = new Vector3(0.0f,-9.81f,0.0f);

        fade = GetComponent<CameraFade>();

        fade.SetScreenOverlayColor(FullFadeColor); //setup start fade color
        fade.StartFade(EmptyFadeColor, FadeInTime);
    }
	protected override void Awake()
	{
		if( mInstance == null )
		{
			base.Awake();
			mInstance = this as CameraFade;
			Instance.init();
		}
	}
    void Start()
    {
        camFadeOut = fadeOutPlane.GetComponent<CameraFade>();

        defaultPos = Camera.main.transform.position;

        desiredPos = Camera.main.transform.position;
        desiredPos.x = -1;

        if (Application.loadedLevelName == "MainMenu")
        {
            isMainMenu = true;
        }
    }
Beispiel #36
0
	public override void Start() {
		base.Start();
		fader = Camera.main.GetComponent<CameraFade>();

		GameObject bgm = GameObject.Find ("BGM");

		if(bgm) {
			mus = bgm.GetComponent<MusicPlayer>();
		}

		// save the current scene for the game over "try again" feature
		// (note: this doesn't really belong here, but every level has a PauseGUI script
		//  and so this where where I decided to put it)
		PlayerPrefs.SetString("LastScenePlayed", Application.loadedLevelName);

		PlayerPrefs.Save();
	}
 private void Die()
 {
     mInstance = null;
     Destroy(gameObject);
 }
Beispiel #38
0
 void Start()
 {
     camFadeOut = fadeOutPlane.GetComponent<CameraFade>();
 }
	protected void Die()
	{
		CallEvent();
		mInstance = null;
		Destroy(gameObject);
	}
Beispiel #40
0
 void Start()
 {
     if (!fader){
         fader = GetComponent<CameraFade>();
     }
 }
	protected virtual void OnApplicationQuit()
	{
		mInstance = null;
	}
Beispiel #42
0
 void OnApplicationQuit()
 {
     Destroy(gameObject);
     mInstance = null;
 }
 //  AfterFadeFunction fun;
 public void KillAll()
 {
     instance = null;
     Destroy(gameObject);
 }
 private void OnApplicationQuit()
 {
     mInstance = null;
 }
Beispiel #45
0
 void OnDestroy()
 {
     current = null;
 }