Esempio n. 1
0
    void stateWakeup()
    {
        switch (state)
        {
        case 0:

            break;

        case 1:
            // Destroy(case0Canvas);
            case1Canvas = Instantiate(case1CanvasPrefab);
            var b = Instantiate(buttonPrefab, new Vector3(0f, -1.25f, 0), Quaternion.identity);
            b.init(this, "OK?", 3.0f);
            b.r             = 0.27f;
            b.text.fontSize = (int)(b.text.fontSize * 0.6f);

            break;

        case 2:    //軽い箱
            curFlont = Instantiate(flontPrefab, new Vector2(camera.position.x + 1.2f, camera.position.y), Quaternion.identity);
            curFlont.cargo.weightType = 0;
            curFlont.cargo.slowable   = false;
            break;

        case 3:    //切り替え
            var c = blind.color;
            c.a         = 0;
            blind.color = c;

            time      = 0;
            blindFlag = false;
            break;

        case 4:    //重い箱

            break;

        case 5:    //切り替え
            var c5 = blind.color;
            c5.a        = 0;
            blind.color = c5;

            time      = 0;
            blindFlag = false;
            break;

        case 6:    //実験群
            break;
        }
    }
Esempio n. 2
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.L))
        {
            Application.LoadLevel("Scenes/main");
        }
        if (Input.GetKey(KeyCode.T) && Input.GetKey(KeyCode.A) && Input.GetKeyDown(KeyCode.S))
        {
            changeState(5);
        }
        switch (state)
        {
        case 3:
        case 5:

            var c = blind.color;
            c.a         = blindCurve.Evaluate(time / timeLimit);
            blind.color = c;

            if (time > timeLimit * 0.7f && !blindFlag)
            {
                if (curFlont != null)
                {
                    Destroy(curFlont.gameObject);
                }
                blindFlag = true;
                curFlont  = Instantiate(flontPrefab, new Vector2(camera.position.x + 1.2f, camera.position.y), Quaternion.identity);
                curFlont.cargo.weightType = (state - 1) / 2;
                if (group == Group.A)
                {
                    curFlont.cargo.slowable = false;
                }
                if (group == Group.B && (state - 1) / 2 == 2)
                {
                    curFlont.cargo.slowable = true;
                }
                curFlont.cursol.section = (state - 1) / 2;
            }
            if (time > timeLimit)
            {
                changeState(state + 1);
            }

            time += Time.deltaTime;

            break;
        }
    }