public void Configure(int _team, AControlDevice _control_device, Color _color) { id = num_players++; team = _team; control_device = _control_device; color = _color; AssertConfigured(); DontDestroyOnLoad(gameObject); }
public void CreatePlayer(AControlDevice new_player_device) { GameObject new_player = Instantiate(player_prefab, Vector3.zero, Quaternion.identity, null); PlayerIdentity identity = new_player.GetComponent <PlayerIdentity>(); identity.Configure(0, new_player_device, Color.blue); GameObject new_ship = Instantiate( ship_prefab, Vector3.zero, Quaternion.identity, new_player.transform ); ShipCore core = new_ship.GetComponent <ShipCore>(); core.BoardPlayer(identity); // enabled systems. // TODO: put this somewhere else. core.Mount(Item.ion_drive); }
// Player must return their control device for someone else to take it. // Bank does NOT keep track of devices that have been given away! public void ReturnControlDevice(AControlDevice device) { taken_devices.Remove(device); available_devices.Add(device); }