コード例 #1
0
    void Update()
    {
        rb.velocity = new Vector2(rb.velocity.x, run * speed);
        SelectAnimation();

        // 立ち止まる
        if (this.transform.position.y > 0)
        {
            run   = 0f;
            state = "STOP";
            octavian.playerArrive = true;

            if (one)
            {
                startMove.MoveAnimation(a);
                one = false;
            }

            if (catch1)
            {
                state = "HELPME";
                if (two)
                {
                    serif          = FindObjectOfType <Serif_PlayStart2>();
                    serif.NextText = true;
                    two            = false;
                }
                run   = -1f;
                speed = 2f;
            }
        }
        if (this.transform.position.y < -7)
        {
            Destroy(this.gameObject);
        }

        if (startMove.point == 3)
        {
            state = "TALK";
        }
        if (startMove.point >= 4 && startMove.point <= 7)
        {
            state = "STOP";
        }
        if (startMove.point == 8)
        {
            state = "TALK";
        }
    }
コード例 #2
0
    void Update()
    {
        SelectAnimation();
        serif = FindObjectOfType <Serif_PlayStart2>();

        // プレイヤーから指示
        if (playerArrive)
        {
            state = "SPIN";
            if (one)
            {
                Instantiate(serifObj);
                one = false;
            }
        }

        if (startMove.point == 2)
        {
            state        = "TALK";
            playerArrive = false;
        }
        if (startMove.point == 3)
        {
            state = "STAND";
        }
        if (startMove.point == 4)
        {
            state = "TALK";
        }
        // よくきいた!
        if (startMove.point == 5)
        {
            state = "RIBON";
            if (two)
            {
                Invoke("AnimationEND", 1f);
                serif.clickOK = false;
            }
            if (animationEnd)
            {
                state          = "TALK";
                serif.NextText = true;
                serif.clickOK  = true;
                animationEnd   = false;
            }
        }
        if (startMove.point == 7)
        {
            state = "TALK";
        }
        if (startMove.point == 8)
        {
            state = "STAND";
        }
        if (startMove.point == 9)
        {
            state = "ANGRY";
        }
        if (startMove.point == 10)
        {
            state = "SEKI";
        }
        if (startMove.point == 11)
        {
            state = "STAND";
        }
        if (startMove.point == 12)
        {
            state = "TALK";
        }
        // Playerを追い出す
        if (startMove.point == 13)
        {
            state         = "YUBI";
            serif.clickOK = false;

            if (!two)
            {
                Invoke("AnimationEND", 1f);
            }
            if (animationEnd)
            {
                if (three)
                {
                    Instantiate(catchPlayerObj);
                    three = false;
                }
                animationEnd = false;
            }
        }
        if (startMove.point == 14)
        {
            state = "STAND";
            if (catchOK)
            {
                serif.NextText = true;
                serif.clickOK  = true;
            }
        }
        if (startMove.point == 15)
        {
            state = "STAND";
        }
        if (startMove.point == 16)
        {
            state = "WALK";
        }
        if (startMove.point == 17)
        {
            rb.velocity = new Vector2(rb.velocity.x, run * speed);
            state       = "WALK";
            run         = 1f;
            if (this.transform.position.y > 3.1)
            {
                run   = 0f;
                state = "STOP";
            }
        }
        if (startMove.point == 18)
        {
            state = "STOP";
        }
        if (startMove.point == 19)
        {
            state = "SPIN";
        }
        if (startMove.point == 20)
        {
            state = "TALK";
        }
        if (startMove.point == 21 || startMove.point == 22)
        {
            state = "STAND";
        }
        if (startMove.point == 23)
        {
            state = "TALK";
        }
        if (startMove.point == 24)
        {
            state       = "TALK2";
            rb.velocity = new Vector2(run * speed, rb.velocity.y);
            run         = -1;
            if (this.transform.position.x < -2)
            {
                run = 0;
            }
        }
    }