//only to be called by server. void AddPowerSpawnLocally(bool live, PowerSpawn requested){ requested.owner = Network.player; allTimedSpawns.Enqueue(requested, requested.spawnTime); if(live){ networkView.RPC ("AddPowerSpawnLocally", RPCMode.Others, true, (int)requested.type, requested.position, requested.spawnTime, requested.GetLocalID()); } }
void AddPowerSpawnLocally(bool live, int typeIndex, Vector3 position, float time, int localID, NetworkMessageInfo info){ PowerSpawn requested = new PowerSpawn(localID); requested.type = (PowerType)typeIndex; requested.position = position; requested.spawnTime = TimeManager.instance.time + time; requested.owner = info.sender; //print ("Time is set to " + requested.spawnTime) allTimedSpawns.Enqueue(requested, requested.spawnTime); if(live && Network.isServer){ networkView.RPC ("AddPowerSpawnLocally", RPCMode.Others, true, (int)requested.type, requested.position, requested.spawnTime, requested.GetLocalID()); } }