Fixed major AI issues

Tweaked AI parameters
Improved AI behaviour to avoid getting stuck near walls
Changed boost conditions
This commit is contained in:
Minz committed 2020-01-31 05:23:35 +01:00
1 parent 238187c30a
commit dd3816ce0b
4 files changed
+244 -30

No files matched your search

+7 -1
View File
@@ -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()