예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            IPattern patten = new Pattern01(15, 10f, 1.5f, 180f, curve_Angle);
            patten.OnStart();
            CurPattern = patten;
        }

        if (Input.GetKeyDown(KeyCode.S))
        {
            IPattern patten = new Pattern02(6, 10f, 1.5f, 360f, curve_Angle02);
            patten.OnStart();
            CurPattern = patten;
        }

        if (Input.GetKeyDown(KeyCode.D))
        {
            IPattern patten = new Pattern03(300, 10f, 0.05f);
            patten.OnStart();
            CurPattern = patten;
        }

        if (Input.GetKeyDown(KeyCode.F))
        {
            IPattern patten = new Pattern04(15, 10f, 1.5f, 180f, curve_Angle);
            patten.OnStart();
            CurPattern = patten;
        }

        if (CurPattern != null)
        {
            //애니메이션이 실행중인가?
            if (CurPattern.IsTweening())
            {
                CurPattern.OnUpdate(Time.smoothDeltaTime);
                GameManager.GetInstance().CurrentPatternTotalBallNumber = CurPattern.GetTotalBallCount();
            }
            else
            {
                CurPattern.OnEnd();
                //GameManager.GetInstance().SetBallCnt();
            }
        }
    }
예제 #2
0
    public void SetPattern(int pattern)
    {
        if (pattern == 0)
        {
            IPattern patten = new Pattern01(15, 10f, 1.5f, 180f, curve_Angle);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart(11.5f);
        }

        if (pattern == 1)
        {
            IPattern patten = new Pattern02(6, 10f, 1.5f, 360f, curve_Angle02);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart(11.5f);
        }

        if (pattern == 2)
        {
            IPattern patten = new Pattern03(300, 10f, 0.05f);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart(300);
        }

        if (pattern == 3)
        {
            IPattern patten = new Pattern04(15, 10f, 1.5f, 180f, curve_Angle);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart(11.5f);
        }

        if (pattern == 4)
        {
            IPattern patten = new Pattern05(8, 10f, 1.5f, 270f, curve_Angle03);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart(11.5f);
        }

        if (pattern == 5)
        {
            IPattern patten = new Pattern06(10, 10f, 1.5f, 360f, 0.25f, curve_Angle);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart(10f + 10f * 0.25f);
        }

        if (pattern == 6)
        {
            IPattern patten = new Pattern07(1f, 1.5f, 25f, 0.25f, 15f, 8, curve_Angle04);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart((1f * 8f) + (2f * 0.25f));
        }

        if (pattern == 7)
        {
            IPattern patten = new Pattern08(3, 10f, 1.5f, 360f, 0.1f, 0.3f, curve_Angle);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart(11.5f);
        }

        if (pattern == 8)
        {
            IPattern patten = new Pattern08(8, 10f, 1.5f, 270f, 0.3f, 0.3f, curve_Angle);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart(11.5f);
        }

        if (pattern == 9)
        {
            IPattern patten = new Pattern09(20, 10f, 1.5f, 360, curve_Angle02);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart(11.5f);
        }
        if (pattern == 10)
        {
            IPattern patten = new Pattern10(10, 30f, 1.5f, 360);
            patten.OnStart();
            CurPattern = patten;
            GameManager.GetInstance().InitPatternStart(11.5f);
        }
    }