How is that possible? Line: 35 Unknown Identifier “scriptCircles”
// Player Script
// Inspector Variables
var tagName : String; //allow the designer to setup a tag in the inspector
var rayDistance : float = 0; //length of the ray for out raycast
var score : int = 0; //score for our player
var gameTime : float = 5; //amount of time the game will last
var loadWaitTime : float = 3.0;
var numberOfPointsToWin : int = 5; //amount of points needed to win
// Private Variables
//
function Start()
{
InvokeRepeating("CountDown", 1.0, 1.0); // Repeat the countdown every second
}
// Update is called every frame
function Update ()
{
// use the mouse button to select onGO in the scene
if (Input.GetMouseButtonDown(0))
{
audio.Play();
var hit : RaycastHit;
var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition); // get mouse position
if (Physics.Raycast (ray, hit, rayDistance))
{
if (hit.transform.tag == tagName)
{
//var position = Vector3 (Random.Range(-6,6),Random.Range(-4,4),0); // new random position for the gameObject
//hit.transform.position = position; // move the gameObject to a random position
var enemyScript = hit.transform.GetComponent(scriptEnemy);
enemyScript.numberOfClicks -= 1;
var circlesScript = hit.transform.GetComponent(scriptCircles);
circlesScript.numberOfClicks -= 1;
if(enemyScript.numberOfClicks == 0)
{
score += enemyScript.enemyPoints;
}
//if(circlesScript.numberOfClicks == 0)
//{
// score += circlesScript.enemyPoints;
//}
}
}
}
}
function CountDown()
{
if (--gameTime == 0) // subtract from gametime
{
CancelInvoke("CountDown"); // cancell the countdown
//yield WaitForSeconds (loadWaitTime);
if (score >= numberOfPointsToWin)
{
Application.LoadLevel ("sceneScreenWin");
}
else
{
Application.LoadLevel ("sceneScreenLose");
}
}
}
//
function OnGUI()
{
GUI.Label (Rect(10,10,100,20), "Score: " + score);
GUI.Label (Rect(10,25,100,35), "Time: " + gameTime);
}