Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        startEventTime++;

        if (startEventTime < 60)
        {
            // 移動
            direction = new Vector3(1 * MIN_SPEED, 0, 0);
        }
        if (startEventTime >= 60 && startEventTime < 240)
        {
            // 移動
            direction = new Vector3(0, 0, 0);
        }
        if (startEventTime > 240)
        {
            // 移動
            direction = new Vector3(1 * MAX_SPEED, 0, 0);
        }

        if (startEventTime >= 360)
        {
            if (EndGameUfo == 0)
            {
                if (EndGame.GetEndTimeGame())
                {
                    endEventTime++;
                }
                if (endEventTime > 240)
                {
                    // 移動
                    direction = new Vector3(1 * MAX_SPEED, 0, 0);
                }
                else
                {
                    transform.position = new Vector3(goal + MIN_SPEED, 0, 0);
                }
            }
            else
            {
                if (EndGame.GetEndTimeGame())
                {
                    endEventTime++;
                }

                if (endEventTime > 240)
                {
                    Destroy(this);
                }
                else
                {
                    transform.position = new Vector3(goal + MIN_SPEED, 0, 0);
                }
            }
        }
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        // 始まり時のプレイヤーのイベント 無理やり
        startEventTime++;

        if (startEventTime > 260)
        {
            move.enabled   = true;
            camera.enabled = false;
        }
        else
        {
            // 回転
            gameObject.transform.Rotate(new Vector3(0, 1800, 0) * Time.deltaTime);
        }

        if (startEventTime < 220)
        {
            position.x        += 0.04f;
            transform.position = position;
            if (position.x > 0)
            {
                position = new Vector3(0, 0, 0);
            }
        }

        // 終わり時のプレイヤーのイベント

        if (EndGame.GetEndTimeGame())
        {
            endEventTime++;
            move.enabled = false;


            if (endEventTime < 180)
            {
                position           = transform.position;
                transform.position = Vector3.MoveTowards(transform.position, target.transform.position, 4 * Time.deltaTime);
            }
            if (endEventTime == 180)
            {
                targetPos = transform.position;
            }
            if (endEventTime > 180)
            {
                transform.position = targetPos;
            }
            if (endEventTime > 300)
            {
                position.x++;
                transform.position = position;
            }
        }
    }
Esempio n. 3
0
    // Update is called once per frame
    void Update()
    {
        // 時間ごとの出現
        time++;

        if (time > createTime)
        {
            time     = 0;
            isCreate = true;
        }

        if (isCreate && StartGame.GetStartGame() && !EndGame.GetEndTimeGame())
        {
            CreatingCrow();
            isCreate = false;
        }
    }