setSpawner() public method

public setSpawner ( BarSpawner, barSpawner ) : void
barSpawner BarSpawner,
return void
 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);
     }
 }
Beispiel #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);
        }
    }