private void OnTriggerExit(Collider other) { if (other != _currentCollider) return; Ground = null; _currentCollider = null; }
private void OnTriggerStay(Collider other) { if (other == _currentCollider) return; foreach (GroundProperty ground in Floor.Instance.Grounds) if (other.gameObject.GetComponent<Renderer>().material.mainTexture == ground.Texture && Ground == null) { Ground = ground; Debug.Log(Ground.Texture.ToString()); _currentCollider = other; gameObject.GetComponent<MovesoundConnector>().SetFootstepSounds(Ground.ArrayAudioClip); return; } }