public override void OnStart() { base.OnStart(); targetObj = OriginTask.GetTargetObj(); nextTimeTrigger = Time.timeSinceLevelLoad + nextTimeTrigger; }
public override void OnStart() { base.OnStart(); targetObj = OriginTask.GetTargetObj(); inSight = true; nextTimeTrigger = Time.timeSinceLevelLoad + 10000f; }
public override void OnUpdate() { base.OnUpdate(); if (OriginTask.GetTargetObj() == null) { TriggerTransition(); } }
public override void OnUpdate() { if (OriginTask.GetTargetObj() == null || Vector3.Distance(transform.position, OriginTask.GetTargetObj().transform.position) > AbandonDistance) { //Debug.Log ("Abandoned to Neutral"); TriggerTransition(); } }
public override void OnHit(HitInfo hb) { base.OnHit(hb); if (OriginTask.GetTargetObj() == null) { return; } float hp = OriginTask.GetTargetObj().GetComponent <Attackable>().Health; float maxHP = OriginTask.GetTargetObj().GetComponent <Attackable>().MaxHealth; float healthPercentage = hp / maxHP; if (healthPercentage > HealthPercentageAbove && healthPercentage < HealthPercentageBelow) { TriggerTransition(); } }
public override void OnUpdate() { if (OriginTask == null) { return; } if (OriginTask.GetTargetObj() == null) { return; } Vector3 tgt = OriginTask.GetTargetObj().transform.position; float d = Vector2.Distance(new Vector2(MasterAI.transform.position.x, MasterAI.transform.position.z), new Vector2(tgt.x, tgt.z)); if (d < DistanceLessThen && d > DistanceGreaterThen) { TriggerTransition(); } }