private void collected() { PlatformGameController platformGameControllerObj = GameObject.Find("GameController").GetComponent <PlatformGameController>(); if (platformGameControllerObj) { platformGameControllerObj.win(); } Destroy(gameObject); }
private void collected() { CityGameController cityGameControllerObj = GameObject.Find("GameController").GetComponent <CityGameController>(); if (cityGameControllerObj) { //cityGameControllerObj.checkPoint(); } PlatformGameController platformGameControllerObj = GameObject.Find("GameController").GetComponent <PlatformGameController>(); if (platformGameControllerObj) { platformGameControllerObj.checkpoint(); } Destroy(gameObject); }
private void collected() { CityGameController cityGameControllerObj = GameObject.Find("GameController").GetComponent <CityGameController>(); if (cityGameControllerObj) { cityGameControllerObj.addScore(); } PlatformGameController platformGameControllerObj = GameObject.Find("GameController").GetComponent <PlatformGameController>(); if (platformGameControllerObj) { platformGameControllerObj.addScore(); } Destroy(gameObject); }