I would really appreciate it if someone can assist me with this.
My playerScript is in javascript. When player scores, I would like to pass the score to a C# script...that can then update my high scores C# scene(script).
Here is a java script snippet.
I'm also going to attach the complete javascript below the snippet...in case someone can help me to change the javascript to c#.
Thanks in advance.
if(Physics.Raycast(ray, hit, rayDistance))
{
if(hit.transform.tag == objectTag1)
{
var enemyScript = hit.transform.GetComponent(scriptEnemy);
// Reduce the number each click
enemyScript.numberOfClicks -= 1;
// condition to check that the object is at zero before adding the points to the score
if(enemyScript.numberOfClicks <= 0)
{
//Add points to our overall score
score += enemyScript.enemyPoints;
// HERE is where i want to add one point to the score keeping C# script (scriptSceneManager)
// scriptSceneManager.AddScore(1);
↧