void Start() { statsScr = GetComponent <scr_DataSet>(); health = statsScr.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Health); healthMax = _Stats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Maximum_Health); moveSpeed = _Stats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Movement_Speed); rotationSpeed = _Stats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Rotation_speed); health.Value = healthMax.Value; }
private void Start() { scrStats = GetComponent <scr_DataSet>(); health = scrStats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Health); healthMax = _Stats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Maximum_Health); visibilityRange = _Stats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Visibility_Range); rotationSpeed = _Stats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Rotation_speed); movementSpeed = _Stats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Movement_Speed); fireRate = _Stats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Fire_rate); damage = _Stats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Damage); attackRange = _Stats.Attributes.Find(x => x.Name == scr_Attributes.Attribute.Range); health.Value = healthMax.Value; player = GameObject.FindGameObjectWithTag(scr_Tags.Player); path = new List <Vector3>(); myRigidbody = GetComponent <Rigidbody>(); if (player == null) { throw new Exception("No player found!"); } }