// Start is called before the first frame update void Start() { // Find the main camera GameObject mainCamera = GameObject.Find("Main Camera"); playGUI = mainCamera.GetComponent <GUIscript>(); }
Vector3 cameraOldPosition = new Vector3(9.0f, 4.0f, -10.0f); // normal camera position // Start is called before the first frame update void Start() { // get editor objects editorBackground = (GameObject.Find("background")).GetComponent <changeBackground>(); editorAudio = (GameObject.Find("background")).GetComponent <AudioSource>(); editor = (GameObject.Find("background")).GetComponent <returnToMenu>(); audioSource = gameObject.GetComponent <AudioSource>(); // get camera object mainCamera = GameObject.Find("Main Camera"); // get background displayBackground = GameObject.Find("displaybackground"); // get play gui controller = mainCamera.GetComponent <gameMechanics>(); playGUI = mainCamera.GetComponent <GUIscript>(); GameObject currentObj; // add all panels to the panel list for (int i = 0; i < panelCount; i++) { currentObj = GameObject.Find("panel" + (i + 1)); panelList.Add(currentObj); } }
// Start is called before the first frame update private void Start() { // Add audio audioSource = gameObject.GetComponent <AudioSource>(); GameObject mainCamera = GameObject.Find("Main Camera"); playGUI = mainCamera.GetComponent <GUIscript>(); playObj = GameObject.Find("PlayModeObj"); }
// Start called on the first frame update private void Start() { oldPosition = new Vector3(0, 0, 0); oldPositionSprite = new Vector3(0, 0, 0); oldScale = new Vector3(1, 1, 1); // retrieve scripts movement = (transform.root.gameObject).GetComponent <playerMoveScript>(); // Load all sprites from the sprite sheet AsyncOperationHandle <Sprite[]> spriteHandle = Addressables.LoadAssetAsync <Sprite[]>("Assets/Graphics/Objects/sheet.png"); spriteHandle.Completed += LoadSpritesWhenReady; // Add audio audioSource = gameObject.GetComponent <AudioSource>(); // Load in the main camera that oversees variables GameObject mainCamera = GameObject.Find("Main Camera"); playGUI = mainCamera.GetComponent <GUIscript>(); mechanics = mainCamera.GetComponent <gameMechanics>(); }