void Start() // on start.. { GameObject player = GameObject.Find("Player"); timeSlow = player.GetComponent <timeSlow>(); // set timeSlow to be the timeSlow component on the player playerScript = player.GetComponent <playerScript>(); pausePanel.SetActive(false); // disable the pause screen exitPanel.SetActive(false); // disable the Exit menu settingsPanel.SetActive(false); // disable the settings menu restartPanel.SetActive(false); // disable the restart panel menu }
void Start() { player = GameObject.Find("Player"); playerScript = player.GetComponent <playerScript>(); solidBoxCol = gameObject.GetComponent <BoxCollider2D>(); rb = gameObject.GetComponent <Rigidbody2D>(); timeSlowScript = player.GetComponent <timeSlow>(); head = player.transform.Find("Head").gameObject; jumpLayer = playerScript.jumpLayer; playerColliderObject = transform.Find("playerCollider").gameObject; playerBoxCol = playerColliderObject.GetComponent <BoxCollider2D>(); spriteRenderer = gameObject.GetComponent <SpriteRenderer>(); SetType(); CheckForParent(); playerBoxCol.enabled = true; unavailableTimer = 1f; }