Hello World

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
(Created Hello World example for UnityScript, C# and Boo.)
 
m (Text replace - "</boo>" to "</syntaxhighlight>")
 
(5 intermediate revisions by one user not shown)
Line 9: Line 9:
 
==== UnityScript - HelloWorld.js ====
 
==== UnityScript - HelloWorld.js ====
  
<javascript>print("Hello World");</javascript>
+
<syntaxhighlight lang="javascript">print("Hello World");</syntaxhighlight>
  
 
==== C# - CSHelloWorld.cs ====
 
==== C# - CSHelloWorld.cs ====
  
<csharp>using UnityEngine;
+
<syntaxhighlight lang="csharp">using UnityEngine;
  
 
class CSHelloWorld : MonoBehaviour
 
class CSHelloWorld : MonoBehaviour
Line 21: Line 21:
 
print("Hello World");
 
print("Hello World");
 
}
 
}
}</csharp>
+
}</syntaxhighlight>
  
 
==== Boo - BooHelloWorld.boo ====
 
==== Boo - BooHelloWorld.boo ====
<boo>import UnityEngine
+
<syntaxhighlight lang="boo">import UnityEngine
  
 
class BooHelloWorld (MonoBehaviour):  
 
class BooHelloWorld (MonoBehaviour):  
 
def Start ():
 
def Start ():
print("Hello World")</boo>
+
print("Hello World")</syntaxhighlight>

Latest revision as of 20:57, 10 January 2012

Contents

[edit] Description

Example of traditional "Hello World" with Unity3D in three support languages.

The output is sent to the console window in Unity3D Editor.

[edit] Code

[edit] UnityScript - HelloWorld.js

print("Hello World");

[edit] C# - CSHelloWorld.cs

using UnityEngine;
 
class CSHelloWorld : MonoBehaviour
{
	void Start()
	{
		print("Hello World");
	}
}

[edit] Boo - BooHelloWorld.boo

import UnityEngine
 
class BooHelloWorld (MonoBehaviour): 
	def Start ():
		print("Hello World")
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox