public void DetectHuman(GameObject human) { SurvivorBehaviour surv = human.GetComponent <SurvivorBehaviour>(); if (surv != null) { human.GetComponent <SurvivorBehaviour>().ReceiveContact(this.gameObject); } if (goodness > 50) { if (human.GetComponent <Human>().isWounded()) { //Comprobamos si el jugador tiene menos del 100% de vida setState(AIStates.Heal); } else { setState(AIStates.Give); } } else { if (goodness < 30) { setState(AIStates.Attack); print(name + " attacking " + actualTarget.name); } else { setState(AIStates.Steal); } } }
// Use this for initialization void Start() { survivor = GetComponentInParent <SurvivorBehaviour>(); }