示例#1
0
    void Update()
    {
        if (ws.GetKills() % 30 == 0 && ws.GetKills() != 0)
        {
            Destroy(obj);
        }

        if (DELAY <= 0)
        {
            if (GO_RIGHT)
            {
                trans.Translate(new Vector3(ws.GetLevel() * 0.05f, 0, 0));
            }
            else
            {
                trans.Translate(new Vector3(-ws.GetLevel() * 0.05f, 0, 0));
            }

            if ((trans.position.x >= boundaryRight) || (trans.position.x <= boundaryLeft))
            {
                GO_RIGHT = !GO_RIGHT;
                trans.Translate(new Vector3(0, -0.5f, 0));
            }
        }
        else
        {
            DELAY -= Time.deltaTime;
        }

        if (trans.localPosition.y < -8.5f)
        {
            Destroy(obj);
        }
    }
示例#2
0
 // Update is called once per frame
 void Update()
 {
     obj.GetComponent <TextMesh>().text   = "SCORE: " + ws.GetScore();
     level.GetComponent <TextMesh>().text = "LEVEL " + ws.GetLevel();
     if (ws.GetKills() != 0 && ws.GetKills() % 30 == 0)
     {
         ws.ResetKills();
         Invoke("AddPrompt", 1f);
     }
 }