Exemple #1
0
    public IEnumerator Move(MovementPlaneTransition State)
    {
        Vector3 ParticlePosition;

        if (m_CameraScript.m_BackPlane)
        {
            ParticlePosition = new Vector3(transform.position.x, transform.position.y, 0.0f);
        }
        else
        {
            ParticlePosition = transform.position;
        }

        Physics.Raycast(ParticlePosition, -Vector3.up, out m_Hit, 1 << LayerMask.NameToLayer("Terrain"));

        m_BlockInput = true;

        yield return(m_CameraScript.StartCoroutine("Move", m_Hit.point));

        m_BlockInput = false;


        DestroyPosition();
        State.FinishTransition();
    }
Exemple #2
0
    public IEnumerator ChangeScene(MovementPlaneTransition State)
    {
        if (Root.Instance != null)
        {
            m_BlockInput = true;

            yield return(new WaitForEndOfFrame());

            if (Root.Instance.m_CurrentSceneScript.m_ReturnPosition != null)
            {
                Root.Instance.m_CurrentSceneScript.m_StartPosition = Root.Instance.m_CurrentSceneScript.m_ReturnPosition;
            }



            Root.Instance.m_LoadingScreen.gameObject.SetActive(true);
            Root.Instance.m_LoadingScreen.StartCoroutine(Root.Instance.m_LoadingScreen.FadeIn(false));

            yield return(new WaitForSeconds(1.0f));


            if (Root.Instance.m_Outdoors != null)
            {
                Root.Instance.m_Outdoors.gameObject.SetActive(false);
            }


            if (Root.Instance.m_Chapel == null)
            {
                Root.Instance.result = Application.LoadLevelAdditiveAsync("Cathedral");

                while (Root.Instance.result != null && !Root.Instance.result.isDone)
                {
                    yield return(new WaitForFixedUpdate());
                }
            }
            else
            {
                Root.Instance.m_Chapel.SetActive(true);

                yield return(new WaitForSeconds(2.0f));
            }


            Root.Instance.m_LoadingScreen.StartCoroutine(Root.Instance.m_LoadingScreen.FadeOut());

            DestroyPosition();
            State.FinishTransition();

            m_BlockInput = false;
        }
    }
    public override void Update()
    {
        base.Update();

        if (m_PlaneShiftButton == 0.0f)
        {
            (m_Character as PlayerCharacterController).m_BackgroundPosition.gameObject.SendMessage("DestroyPosition");
            m_NextState = new MovementIdle(m_Character);
        }
        if (m_JumpButton)
        {
            m_NextState = new MovementPlaneTransition(m_Character);
        }
    }
    public override void Update()
    {
        base.Update();

        if (m_PlaneShiftButton == 0.0f)
        {
            (m_Character as PlayerCharacterController).m_BackgroundPosition.gameObject.SendMessage("DestroyPosition");
            m_NextState = new MovementIdle(m_Character);
        }
        if (m_JumpButton)
        {
            m_NextState = new MovementPlaneTransition(m_Character);
        }
    }
    public IEnumerator ChangeScene(MovementPlaneTransition State)
    {
        if (Root.Instance != null)
        {
            m_BlockInput = true;

            yield return new WaitForEndOfFrame();

            if (Root.Instance.m_CurrentSceneScript.m_ReturnPosition != null)
            {
                Root.Instance.m_CurrentSceneScript.m_StartPosition = Root.Instance.m_CurrentSceneScript.m_ReturnPosition;
            }

            Root.Instance.m_LoadingScreen.gameObject.SetActive(true);
            Root.Instance.m_LoadingScreen.StartCoroutine(Root.Instance.m_LoadingScreen.FadeIn(false));

            yield return new WaitForSeconds(1.0f);

            if (Root.Instance.m_Outdoors != null)
            {
                Root.Instance.m_Outdoors.gameObject.SetActive(false);
            }

            if (Root.Instance.m_Chapel == null)
            {
                Root.Instance.result = Application.LoadLevelAdditiveAsync("Cathedral");

                while (Root.Instance.result != null && !Root.Instance.result.isDone)
                {

                    yield return new WaitForFixedUpdate();
                }
            }
            else
            {
                Root.Instance.m_Chapel.SetActive(true);

                yield return new WaitForSeconds(2.0f);
            }

            Root.Instance.m_LoadingScreen.StartCoroutine(Root.Instance.m_LoadingScreen.FadeOut());

            DestroyPosition();
            State.FinishTransition();

            m_BlockInput = false;
        }
    }
Exemple #6
0
    public void MoveCamera(MovementPlaneTransition State)
    {
        if (!m_BlockInput && m_AllowPlaneShift == 2)
        {
            StartCoroutine("Move", State);
        }
        else if (!m_BlockInput && m_AllowPlaneShift == 1)
        {
            StartCoroutine("MoveWithoutCamera", State);
        }
        else if (!m_BlockInput && m_AllowPlaneShift == 3)
        {
            StartCoroutine("ChangeScene", State);
        }
        else if (!m_BlockInput && m_AllowPlaneShift == 4)
        {
            Time.timeScale = 1.0f;

            if (Root.Instance != null)
            {
                Root.Instance.m_Music.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
                Root.Instance.m_Waterfall.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
                Root.Instance.m_Walksound.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
                Root.Instance.m_Music.setPaused(false);
                Root.Instance.m_Waterfall.setPaused(false);
                Root.Instance.m_Walksound.setPaused(false);
            }

            Destroy(Root.Instance.m_Character.gameObject);
            Application.LoadLevel("Credits");
        }
        else if (!m_BlockInput)
        {
            State.FinishTransition();
        }
    }
    public IEnumerator MoveWithoutCamera(MovementPlaneTransition State)
    {
        Vector3 ParticlePosition;
        if (m_CameraScript.m_BackPlane)
        {
            ParticlePosition = new Vector3(transform.position.x, transform.position.y, 0.0f);
        }
        else
        {
            ParticlePosition = transform.position;
        }

        Physics.Raycast(ParticlePosition, -Vector3.up, out m_Hit, 1 << LayerMask.NameToLayer("Terrain"));

        m_BlockInput = true;

        yield return m_CameraScript.StartCoroutine("MoveWithoutCamera", m_Hit.point);

        m_BlockInput = false;

        DestroyPosition();
        State.FinishTransition();
    }
    public void MoveCamera(MovementPlaneTransition State)
    {
        if (!m_BlockInput && m_AllowPlaneShift == 2)
        {
            StartCoroutine("Move", State);
        }
        else if (!m_BlockInput && m_AllowPlaneShift == 1)
        {
            StartCoroutine("MoveWithoutCamera", State);
        }
        else if (!m_BlockInput && m_AllowPlaneShift == 3)
        {
            StartCoroutine("ChangeScene", State);
        }
        else if(!m_BlockInput && m_AllowPlaneShift == 4)
        {
            Time.timeScale = 1.0f;

            if (Root.Instance != null)
            {
                Root.Instance.m_Music.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
                Root.Instance.m_Waterfall.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
                Root.Instance.m_Walksound.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
                Root.Instance.m_Music.setPaused(false);
                Root.Instance.m_Waterfall.setPaused(false);
                Root.Instance.m_Walksound.setPaused(false);
            }

            Destroy(Root.Instance.m_Character.gameObject);
            Application.LoadLevel("Credits");
        }
        else if (!m_BlockInput)
        {
            State.FinishTransition();
        }
    }