void Start() { thePlayer = FindObjectOfType <Moveman>(); if (thePlayer.startpoint == pointname) { thePlayer.transform.position = transform.position; theCamera = FindObjectOfType <Cameraattach>(); theCamera.transform.position = new Vector3(transform.position.x, transform.position.y, theCamera.transform.position.z); } }
void Start() { if (instanceRef == null) { instanceRef = this; DontDestroyOnLoad(gameObject); } else { DestroyImmediate(gameObject); } }