Exemplo n.º 1
0
 public PlayerInizializator(PersonData playerData, Transform startPointTransform, string playerName)
 {
     _playerName    = playerName;
     _gameObject    = Resources.Load <GameObject>("Prefabs/Player");
     _struct        = playerData.PlayerStruct;
     _startPosition = startPointTransform.position;
     _startRotation = Quaternion.identity;
     Initialize();
 }
Exemplo n.º 2
0
        public PlayerModel(PlayerStruct @struct)
        {
            if (@struct.Speed <= 0 || @struct.LifeCount <= 0)
            {
                throw new ArgumentException("Неверные значения в структуре игрока");
            }

            _playerStruct = @struct;
        }
Exemplo n.º 3
0
 public void FromSave()
 {
     PlayerStruct = new PlayerStruct()
     {
         LifeCount = _model.LifeCount,
         Speed     = _model.Speed
     };
     Position = _playerTransform.position;
     Rotation = _playerTransform.rotation;
 }
Exemplo n.º 4
0
 public PlayerSaveData(string name, PlayerModel model, Transform transform)
 {
     UserName         = name;
     _playerTransform = transform;
     _model           = model;
     PlayerStruct     = new PlayerStruct()
     {
         LifeCount = _model.LifeCount,
         Speed     = _model.Speed
     };
     Position = transform.position;
     Rotation = transform.rotation;
 }
Exemplo n.º 5
0
 public PlayerSaveData(PlayerSaveData data)
 {
     Position     = data.Position;
     Rotation     = data.Rotation;
     PlayerStruct = data.PlayerStruct;
 }