protected override void Update() { base.Update(); if (isBeingTouched) { if (score.currentlyActive) { ScoreManager scoreManager = GameObject.FindWithTag("scoreManager").GetComponent <ScoreManager>(); scoreManager.AddScore(score.scoreValue, true); score.DeactivateEquipment(); score.currentlyActive = false; } } }
protected override void Update() { base.Update(); if (isBeingTouched) { float controllerAngle = usingObject.transform.rotation.eulerAngles.z; if (prevControllerZ != 0) { float diff = controllerAngle - prevControllerZ; rotator.Rotate(new Vector3(diff, 0f, 0f)); if (score.currentlyActive) { ScoreManager scoreManager = GameObject.FindWithTag("scoreManager").GetComponent <ScoreManager>(); scoreManager.AddScore(score.scoreValue, true); score.DeactivateEquipment(); score.currentlyActive = false; } } prevControllerZ = controllerAngle; } }