void Awake() { rb = GetComponent <Rigidbody>(); trs = transform; startingPosition = trs.position; projector = GetComponent <ProjectedPlayer>(); EndScreen.onRestartClicked += OnRestart; }
private void Awake() { rb = GetComponent <Rigidbody2D>(); projector = GetComponent <ProjectedPlayer>(); trs = transform; colliderBounds = GetComponent <CapsuleCollider2D>().bounds; colliderBounds.center = trs.InverseTransformPoint(colliderBounds.center); colliderBounds.size = trs.InverseTransformVector(colliderBounds.size); camOffset = cameraTransform.position - trs.position; EndScreen.onRestartClicked += OnRestart; }
private void Start() { projector = player.GetComponent <ProjectedPlayer>(); trs = transform; playerTrs = player.transform; }