Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    //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);
             * }
             */
        }
    }
Esempio n. 3
0
 public void AddUnitToReactionManager(UnitReactions unit)
 {
     //Debug.Log(unit);
     units.Add(unit);
 }