示例#1
0
 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;
         }
     }
 }
示例#2
0
    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;
        }
    }