void RPC_DropEnergyPack() { hasEnergyPack = false; energyPack.transform.SetParent(null); energyPack.WasDropped(); energyPack = null; }
public void PickUp(GameObject go) { if (packs.Count < maxInventorySize) { EnergyPack pack = go.GetComponent <EnergyPack>(); pack.PickedUp(); packs.Enqueue(pack); bottleImages.Enqueue(Instantiate(bottleImagePrefab, BottlesUIParent.transform)); } }
public void RemoveEnergyPack(EnergyPack aEnergyPack) { for (int i = 0; i < energyPackCells.Count; i++) { if (energyPackCells[i] == aEnergyPack) { occupiedCells[aEnergyPack.cell.row, aEnergyPack.cell.column] = false; energyPackCells.RemoveAt(i); energyPackCurrentCount--; return; } } }
public void RPC_PickupEnergyPack(int packID) { if (hasEnergyPack) { return; } hasEnergyPack = true; energyPack = PhotonView.Find(packID).GetComponent <EnergyPack>(); energyPack.rBody.isKinematic = true; energyPack.pickupCollider.enabled = false; energyPack.transform.SetParent(energyPackHolder); energyPack.transform.SetPositionAndRotation(energyPackHolder.position, energyPackHolder.rotation); GetComponent <PlayerDisbalance>().ResetDisbalance(); }
public void SetEnergySource(EnergyPack source) { energySource = source; }