Exemple #1
0
    public override void OnStart()
    {
        base.OnStart();
        targetObj = OriginTask.GetTargetObj();

        nextTimeTrigger = Time.timeSinceLevelLoad + nextTimeTrigger;
    }
Exemple #2
0
 public override void OnStart()
 {
     base.OnStart();
     targetObj       = OriginTask.GetTargetObj();
     inSight         = true;
     nextTimeTrigger = Time.timeSinceLevelLoad + 10000f;
 }
Exemple #3
0
 public override void OnUpdate()
 {
     base.OnUpdate();
     if (OriginTask.GetTargetObj() == null)
     {
         TriggerTransition();
     }
 }
Exemple #4
0
 public override void OnUpdate()
 {
     if (OriginTask.GetTargetObj() == null || Vector3.Distance(transform.position, OriginTask.GetTargetObj().transform.position) > AbandonDistance)
     {
         //Debug.Log ("Abandoned to Neutral");
         TriggerTransition();
     }
 }
Exemple #5
0
    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();
        }
    }
Exemple #6
0
    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();
        }
    }