// Add score and reset targets if needed public void AlertHit() { // If this is a drop target holder if (bDrop) { // Increase the number of target dropped iTargetsDropped++; // If all the targets have been dropped if (iTargetsDropped == iTargets) { // If the targets are to be reset as soon as all target are dropped if (bSimpleReset) { // Iterate through all drop targets and reset them to their original positions for (int i = 0; i < transform.childCount; i++) { transform.GetChild(i).GetComponent <DropTarget> ().ResetTarget(); } // Reset the number of targets dropped iTargetsDropped = 0; // Add score to the score system for hitting all the targets sys.AddScore(iScoreForCompletion); } } } }
void OnTriggerEnter(Collider target) { if (target.gameObject.tag == "BALL") { RepelObject(target.gameObject); ColObjects.Add(target.gameObject); sys.AddScore(iScoreForHit); } }
public IEnumerator Spin(bool diff) { bSpinning = true; force.relativeTorque = new Vector3(((diff) ? 5.0f : -5.0f), 0.0f, 0.0f); sys.AddScore(iScoreForHit); yield return(new WaitForSeconds(fSpinTime)); force.relativeTorque = new Vector3(0.0f, 0.0f, 0.0f); bSpinning = false; StartCoroutine(Stop()); }
void OnTriggerEnter(Collider col) { StartCoroutine(control.Flash(0.5f)); sys.AddScore(iScoreForHit); }