setSpawner() 공개 메소드

public setSpawner ( BarSpawner, barSpawner ) : void
barSpawner BarSpawner,
리턴 void
예제 #1
0
 void OnMouseOver()
 {
     if (!busy && !worldInfo.getMouseBusy() && Input.GetMouseButtonDown(0))
     {
         worldInfo.setMouseBusy();
         busy = true;
         BarItem spawnedItem = Instantiate(barItem);
         Vector3 worldpos    = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 0f));
         worldpos.z = 0f;
         spawnedItem.transform.position = worldpos;
         spawnedItem.setSpawner(this);
     }
 }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (!busy && Input.GetMouseButtonUp(0) && glassPresent)
        {
            pourTime = pourDelay;
            pouring  = true;
            animator.SetTrigger("tapON");
            busy = true;

            beerAudioSource.Play();
            Destroy(glass.gameObject);
        }

        pourTime -= Time.deltaTime;
        if (pourTime <= 0 && pouring)
        {
            animator.SetTrigger("tapOFF");
            glassPresent = false;
            pouring      = false;
            BarItem spawnedItem = Instantiate(barItem);
            spawnedItem.setSpawner(this);
        }
    }