Exemplo n.º 1
0
 public void ensureStatus(alertStatus newStatus)
 {
     if (curState != newStatus)
     {
         changeStatus(newStatus);
     }
 }
Exemplo n.º 2
0
 public void playCalm()
 {
     if (curState != alertStatus.calm)
     {
         audio.clip = audioCalm;
         audio.Play();
         curState = alertStatus.calm;
     }
 }
Exemplo n.º 3
0
 public void playSpotted()
 {
     if (curState != alertStatus.spotted)
     {
         audio.clip = audioSpotted;
         audio.Play();
         curState = alertStatus.spotted;
     }
 }
Exemplo n.º 4
0
 public void playAlarm()
 {
     if (curState != alertStatus.alert)
     {
         audio.clip = audioAlarm;
         audio.Play();
         curState = alertStatus.alert;
     }
 }
Exemplo n.º 5
0
 public void playAlarm()
 {
     if (curState != alertStatus.alert)
     {
         audio.clip = audioAlarm;
         audio.Play();
         curState = alertStatus.alert;
     }
 }
Exemplo n.º 6
0
 public void playSpotted()
 {
     if (curState != alertStatus.spotted)
     {
         audio.clip = audioSpotted;
         audio.Play();
         curState = alertStatus.spotted;
     }
 }
Exemplo n.º 7
0
 public void playCalm()
 {
     if (curState != alertStatus.calm)
     {
         audio.clip = audioCalm;
         audio.Play();
         curState = alertStatus.calm;
     }
 }
Exemplo n.º 8
0
    public void changeStatus(alertStatus newStatus)
    {
        curState = newStatus;
        //Debug.Log("new state: " + newStatus);
        if (curState == alertStatus.calm)
        {
            audio.playCalm();
            //canAttack = true;
            if (isStationary == true)
            {
                Mtr.setTarget(patrolRoute[0].position);
            }
        }
        else if (newStatus == alertStatus.spotted)
        {
            audio.playSpotted();
            //spotted();
        }
        else if (newStatus == alertStatus.inspect)
        {
            //inspect();
        }
        else if (newStatus == alertStatus.alert)
        {
            if (type == charType.villager)
            {
                //Debug.Log("go to safe zone");
                Mtr.setTarget(SafeZoneWP.getP());
            }

            if (Threat == player)
            {
                Hostile    = true;
                Vis.Layers = HostileMask;
                GetComponentInChildren <SpriteRenderer>().color = new Color(1.0f, 0.5f, 0.5f);
            }
            audio.playAlarm();
            //alert();
        }
        else if (newStatus == alertStatus.flee)
        {
            Mtr.setTarget(SafeZoneWP.getP());
        }
    }
Exemplo n.º 9
0
 // Use this for initialization
 void Awake()
 {
     audio = this.gameObject.GetComponent<AudioSource>();
     audio.volume = 0.1f;
     curState = alertStatus.calm;
 }
Exemplo n.º 10
0
 // Use this for initialization
 void Awake()
 {
     audio        = this.gameObject.GetComponent <AudioSource>();
     audio.volume = 0.1f;
     curState     = alertStatus.calm;
 }