void Start() { path = SingletonPath.Instance; if (isBlueCar) { targetPosition = path.getBluePoint(isPathSwitched); } else { targetPosition = path.getRedPoint(isPathSwitched); } }
private void Awake() { if (Instance == null) { Instance = this; //DontDestroyOnLoad(gameObject); } else { //Sahne değişiminde oluşacak olan kopya nesneyi yok eder. Destroy(gameObject); } }