public override IEnumerator Run()
    {
        Who.View.transform.SetParent(Where.View.transform);
        float   timer    = 0;
        Vector3 startPos = Who.View.transform.localPosition;
        Vector3 endPos   = new Vector3(0, 0, -0.1f);

        while (timer < 1)
        {
            timer += Time.deltaTime / 0.1f;
            float t = God.Ease(timer, true);
            Who.View.transform.localPosition = Vector3.Lerp(startPos, endPos, t);
            yield return(null);
        }
        Who.View.transform.localPosition = endPos;
    }
Example #2
0
    public override IEnumerator Run()
    {
        Score.View.transform.SetParent(Player.View.transform);
        float   timer     = 0;
        Vector3 startPos  = Score.View.transform.localPosition;
        Vector3 endPos    = new Vector3(0, 0, -0.1f);
        Vector3 startSize = Score.View.transform.localScale;
        Vector3 endSize   = new Vector3(0, 0, 1);

        while (timer < 1)
        {
            timer += Time.deltaTime / 0.2f;
            float t = God.Ease(timer, true);
            Score.View.transform.localPosition = Vector3.Lerp(startPos, endPos, t);
            Score.View.transform.localScale    = Vector3.Lerp(startSize, endSize, t);
            Score.View.transform.Rotate(0, 0, 30);
            yield return(null);
        }
        God.GSM.UpdateText();
    }
Example #3
0
    public override IEnumerator Run()
    {
        Key.View.transform.SetParent(Player.View.transform);
        Key.View.gameObject.SetActive(true);
        float   timer     = 0;
        Vector3 startPos  = Key.View.transform.localPosition;
        Vector3 endPos    = new Vector3(0.25f, 0.25f, -0.1f);
        Vector3 startSize = Key.View.transform.localScale;
        Vector3 endSize   = new Vector3(0.5f, 0.5f, 1);

        while (timer < 1)
        {
            timer += Time.deltaTime / 0.2f;
            float t = God.Ease(timer, true);
            Key.View.transform.localPosition = Vector3.Lerp(startPos, endPos, t);
            Key.View.transform.localScale    = Vector3.Lerp(startSize, endSize, t);
            yield return(null);
        }
        Key.View.transform.localPosition = endPos;
        Key.View.transform.localScale    = endSize;
    }
Example #4
0
    public override IEnumerator Run()
    {
        Player.View.transform.SetParent(Door.View.transform);
        float   timer     = 0;
        Vector3 startPos  = Player.View.transform.localPosition;
        Vector3 endPos    = new Vector3(0, 0, -0.1f);
        Vector3 startSize = Player.View.transform.localScale;
        Vector3 endSize   = new Vector3(0, 0, 1);

        while (timer < 1)
        {
            timer += Time.deltaTime / 0.5f;
            float t = God.Ease(timer, true);
            Player.View.transform.localPosition = Vector3.Lerp(startPos, endPos, t);
            Player.View.transform.localScale    = Vector3.Lerp(startSize, endSize, t);
            Player.View.transform.Rotate(0, 0, 10);
            yield return(null);
        }
        yield return(new WaitForSeconds(0.2f));

        SceneManager.LoadScene("Game");
    }