// Start is called before the first frame update void Start() { // sets up scripts autoScrollCameraScript = FindObjectOfType <AutoScrollCameraScript>(); cameraShakeScript = FindObjectOfType <CameraShakeScript>(); cameraZoomScript = FindObjectOfType <CameraZoomScript>(); lockedCameraScript = FindObjectOfType <LockedCameraScript>(); cameraSmoothingScript = FindObjectOfType <CameraSmoothingScript>(); dataManagerScript = FindObjectOfType <DataManagerScript>(); //stores the player's Rigidbody2D rb = GetComponent <Rigidbody2D>(); }
// Use this for initialization void Start () { dm = GameObject.FindGameObjectWithTag("DataManager").GetComponent<DataManagerScript>(); switch (texttype) { case Texttype.COINS: value = dm.loadPlayerMoney(); GetComponent<Text>().text = "Coins: " + value; break; case Texttype.HIGHSCORE: value = dm.getEndlessHighscore(); GetComponent<Text>().text = "Highscore: " + value; break; default: Debug.Log("Texttype not yet implemented"); break; } }
void Awake() { // sets up scripts autoScrollCameraScript = FindObjectOfType <AutoScrollCameraScript>(); cameraShakeScript = FindObjectOfType <CameraShakeScript>(); lockedCameraScript = FindObjectOfType <LockedCameraScript>(); cameraSmoothingScript = FindObjectOfType <CameraSmoothingScript>(); dataManagerScript = FindObjectOfType <DataManagerScript>(); // stores camera's transform if (transform == null) { transform = GetComponent(typeof(Transform)) as Transform; } }
private void ReleaseScript() { if (InputManagerScript) { InputManagerScript.Release(); } if (DataManagerScript != null) { DataManagerScript.Release(); } if (StageManagerScript != null) { StageManagerScript.Release(); } if (HudManagerScript != null) { HudManagerScript.Release(); } }
void Awake() { if (dataManager == null) { DontDestroyOnLoad (gameObject); dataManager = this; } else if (dataManager != this){ Destroy (gameObject); } }