public void AddtoList(GameObject picked, float timed) { PickUpSpawn ps = new PickUpSpawn(); ps.TargetPickup = picked; ps.PickupTime = timed; toSpawnList.Add(ps); }
public void AddtoList(GameObject picked, GameObject target) { for (int i = 0; i < PickupTF.childCount; i++) { if (PickupTF.GetChild(i).gameObject == picked) { GetComponent<NetworkView>().RPC("HidePickUp", RPCMode.Others, i); if (picked.GetComponent<PickUpElement>().PT == PickUpType.Energy) { target.GetComponent<PlayerControl>().MaxEnergy(); GameObject.FindGameObjectWithTag("NetworkController").GetComponent<NetworkController>().mNetworkview.RPC("MaxEnergy", target.GetComponent<PlayerControl>().mNetworkPlayer); } else { target.GetComponent<PlayerControl>().MaxHealth(); GameObject.FindGameObjectWithTag("NetworkController").GetComponent<NetworkController>().mNetworkview.RPC("MaxHealth", target.GetComponent<PlayerControl>().mNetworkPlayer); } } } PickUpSpawn ps = new PickUpSpawn(); ps.TargetPickup = picked; ps.PickupTime = Time.time; toSpawnList.Add(ps); }
public void AddtoList(GameObject picked, GameObject target) { for (int i = 0; i < PickupTF.childCount; i++) { if (PickupTF.GetChild(i).gameObject == picked) { GetComponent <NetworkView>().RPC("HidePickUp", RPCMode.Others, i); if (picked.GetComponent <PickUpElement>().PT == PickUpType.Energy) { target.GetComponent <PlayerControl>().MaxEnergy(); GameObject.FindGameObjectWithTag("NetworkController").GetComponent <NetworkController>().mNetworkview.RPC("MaxEnergy", target.GetComponent <PlayerControl>().mNetworkPlayer); } else { target.GetComponent <PlayerControl>().MaxHealth(); GameObject.FindGameObjectWithTag("NetworkController").GetComponent <NetworkController>().mNetworkview.RPC("MaxHealth", target.GetComponent <PlayerControl>().mNetworkPlayer); } } } PickUpSpawn ps = new PickUpSpawn(); ps.TargetPickup = picked; ps.PickupTime = Time.time; toSpawnList.Add(ps); }
void Awake() { pickUpSpawn = enemy.GetComponent <PickUpSpawn> (); }