예제 #1
0
파일: UI.cs 프로젝트: Frostdragn/Potato_Run
    // Update is called once per frame
    void Update()
    {
        GameObject bombCheck    = GameObject.Find("potato_man_1");
        PotatoMan  potatoScript = bombCheck.GetComponent <PotatoMan>();

        if (potatoScript.bombCollected == false)
        {
            gameObject.SetActive(false);
        }
        else
        {
            gameObject.SetActive(true);
        }
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        GameObject spawnDeath   = GameObject.Find("potato_man_1");
        PotatoMan  potatoScript = spawnDeath.GetComponent <PotatoMan>();

        if (potatoScript.spawnObstacles == false)
        {
            transform.position = _startPos;
            speed = 0;
        }
        else
        {
            speed = -7;
        }

        transform.Translate(speed * Time.deltaTime, 0, 0);

        if (transform.position.x <= -10.5)
        {
            transform.position = _startPos;
        }
    }