void OnTriggerEnter(Collider other)
{
Debug.Log("Collision");
BatonController baton = other.gameObject.GetComponent<BatonController>();
bool o = (_lastHitObject == null ? (true) : (_lastHitObject == other.gameObject ? false : true));
if (baton && hittable)
{
Debug.Log("hit");
_timer = Time.time;
hittable = false;
Vector3 v = this.transform.position + _collider.center;
if (baton.direction.y < 0)
{
dir = -1;
Debug.Log("above");
}
else
{
dir = 1;
Debug.Log("below");
}
amp += hitAmplitude * baton.direction.magnitude * dir * batonFactor;
Debug.Log(amp);
//AUDIO
audio.volume = 1f * baton.direction.magnitude * batonFactor;
audio.pitch = Mathf.Pow(2, (note + transpose) / 12.0f);
audio.Play();
//PARTICLES
if (particles)
{
particles.StartParticles();
}
//HEAD COROUTINE
head.StartCoroutine("InflateHead", baton.direction.magnitude);
}
}