// Start is called before the first frame update void Start() { barImage = transform.Find("bar").GetComponent <Image>(); barImage.fillAmount = 0.0f; fart = new Fart(); }
private void Fart() { float fartPower = fartMass; // create visuals GameObject fartObject = GameObjectFactory.GameObject(fartPrefab, fartLocation.position); Fart fart = fartObject.GetComponent <Fart>(); fart.TriggerFart(fartPower, lookDirection.Flip()); Destroy(fartObject, 3f); Game.Instance.fartMachine.Fart(_transform.position, fartPower, lookDirection.Flip()); }