/// <summary> /// Fire proyectile /// </summary> public void Fire() { ProyectileController pc = PoolManager.poolManager.GetPoolInstance(proyectilePrefab).GetComponent <ProyectileController>(); pc.transform.position = transform.position; pc.Initialize(selfFaction, oppositeFaction, proyectileSpeed, Tools.Vector3ToDir4Int(transform.forward), proyectileDamage, proyectileForce); SoundManager.GetInstance().Play(fireClip); // Generate fire signal if (generateEnabled) { SignalManager.GetInstance().WriteSignal(generateId, isActivated ? 1 : 0); } }
public bool CheckStatus() { return(Tools.IntComparator(SignalManager.GetInstance().ReadSignal(activateId)) > 0); }
/// <summary> /// Send a 1 signal to the outSignalId and play a sound. /// Also destroys its GameObject. /// </summary> public void Collect() { SoundManager.GetInstance().Play(grabClip); SignalManager.GetInstance().WriteSignal(outSignalId, 1); Destroy(gameObject); }