public void Init(CarEnnemyData Data) { this.CurrentCarType = Data.CurrentCarType; this.Damage = Data.Damage; this.SpeedMin = Data.SpeedMin; this.SpeedMax = Data.SpeedMax; this.CurrentSpeedZ = Random.Range(this.SpeedMin, this.SpeedMax); }
/* * public void Init(EntityData Data) * { * var newData = (EnnemyData)Data; * this.CarData = newData.CarData; * CarData.CurrentSpeedZ = (CarData.SpeedMin + CarData.SpeedMax) / 2f; * } */ public void Init(EnnemyConfig Data, int IndexStruct) { this.CarData = Data.ListEnnemyData[IndexStruct].CarData; CarData.CurrentSpeedZ = (CarData.SpeedMin + CarData.SpeedMax) / 2f; }