예제 #1
0
        private IEnumerator SwitchBeerTapBarrel(PickUp barrel)
        {
            progressBar.Show();

            while (switchingProgress <= switchTime && isHolding)
            {
                switchingProgress += Time.deltaTime;

                progressBar.UpdateProgress(switchingProgress / switchTime);

                if (switchingProgress > switchTime)
                {
                    beerTap.Refill();

                    BeerBarrel beerBarrel = barrel as BeerBarrel;
                    beerBarrel.Release();

                    Destroy(barrel.gameObject);

                    ResetRefilling();

                    break;
                }

                yield return(null);
            }
        }
예제 #2
0
 private void Update()
 {
     if (beerBarrel == null)
     {
         beerBarrel = Instantiate(beerBarrelPrefab);
         beerBarrel.transform.position = this.transform.position;
         beerBarrelSpawn?.Invoke(beerBarrel);
     }
 }