private void HandleARUpdateVR(int clientId, Vector3 pos, Quaternion rot, int fireType) { GameObject gameObject; bool success = ARPlayers.TryGetValue(clientId, out gameObject); if (!success) { //NEW AR PLAYER (does not exist in known players dictionary) gameObject = Instantiate(spawnables[1], new Vector3(0.0f, 0.0f, 0.0f), new Quaternion(0.0f, 0.0f, 0.0f, 0.0f)); ARPlayers.Add(clientId, gameObject); } gameObject.transform.position = pos; gameObject.transform.rotation = rot; Eyeball eyeball = gameObject.GetComponent <Eyeball>(); //Here, set whether the player is firing switch ((beamType)fireType) { case beamType.Damage: eyeball.Damage(); break; case beamType.Heal: eyeball.Heal(); break; case beamType.None: eyeball.Beamless(); break; } }
ImmutableArray <Eyeball> LoadEyeballs(Ibasa.IO.BinaryReader reader, int count) { long offset = reader.BaseStream.Position; Eyeball[] eyeballs = new Eyeball[count]; for (int i = 0; i < count; ++i) { offset = reader.BaseStream.Position; reader.BaseStream.Position = offset; } return(new ImmutableArray <Eyeball>(eyeballs)); }
ImmutableArray<Eyeball> LoadEyeballs(Ibasa.IO.BinaryReader reader, int count) { long offset = reader.BaseStream.Position; Eyeball[] eyeballs = new Eyeball[count]; for (int i = 0; i < count; ++i) { offset = reader.BaseStream.Position; reader.BaseStream.Position = offset; } return new ImmutableArray<Eyeball>(eyeballs); }