void PartSpawned( SimpleNetworkedMonoBehavior part ) { //part.getSprite().SetFrame( blockType ); //part.set_f32( "weight", Block::getWeight( block ) ); GameObject partGO = part.gameObject; partsToAdd.Add( partGO ); partGO.GetComponent<Part_Info>().OwnerID = gOID; //b.set_u16( "playerID", playerID ); partGO.GetComponent<Part_Info>().ShipID = -1; // don't push on ship part.GetComponent<Part_Info>().ShipID = 0; part.GetComponent<Part_Info>().PlacedTime = Time.time; Debug.Log("part spawned"); }
// Callback only happens on the participant that calls instantiate, so we use RPC to set up bullet velocity. void BulletSpawned( SimpleNetworkedMonoBehavior bullet ) { bullet.GetComponent<Bullet_Velocity>().RPC("setV", shootDir*bulletSpeed); bullet.GetComponent<Bullet_Hit>().RPC("setShooterNetworkedId", NetworkedId); }