Fixed major AI issues
Tweaked AI parameters Improved AI behaviour to avoid getting stuck near walls Changed boost conditions
This commit is contained in:
@@ -5,16 +5,18 @@ using UnityEngine;
|
||||
public class GlowOnHover : MonoBehaviour
|
||||
{
|
||||
public float hoverIntensity, defaultIntensity, lerpSpeed = 1;
|
||||
public AudioClip hoverSound;
|
||||
public Renderer target;
|
||||
private float fromIntensity, toIntensity, currentIntensity, t;
|
||||
private Material material;
|
||||
private Color defaultColor;
|
||||
|
||||
private AudioSource audioSource;
|
||||
private void Start()
|
||||
{
|
||||
this.material = this.target.material;
|
||||
this.defaultColor = material.GetColor("_EmissionColor");
|
||||
this.toIntensity = defaultIntensity;
|
||||
this.audioSource = GetComponent<AudioSource>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -40,6 +42,10 @@ public class GlowOnHover : MonoBehaviour
|
||||
private void OnMouseEnter()
|
||||
{
|
||||
this.lerpEmission(this.currentIntensity, this.hoverIntensity);
|
||||
if (this.hoverSound && this.audioSource)
|
||||
{
|
||||
this.audioSource.PlayOneShot(this.hoverSound);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMouseExit()
|
||||
|
||||
Reference in New Issue
Block a user