예제 #1
0
 void RPC_DropEnergyPack()
 {
     hasEnergyPack = false;
     energyPack.transform.SetParent(null);
     energyPack.WasDropped();
     energyPack = null;
 }
예제 #2
0
 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));
     }
 }
예제 #3
0
 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;
         }
     }
 }
예제 #4
0
    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();
    }
예제 #5
0
 public void SetEnergySource(EnergyPack source)
 {
     energySource = source;
 }