[size=14px]想學Unity3D的小伙伴,福利來臨!
如果您因為零基礎而煩惱,那么,這套CSDN學院的視頻絕對是你的首選!
我就不廢話了,直接上連接各大家!
【19】Unity開發視頻教程之C#語言入門:
http://edu.csdn.net/course/detail/1982

【27】unity開發視頻教程之c#基礎:
http://edu.csdn.net/course/detail/2050

【18】nity開發教程之unity引擎基礎:
http://edu.csdn.net/course/detail/2121

[/size]
uj5u.com熱心網友回復:
Unity開發教程之C#語言入門課時1:下載并安裝MonoDevelop
http://edu.csdn.net/course/detail/1982


uj5u.com熱心網友回復:
課時2:c#編譯程序20:04第一個在MonoDevelop里面創建的程式:"Hello World!"
using System;
namespace Lesson02
{
class MainClass
{
public static void Main (string[] args)
{
Console.WriteLine ("Hello World!");
}
}
}

uj5u.com熱心網友回復:
Unity開發教程之C#語言入門Lesson02源代碼:using System;
namespace Lesson02
{
class MainClass
{
//C#中的主函式就是Main函式
//C#中{}中間部門叫代碼塊,{}會跟在一些函式后面
/// <summary>
/// The entry point of the program, where the program control starts and ends.
/// </summary>
/// <param name="args">The command-line arguments.</param>
public static void Main (string[] args)
{
//在控制臺上列印一些內容
Console.WriteLine ("Hello World!");
//C#注釋型別
//1、//單行注釋
//2、/* */ 多行注釋
// 檔案注釋 在主函式前 敲///
/// <summary>
/// The entry point of the program, where the program control starts and ends.
/// </summary>
/// <param name="args">The command-line arguments.</param>
}
}
}
uj5u.com熱心網友回復:
Unity開發教程之C#語言入門Lesson03源代碼:
Unity開發教程之C#語言入門Lesson04源代碼:
源代碼
using System;
namespace Lesson04
{
class MainClass
{
public static void Main (string[] args)
{
//宣告變數 型別+變數名;
int level;
//對變數進行初始化
level=6;
//使用變數
Console.WriteLine (level);
//宣告一個float型別的變數exp
float exp;
//初始化變數
exp=0.6f;
Console.WriteLine (exp);
//宣告一個string型別的變數str
string str;
//初始化變數
str = "你好老王";
Console.WriteLine (str);
//宣告并初始化整型常量a
const int a = 9;
Console.WriteLine (a);
//圓周率用常量表示
const float pi=3.1415926f;
Console.WriteLine (pi);
}
}
}
uj5u.com熱心網友回復:
Unity開發教程之C#語言入門Lesson04源代碼:
using System;
namespace Lesson04
{
class MainClass
{
public static void Main (string[] args)
{
//宣告變數 型別+變數名;
int level;
//對變數進行初始化
level=6;
//使用變數
Console.WriteLine (level);
//宣告一個float型別的變數exp
float exp;
//初始化變數
exp=0.6f;
Console.WriteLine (exp);
//宣告一個string型別的變數str
string str;
//初始化變數
str = "你好老王";
Console.WriteLine (str);
//宣告并初始化整型常量a
const int a = 9;
Console.WriteLine (a);
//圓周率用常量表示
const float pi=3.1415926f;
Console.WriteLine (pi);
}
}
}
uj5u.com熱心網友回復:
Unity開發教程之C#語言入門Lesson05源代碼:using System;
namespace Lesson05
{
class MainClass
{
public static void Main (string[] args)
{
//整數型別賦值
sbyte a = 120;
Console.WriteLine (a);
byte b = 5;
Console.WriteLine (b);
//短整型
short c = 4;
Console.WriteLine (c);
ushort d = 5;
Console.WriteLine (d);
//整形
int e = 4;
Console.WriteLine (e);
uint f = 6;
Console.WriteLine (f);
//長整形
long g = 6;
Console.WriteLine (g);
ulong h = 77;
Console.WriteLine (h);
//小數型別
float z=4.56f;
Console.WriteLine (z);
double x = 4.56;
Console.WriteLine (x);
//字串型別 不能進行運算
string name="老王";
Console.WriteLine (name);
//特殊型別 布爾型別 邏輯運算:只有true或false兩個值!
bool u=true; //真
u = false; //假
Console.WriteLine (u);
}
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/129211.html
標籤:Unity3D
