Ejemplo n.º 1
0
        public override void SceneLoadRemoteDone(BoltConnection connection, IProtocolToken token)
        {
            var entity = BoltNetwork.Instantiate(BoltPrefabs.MoveAndShootPlayer, SpawnPointsManager.GetSpawnPosition(),
                                                 Quaternion.identity);

            entity.AssignControl(connection);
        }
Ejemplo n.º 2
0
        public override void SceneLoadLocalDone(string scene, IProtocolToken token)
        {
            var entity = BoltNetwork.Instantiate(BoltPrefabs.MoveAndShootPlayer, SpawnPointsManager.GetSpawnPosition(),
                                                 Quaternion.identity);

            entity.TakeControl();
        }
Ejemplo n.º 3
0
        private void Awake()
        {
            if (_instance != null)
            {
                Destroy(_instance.gameObject);
            }

            _instance = this;
        }
Ejemplo n.º 4
0
        private IEnumerator RespawnRoutine()
        {
            if (entity.IsOwner && state.Health <= 0)
            {
                yield return(new WaitForSeconds(3));

                SetState(SpawnPointsManager.GetSpawnPosition(), Vector3.zero, 0);
                state.Health = 100;

                BoltLog.Warn("Player respawn: {0}", entity.NetworkId);
            }
        }