private void Awake() { if (Instance != null) { Debug.LogError("Only one MapCreation Script can exist at a time.", gameObject); } Instance = this; }
// Start is called before the first frame update void Start() { playerHealth = GameObject.Find("Player").GetComponent <PlayerHealth>(); playerTf = GameObject.Find("Player").GetComponent <Transform>(); playerRb = GameObject.Find("Player").GetComponent <Rigidbody>(); weaponSelectionScript = GameObject.Find("Player").GetComponent <WeaponSelectionScript>(); mapCreationScript = GameObject.Find("MapInstantiator").GetComponent <MapCreationScript>(); mapCreationScript.enabled = false; Time.timeScale = 0; gs = GameState.AtTitle; playerRb.constraints = RigidbodyConstraints.FreezeAll; }