void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Debug.Log("Duplicated MusicAnalyzer gameObject was removed."); Destroy(this.gameObject); } }
// Use this for initialization void Start() { analyzer = AudioAnalyzer2.instance; material = GetComponent <MeshRenderer>().material; material.color = basicsColor; }