public EnemyModel(EnemyStruct @struct) { if (@struct.Speed <= 0 || @struct.Damage <= 0) { throw new ArgumentException("Неверные значения в структуре игрока"); } _enemyStruct = @struct; }
public void FromSave() { EnemyStruct = new EnemyStruct() { Damage = _model.Damage, Speed = _model.Speed }; Position = _enemyTransform.position; Rotation = _enemyTransform.rotation; }
public EnemySaveData(EnemyModel model, Transform transform) { _enemyTransform = transform; _model = model; EnemyStruct = new EnemyStruct() { Damage = _model.Damage, Speed = _model.Speed }; Position = transform.position; Rotation = transform.rotation; }
public EnemySaveData(EnemySaveData data) { Position = data.Position; Rotation = data.Rotation; EnemyStruct = data.EnemyStruct; }