Game Development Reference
In-Depth Information
function GetHitPoint (hp : int) : int {
return (maxHp - hp);
}
C#:
// a common Unity monobehaviour event handler:
void Start() { ...function body here... }
// a private function:
void TakeDamage(int amount) {
energy -= amount;
}
// a public function with a return type.
// the parameter type is "Transform", and the return type is "int"
public int GetHitPoint (int hp) {
return (maxHp - hp);
}
Reference
The methods menioned earlier can be referenced from the following websites:
http://answers.unity3d.com/questions/12911/what-are-the-syntax-
differences-in-c-and-javascrip.html
http://www.unifycommunity.com/wiki/index.php?title=Csharp_
Differences_from_JS
http://unity3d.com/support/documentation/ScriptReference/index.
Writing_Scripts_in_Csharp.html
http://www.unifycommunity.com/wiki/index.php?title=Csharp_
Differences_from_JS .
 
Search WWH ::




Custom Search