Help me with these questions

Hi

  • I’m using c# language. I made two different scripts. what i want is if i made playerscore class. How to call it into other script ? give me example please.
  • Can i use two different language in one game ?
  • Now I make a game with one level. Is the best way to make second and third level is to copy all files and then edit on it. or there is better way ?
  1. Each script is a class, so the code uses them just like any other class in OOP. That is, get a reference to the other class or object, and then use dot notation to call its public functions. You can reference classes in Unity by linking to them in the Inspector, or by using a command like GetComponent()

  2. Yes but it’s not recommended.

  3. “Files” can refer to lots of different things. In general no you don’t need to copy all the files you just need to copy the scene itself (the scene references the various files), but it depends on exactly what files you are talking about.

Incidentally, if you already know how to program and want to learn the Unity-specific stuff quickly you might want my book Unity in Action.