void Awake() { gerekliNesnelerComponent = GetComponent <gerekliNesneler> (); gameControlComponent = GetComponent <gameControl> (); playerStatusComponent = GetComponent <playerStatus> (); childrenWorkTimeComponent = GetComponent <childrenWorkTime> (); }
void Start() { gameSc = GameObject.Find("GameControl").GetComponent <gameControl>(); spawnSc = GameObject.Find("GameControl").GetComponent <spawn>(); playerSc = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); Audio = GetComponent <AudioSource>(); Audio.volume = PlayerPrefs.GetFloat("AudioVolume", 0.5f); }
// Use this for initialization void Start() { GameObject gameControllerObject = GameObject.FindWithTag("GameController"); gc = gameControllerObject.GetComponent <gameControl> (); ExitText.text = ""; ExitText.gameObject.SetActive(false); ExitGraph.gameObject.SetActive(false); }
// Use this for initialization void Start() { //animator = player.GetComponent<Animator> (); GameObject gameControllerObject = GameObject.FindWithTag("GameController"); gc = gameControllerObject.GetComponent <gameControl> (); player_object = player.GetComponent <PhysicalObject> (); }
private void Start() { playerTrans = player.GetComponent <Transform>(); playerOrigin = playerTrans.position; playerRigid = player.GetComponent <Rigidbody2D>(); mainCamera = GameObject.FindGameObjectWithTag("MainCamera"); cameraScript = mainCamera.GetComponent <gameControl>(); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
// Use this for initialization private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
void Awake() { if (Instance == null) { DontDestroyOnLoad(gameObject); Instance = this; } else { Destroy(gameObject); } }
private void Awake() { if (control == null) { DontDestroyOnLoad(gameObject); control = this; } else if (control != this) { Destroy(gameObject); } }
void Awake() { if (gamecontrol == null) { gamecontrol = this; DontDestroyOnLoad(gameObject); } else if (gamecontrol != this) { Destroy(this); } }
private void Awake() { if (control == null) { DontDestroyOnLoad(gameObject); //dont destroy that game object if control exist control = this; //this= this script } else if (control != this) { Destroy(gameObject); //destroy object if control doesnt exit and use old one (in this case teh health & money) } }
// Use this for initialization void Start() { control = GameObject.Find("GameControl").GetComponent <gameControl>(); myCollider = GetComponent <Collider2D>(); acceleration = new Vector3(0, 0, 0); velocity = new Vector3(0, 0, 0); gravity = new Vector3(0, -9.81f, 0); force = new Vector3(0, 0, 0); totalForce = new Vector3(0, 0, 0); drag = new Vector3(0, 0, 0); }
void Awake() { // 3 - if there's no gamecontrol, make this the game control if (control == null) { DontDestroyOnLoad(gameObject); control = this; // this means this script } else if (control != this) { Destroy(gameObject); // there can be only one } }
void Start() { GameObject gameControllerObject = GameObject.FindWithTag("GameController"); gc = gameControllerObject.GetComponent <gameControl> (); transform.position = new Vector2(CorrectPath[currentIndex].transform.position.x, CorrectPath[currentIndex].transform.position.y + y_offset); for (int index = 0; index < CorrectPath.Length; index++) { CorrectPath[index].SetActive(false); } }
// Use this for initialization void Start() { control = GameObject.Find("GameControl").GetComponent <gameControl>(); arm = GameObject.Find("arm").transform; armScript = GameObject.Find("arm").GetComponent <MoveWithMouse>(); myCollider = GetComponent <Collider2D>(); acceleration = new Vector3(0, 0, 0); velocity = new Vector3(0, 0, 0); gravity = new Vector3(0, -9.81f, 0); //force = new Vector3(0,0,0); totalForce = new Vector3(0, 0, 0); drag = new Vector3(0, 0, 0); areal = 1 * 1 * Mathf.PI; mass = 360f; }
void Start() { mousePos = Input.mousePosition; sprite = GetComponent <SpriteRenderer>(); coll = GetComponent <Collider2D>(); gameSc = GameObject.Find("GameControl").GetComponent <gameControl>(); sprite.material.color = new Color(0, 0, 1, 1); CatchSounds.Add(catchSound1); CatchSounds.Add(catchSound2); CatchSounds.Add(catchSound3); for (int i = 0; i < 3; i++) { CatchSounds[i].volume = PlayerPrefs.GetFloat("AudioVolume", 0.5f); } }
private void Start() { canSpeedUp(true); sound = this.gameObject.GetComponent <AudioSource>(); deneme1t = deneme1.GetComponent <Transform>(); deneme2t = deneme2.GetComponent <Transform>(); deneme1v = deneme1t.position; deneme2v = deneme2t.position; playerRigid = this.gameObject.GetComponent <Rigidbody2D>(); playerTrans = this.gameObject.GetComponent <Transform>(); playerOrigin = playerTrans.position; mainCamera = GameObject.FindGameObjectWithTag("MainCamera"); cameraScript = mainCamera.GetComponent <gameControl>(); colorChangeScale = cameraScript.difficulty * 0.1f; }
void Awake() { //prevents doubles if (control == null) { DontDestroyOnLoad(gameObject); control = this; } else { Destroy(gameObject); } //loads options automatically LoadOptions(); if (merchs == null) { merchs = new List <MerchantData>(); } if (collectibles == null) { collectibles = new List <Collectibles>(); } if (enemies == null) { enemies = new List <EnemyList>(); } if (questGivers == null) { questGivers = new List <QuestGivers>(); } //delete later basicAmmo = 5; rapidAmmo = 20; shotgunAmmo = 50; money = 100; }
private void Start() { gameControl = GameObject.FindGameObjectWithTag("gameControl"); control = gameControl.GetComponent <gameControl>(); }
// Use this for initialization void Start() { GameObject go = GameObject.FindWithTag("GameController"); Button b; if (go != null) { gc = go.GetComponent <gameControl>(); } GameObject g; // Only look for other OBJECTS in this prefab. // I don't care about any controls OUTSIDE this prefab... foreach (Transform t1 in this.GetComponentInChildren <Transform>()) { g = t1.gameObject; switch (g.name) { case "btnGameOver": btnGameOver = g; // Specifically add "Hook" to the button to restart game method // which in-turn, call the reload level option. b = g.GetComponent <Button>(); if (b != null) { b.onClick.AddListener(restartGame); } // but disable the button for now as default so it is not shown break; case "btnSelectLevel": btnSelectLevel = g; // Specifically add "Hook" to the button to restart game method // which in-turn, call the reload level option. b = g.GetComponent <Button>(); if (b != null) { b.onClick.AddListener(selectLevel); } break; case "btnSpawnZombie": btnSpawnZombie = g; // Specifically add "Hook" to the button to restart game method // which in-turn, call the reload level option. b = g.GetComponent <Button>(); if (b != null) { b.onClick.AddListener(spawnZombie); } break; case "btnSpawnFastZombie": btnSpawnFastZombie = g; b = g.GetComponent <Button>(); if (b != null) { b.onClick.AddListener(spawnFastZombie); } break; case "btnSpawnTankZombie": btnSpawnTankZombie = g; // Specifically add "Hook" to the button to restart game method // which in-turn, call the reload level option. b = g.GetComponent <Button>(); if (b != null) { b.onClick.AddListener(spawnTankZombie); } break; case "txtScore": txtScore = (Text)g.GetComponent <Text>(); txtScore.text = ""; break; case "txtZombieMana": txtZombieMana = (Text)g.GetComponent <Text>(); txtZombieMana.text = ""; break; } } }
void Start() { cam_x = transform.position.x; cam_y = transform.position.y; cam_z = transform.position.z; game_cont = GameObject.Find ("GameControl").GetComponent<gameControl>(); }
void Awake() { GameControl = GetComponent <gameControl> (); }
// Use this for initialization void Start() { GameObject go = GameObject.FindWithTag ("GameController"); Button b; if( go != null ) gc = go.GetComponent<gameControl>(); GameObject g; // Only look for other OBJECTS in this prefab. // I don't care about any controls OUTSIDE this prefab... foreach( Transform t1 in this.GetComponentInChildren<Transform>()) { g = t1.gameObject; switch(g.name) { case "btnGameOver": btnGameOver = g; // Specifically add "Hook" to the button to restart game method // which in-turn, call the reload level option. b = g.GetComponent<Button>(); if( b != null ) b.onClick.AddListener(restartGame); // but disable the button for now as default so it is not shown break; case "btnSelectLevel": btnSelectLevel = g; // Specifically add "Hook" to the button to restart game method // which in-turn, call the reload level option. b = g.GetComponent<Button>(); if( b != null ) b.onClick.AddListener(selectLevel); break; case "btnSpawnZombie": btnSpawnZombie = g; // Specifically add "Hook" to the button to restart game method // which in-turn, call the reload level option. b = g.GetComponent<Button>(); if( b != null ) b.onClick.AddListener(spawnZombie); break; case "btnSpawnFastZombie": btnSpawnFastZombie = g; b = g.GetComponent<Button>(); if( b != null ) b.onClick.AddListener(spawnFastZombie); break; case "btnSpawnTankZombie": btnSpawnTankZombie = g; // Specifically add "Hook" to the button to restart game method // which in-turn, call the reload level option. b = g.GetComponent<Button>(); if( b != null ) b.onClick.AddListener(spawnTankZombie); break; case "txtScore": txtScore = (Text)g.GetComponent<Text>(); txtScore.text = ""; break; case "txtZombieMana": txtZombieMana = (Text)g.GetComponent<Text>(); txtZombieMana.text = ""; break; } } }
void Awake() { customer = this.gameObject; GameObject controlObjectRef = GameObject.Find("GameController"); myControlRef = controlObjectRef.GetComponent<gameControl>(); }