課程
/Unity 3D
/Unity3D快速入門
我剛學unity要做一簡單的游戲,但是C#一點都不會,應該先學哪里呢?C#有什么快速入門的方法嗎?
2017-02-28
源自:Unity3D快速入門 2-2
正在回答
從最基礎的開始就行,寫腳本不需要太高深的東西
謝謝!會一點點的學的
我個人覺得先下定決心!一定要學會。然后了解C#的基本知識,比如結構、語法等(買書、網上看都行)。然后了解基本知識以后嘗試去開源的unity小工程里看別人的script,一行一行慢慢看懂,然后試著全刪了按照自己掌握的算法和語法寫出來,持之以恒就能進步。
比如開始先試著能輸出一個字符串(不是unity里的用法,只是C#編譯),
using System;namespace HelloWorldApplication{????class HelloWorld????{????????static void Main(string[] args)????????{????????????/* ?C# 程序學習加油哦 */????????????Console.WriteLine("Hello World!");????????????Console.ReadKey();????????}????}}
試著能自己寫出來,而不是背出來,那就能輸出一串字了對嗎?
然后試試進一步難的,比如計算個矩形的面積:
using System;namespace RectangleApplication{ ? ?class Rectangle ? ?{ ? ? ? ?// 成員變量 ? ? ? ?double length; ? ? ? ?double width; ? ? ? ?public void Acceptdetails() ? ? ? ?{ ? ? ? ? ? ?length = 4.5; ? ? ? ? ? ? ? ?width = 3.5; ? ? ? ?} ? ? ? ?public double GetArea() ? ? ? ?{ ? ? ? ? ? ?return length * width; ? ? ? ?} ? ? ? ?public void Display() ? ? ? ?{ ? ? ? ? ? ?Console.WriteLine("Length: {0}", length); ? ? ? ? ? ?Console.WriteLine("Width: {0}", width); ? ? ? ? ? ?Console.WriteLine("Area: {0}", GetArea()); ? ? ? ?} ? ?} ? ? ? ?class ExecuteRectangle ? ?{ ? ? ? ?static void Main(string[] args) ? ? ? ?{ ? ? ? ? ? ?Rectangle r = new Rectangle(); ? ? ? ? ? ?r.Acceptdetails(); ? ? ? ? ? ?r.Display(); ? ? ? ? ? ?Console.ReadLine(); ? ? ? ?} ? ?}}
循序漸進就好。
其實我也初學者,哈哈,與君共勉~
舉報
本課程為Unity 3D入門教程,快速學會用Unity開發游戲
3 回答想學unity游戲開發,除了unity引擎還需要什么編輯器嗎?比如寫c#的!!
1 回答unity
1 回答Unity
2 回答我的unity打不開了
1 回答C語言自學
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-03-29
從最基礎的開始就行,寫腳本不需要太高深的東西
2017-03-01
謝謝!會一點點的學的
2017-03-01
我個人覺得先下定決心!一定要學會。然后了解C#的基本知識,比如結構、語法等(買書、網上看都行)。然后了解基本知識以后嘗試去開源的unity小工程里看別人的script,一行一行慢慢看懂,然后試著全刪了按照自己掌握的算法和語法寫出來,持之以恒就能進步。
比如開始先試著能輸出一個字符串(不是unity里的用法,只是C#編譯),
using System;
namespace HelloWorldApplication
{
????class HelloWorld
????{
????????static void Main(string[] args)
????????{
????????????/* ?C# 程序學習加油哦 */
????????????Console.WriteLine("Hello World!");
????????????Console.ReadKey();
????????}
????}
}
試著能自己寫出來,而不是背出來,那就能輸出一串字了對嗎?
然后試試進一步難的,比如計算個矩形的面積:
using System;namespace RectangleApplication{
? ?class Rectangle
? ?{
? ? ? ?// 成員變量
? ? ? ?double length;
? ? ? ?double width;
? ? ? ?public void Acceptdetails()
? ? ? ?{
? ? ? ? ? ?length = 4.5; ? ?
? ? ? ? ? ?width = 3.5;
? ? ? ?}
? ? ? ?public double GetArea()
? ? ? ?{
? ? ? ? ? ?return length * width;
? ? ? ?}
? ? ? ?public void Display()
? ? ? ?{
? ? ? ? ? ?Console.WriteLine("Length: {0}", length);
? ? ? ? ? ?Console.WriteLine("Width: {0}", width);
? ? ? ? ? ?Console.WriteLine("Area: {0}", GetArea());
? ? ? ?}
? ?}
? ?
? ?class ExecuteRectangle
? ?{
? ? ? ?static void Main(string[] args)
? ? ? ?{
? ? ? ? ? ?Rectangle r = new Rectangle();
? ? ? ? ? ?r.Acceptdetails();
? ? ? ? ? ?r.Display();
? ? ? ? ? ?Console.ReadLine();
? ? ? ?}
? ?}}
循序漸進就好。
其實我也初學者,哈哈,與君共勉~