Beispiel #1
0
        public JoinFlow(Peer peer)
        {
            _peer = peer;

            ServerOutput.Header($"Starting joinflow for {peer}");

            PeerController.Create(peer);
        }
Beispiel #2
0
        public void Save()
        {
            PeerController controller = PeerController.Get(_id);

            if (controller.Colonist != null)
            {
                Position = controller.Colonist.transform.position;
            }
        }
Beispiel #3
0
        private static void CreateColonist(Peer peer, Profile profile)
        {
            PeerController controller = PeerController.Get(peer.ProfileID);

            GameObject prefab       = ObjectReferenceManifest.GetObject <GameObject>("Colonist");
            GameObject instantiated = Network.Instantiate(prefab, profile.Position, Quaternion.identity);

            instantiated.name = $"Server {peer}";
            instantiated.transform.position = profile.Position;

            controller.AssignColonist(instantiated.GetComponent <Colonist>());
        }