public float bleedBonus = 0f; //how rapidly we bleed from this part private void Start() { //might not want these in bodyparts because they're going to get called in every single body part in the game! myBrain = GetComponent <Brain>(); myBody = GetComponent <BodyPartController>(); myCombatSkills = GetComponent <CombatSkills>(); anim = GetComponent <UnitAnimController>(); ai = GetComponent <UnitReactions>(); stateMachine = GetComponent <UnitStateMachine>(); if (dollPart != null) { dollPart.Initialize(PackagePartInfo()); } MyWeapon(); //run this to make sure we hve unarmed weapon //Debug.Log("assigning parts for " + this); //Debug.Log("my armortype is " + armorType); }
//this is called by a unit when it is attacked (UnitReactions.ReactToAttackAgainstSelf()) public void AlertEveryoneInRange(Transform attacker, Transform victim) { Vector3 location = attacker.position; //Debug.Log("Alerting others in range"); for (int i = 0; i < units.Count; i++) { UnitReactions unit = units[i]; /*skip if unit is dead * if (unit.isDead || unit == null) * { * units.RemoveAt(i); * continue; * } * * if (Vector3.Distance(unit.transform.position, location) < unit.reactionRadius) * { * unit.ReactToViolence(attacker, victim); * } */ } }
public void AddUnitToReactionManager(UnitReactions unit) { //Debug.Log(unit); units.Add(unit); }