// Start is called before the first frame update private void Start() { myAudioSource = GetComponent <AudioSource>(); SpawnPoint.SetActive(true); //EnemySpawn.SetActive(true); Enemy.SetActive(true); health = 1; // Bhasfe GameSceneManager = GameObject.FindObjectOfType <sceneManager>(); }
// Use this for initialization void Start() { Network = NetworkManager.Instance; Scene = sceneManager.Instance; IPField = GameObject.Find("IPField").GetComponent <InputField>(); PORTField = GameObject.Find("PortField").GetComponent <InputField>(); Popup = GameObject.Find("POPUP"); Popup.SetActive(false); Network.setStart(this); }
void Awake() { if (Instance != this) { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); Scene = sceneManager.Instance; }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
// Start is called before the first frame update void Start() { mytf = GetComponent <Transform>(); myrb = GetComponent <Rigidbody>(); GameObject tempObj = GameObject.Find("Player"); tf = tempObj.GetComponent <Transform>(); tempObj = GameObject.Find("Main Camera"); scriptInstance = tempObj.GetComponent <sceneManager>(); scriptInstance.EventoDisparoRecibido += gotShot; }
void Start() { if (Instance != null) { Destroy(gameObject); } else { DontDestroyOnLoad(gameObject); Instance = this; } }
void OnTriggerEnter(Collider other) { // Check for the asteroid if (other.gameObject.tag == "enemy1") { // Create explosion on impact Instantiate(explosion, transform.position, transform.rotation); sceneManager scenem = oursceneManager.GetComponent <sceneManager>(); PlayerPrefs.SetInt("SCORE", scenem.GetScore()); StartCoroutine(GameOver("GameOver", 0.75f)); } }
// Use this for initialization void Start() { if (instance != null) { GameObject.Destroy(gameObject); } else { GameObject.DontDestroyOnLoad(gameObject); instance = this; } }
void Start() { // Makes sure that the GameManager this is attached to is always the same one, so we can use it to keep values through scenes. if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
//add buttons, set text for each upgrade and set to MAX when fully upgraded void Start() { upgradeManager = GameObject.FindGameObjectWithTag("UpgradeManager").GetComponent <upgradeManager>(); sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <sceneManager>(); scoreText.text = upgradeManager.getPlayerScore().ToString(); updateMaxBoostsButton(); updateGroundSpeedReductionButton(); updateLaunchForceButton(); updateEnemySpeedReductionButton(); updateTruckFrequencyButton(); updateBombEnemyFrequencyButton(); initializeMenuButtons(); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } currentScene = SceneManager.GetActiveScene().name; lastScene = currentScene; DontDestroyOnLoad(this.gameObject); }
// Use this for initialization void Start() { chattingFlag = false; channelFlag = false; chatBar = GameObject.Find("Chatting_Bar").GetComponent <ScrollRect>(); chatText = chatBar.GetComponentInChildren <TextMeshProUGUI>(); chatContent = chatBar.content.gameObject; renderCanvas = GameObject.Find("renderCanvas").GetComponent <Canvas>(); chatQueue = new Queue <TextMeshProUGUI>(); otherPlayer = new Dictionary <ulong, Player>(); chDropdown = GameObject.Find("Channel").GetComponent <Dropdown>(); chDropdown.onValueChanged.AddListener(delegate { dropDownFunction(chDropdown); }); cineCamera = GameObject.Find("cineCamera").GetComponent <Cinemachine.CinemachineVirtualCamera>(); defaultPosition = new Vector2(-164.0f, 1110.0f); otherPlayerColor = new Color(183, 165, 119, 255); Scene = sceneManager.Instance; Network = NetworkManager.Instance; Network.setChatMng(this); request_playerData(); }
// Start is called before the first frame update void Start() { sm = FindObjectOfType <sceneManager>(); int I = 0; lockedState = win; if (lockedState == true) { winBtn.SetActive(true); failBtn.SetActive(false); } else { failBtn.SetActive(true); winBtn.SetActive(false); } StartCoroutine(drainScore()); //wut is this for? while (I > igUi.Length) { igUi[I].SetActive(false); I++; } }
void OnTriggerEnter(Collider other) { // Check for the asteroid if (other.gameObject.tag == "enemy1") { // Create explosion on impact Instantiate(explosion, transform.position, transform.rotation); AudioSource.PlayClipAtPoint(e1death, transform.position); // Tell scene manager that we destroyed an enemy -> add score sceneManager scenem = oursceneManager.GetComponent <sceneManager>(); sceneManager.numEnemies--; sceneManager.numKilled++; scenem.AddScore(); Destroy(other.gameObject); // other.GetComponent("script name").variable etc //print (sceneManager.numEnemies); Destroy(gameObject); } }
void Awake() { DontDestroyOnLoad(gameObject); manager = this; }
void Start() { s = this; }
void Start() { sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <sceneManager>(); }
// Use this for initialization void Start() { call = this; }
// Use this for initialization void Start() { scene = GameObject.FindObjectOfType <sceneManager> (); audio = this.GetComponent <AudioSource> (); }
private void Start() { sceneManager = FindObjectOfType <sceneManager>(); }
// Start is called before the first frame update void Start() { manager = GetComponent <sceneManager>(); // rend.material.SetColor(Color.white); }