void OnTriggerEnter2D(Collider2D collider) { ColorHuman human = collider.GetComponent <ColorHuman> (); ColorBoy boy = collider.GetComponent <ColorBoy> (); ColorGirl girl = collider.GetComponent <ColorGirl> (); if (boy != null) { StartCoroutine(ColorGirl.copy_girl.waitAndRun()); } if (girl != null) { SceneManager.LoadScene("Level1"); } if (human != null) { human.destroyHuman(); } }
void Awake() { copy_girl = this; pianoSource = gameObject.AddComponent <AudioSource> (); pianoSource.clip = pianoIntroSound; }