Beispiel #1
0
    protected override void OnPinchBegin()
    {
        rayHover.PinchBegin();
        rayHover.SetFreeze(true);

        player.Expand();
        player.GetComponent <Billboard>().enabled  = false;
        base.hrt.GetComponent <Collider>().enabled = false;
        player.GetComponent <Collider>().enabled   = true;
    }
Beispiel #2
0
 void Update()
 {
     if (Scanner != null && target == null)
     {
         target = Scanner.Detect(transform);
     }
     else
     {
         if (Scanner == null)
         {
             Debug.LogError("scanner is null");
         }
     }
     if (target != null)
     {
         var playerHP = target.GetComponent <Health>().CurrentHealth;
         if (playerHP <= 0)
         {
             CurrentState = AIstates.Idle;
             target       = null;
         }
     }
     if ((CurrentState != AIstates.Chase && CurrentState != AIstates.Attack) && target != null)
     {
         CurrentState = AIstates.Chase;
     }
     rb.velocity = Vector3.zero;
     Switches();
 }