private void Awake() { playerAnimator = GetComponent <Animator>(); playerRigidBody = GetComponent <Rigidbody2D>(); playerSpriteRenderer = GetComponent <SpriteRenderer>(); carrotGrid = carrotGridObject.GetComponent <CarrotGrid>(); currentInputSR = currentInputObject.GetComponent <SpriteRenderer>(); mobileInputs = mobileInputsObject.GetComponent <MobileInputs>(); }
private void Awake() { if (MobileInputs.i != null && MobileInputs.i != this) { Destroy(this); } else { i = this; // DontDestroyOnLoad(gameObject); } }