Unity3D开发一些初级问题

1.Convert unity javascript (unityscript) to C#

   http://files.m2h.nl//js_to_c.php

2.Unity3D实用工具汇总 

1. Free Shader editor 免费shaser编辑器 http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Beta-3.0-released-%28vertex-lighting-support%29  
2. Commercial Shader Editor 商业shader编辑器 http://forum.unity3d.com/threads/56593-ShaderFusion-%28node-based-shader-editor%29-released!.?highlight=shaderfusion  
3. Volumetric Cloud engine 体积云生成器 http://www.jocyf.com/utilsEnglih.html 
  4. Volumetric cloud generator (not animated) 体积云生成器 http://forum.unity3d.com/threads/56878-ParticlClouds-Package-v2-%28Volumetric-Clouds!!%29 
 5. Road and path generator 道路生成工具 http://sixtimesnothing.com/road-path-tool/ 
 6. River generator 河流生成工具 http://sixtimesnothing.com/river-tool/ 
 7. Terrain bump mapping! 凹凸映射 http://sixtimesnothing.wordpress.com/2010/10/10/bump-mapping-for-built-in-unity-terrain/  视频教程: http://www.youtube.com/watch?v=Pne0y...eature=related 
 8. Object Buoyancy 物体浮力 http://forum.unity3d.com/threads/31671-floating-a-object-on-water/page2?highlight=buoyancy  
9. Biped Editor  http://www.gamengines.com/article-1511.html 
 10. Quickly animate everything http://itween.pixelplacement.com/index.php Video tutorial and project files: http://dkoontz.wordpress.com/itween-visual-editor/  
11. Unity Steer - Behavior AI 行为AI http://www.arges-systems.com/articles/35/unitysteer-steering-components-for-unity 
12. Path finding 寻路 http://www.arongranberg.com/unity/a-pathfinding/download/
13. Multiplayer Server and Demo project  多人服务器和deom http://smartfoxserver.com/forums/viewtopic.php?t=9135  
14. Rope physics 绳索物理 http://reverieinteractive.com/downloads-2  
15. UnityScript Editor 脚本编辑器 http://www.arsoftware.co.uk/products/unityscript-editor/download  
16. Action HUD - for RPG games RPG游戏 动作HUD http://forum.unity3d.com/threads/67103-ActionsHUD-available-for-free-download  
17. Vectrocity (line renderer) - Commercial http://starscenesoftware.com/vectrosity.html 
 18. Ocean Shader 海洋shader https://github.com/trond/Unity-Community-Ocean 
 19. Decal Framework 贴花 http://unity3dstore.com/?page_id=59 
 20. EasyRoad3D 道路 http://www.unityterraintools.com/tools.php  
 20. EZ GUI - 菜单框架   
21. Sprite Manager - 2D游戏的精灵框架 http://unifycommunity.com/wiki/index.php?title=SpriteManager Better (Commercial): http://www.anbsoft.com/middleware/sm2/index.htm -  
 22. Prime31 - Unity iPhone and iPad 插件 (Commercial) http://www.prime31.com/unity/  
23. GUIKit001 - iPhone and iPad GUI Skin collection (Commercial) http://gameassets.net/ 
 24.Detonator – Explosions for Unity3D http://variancetheory.com/detonator/ 
 25. Object deformation on impact http://vidiludi.com/unity3d-prefabs/ 
 26. Antares Project - Nice tools and Classes for large project management http://shop.unity3d.ru/index.php/en/en/component/content/article/18.html  
27. Networking Book and example file http://forum.unity3d.com/threads/29015-UniKnowledge-entry-Unity-Networking-the-Zero-to-Hero-guide  
28. Auto Patcher tool for updating your games http://forum.unity3d.com/threads/62326-M2HPatcher?p=398858#post398858  
29. Unity Game examples - Nice tutorials shipped as some mini games http://forum.unity3d.com/threads/51017-5-Unity-game-examples-C-scripting-tutorial-for-beginners?p=323510#post323510  
30. Occlusion cooling system http://forum.unity3d.com/threads/52130-M2HCulling-Optimize-your-game-culling-system-for-Unity  
31. In game rewind - Documentation with code http://m2h.nl/files/replay/replay.pdf  
32. Converting Javascript to C# - Online tool http://m2h.nl/files/js_to_c.php  
33. RPG inventory system http://forum.unity3d.com/threads/48229-RPG-INVENTORY-SOURCE/page4  
34. Flashlight http://forum.unity3d.com/threads/31926-Flashlight/page3 
 35. Fracture Script http://forum.unity3d.com/threads/57994-Simple-Fracture-Script-v-1.01  
36. Role playing game (RPG) development kit - (Commercial) http://rpg-kit.com/ 
 37. Save and load state of your game - (Commercial) http://www.anbsoft.com/middleware/ezs/  
38. Flight Simulator http://forum.unity3d.com/threads/43984-Unity-testproject-a-little-flightsim/page2  
39.Stereoscopy package http://forum.unity3d.com/threads/61759-3D-Anaglyph-System-for-Unity-iPhone-Basic-Pro-and-Unity-Free    

 3.JS脚本与C#脚本之间的调用

est1.js

  1. function OnGUI()  
  2. {   
  3. if(GUI.Button(Rect(25,25,100,30),"JS Call CS" ))  
  4. {  
  5. var c = gameObject.GetComponent("test2");  
  6. c.PrintTest();  
  7. }  
  8. }  
  9. function testPrint()  
  10. {  
  11. print("CS Call JS");  
  12. }  

 

test2.cs

  1. using UnityEngine;  
  2. using System.Collections;  
  3. public class test2: MonoBehaviour {  
  4. void OnGUI()  
  5. {  
  6. if(GUI.Button(new Rect(25,70,100,30), "CS Call JS"))  
  7. {  
  8. test1 c = (test1)gameObject.GetComponent("test1");  
  9. c.testPrint();  
  10. }  
  11. }  
  12. void PrintTest()  
  13. {  
  14. print("JS Call CS");  
  15. }  
  16. }  

這里必須要注意的是JS文件必須是在 "StandardAssets"、 "Pro StandardAssets“和 "Plugins"這三個目錄中的任何一個里,而CS文件不能與JS文件在一個目錄中。原因是,這三個目錄里的腳本被最先編譯,"Editor"目錄里的稍后編譯,其他的腳本最后編譯。如果在一個目錄下則CS文件無法讀取JS里的方法,也就無法編譯通過了。而JS調用CS方法則無此限制。

4.Unity与VS2008的结合

Unity3D中所使用的编程语言有三种:C#,JS和BOO。同时自带了免费的编辑器,然而在windows下,编辑器还是VS最强大,所以本文就探讨如何配合Unity3D使用VS2008。

1、创建一个Unity3D工程,在指定的目录下会生成Asset文件夹。

2、启动VS2008,新建一个Visual C#的类库项目,在“位置”处指定刚才Unity3D所创建的文件夹。

Unity3D开发一些初级问题_第1张图片

3、在资源管理器中添加到UnityEngine.dll的引用,此文件位于<Unity3d安装目录>/Unity/Editor/Data/Frameworks/UnityEngine.dll

Unity3D开发一些初级问题_第2张图片

4、然后修改.cs文件内容以便Unity3D能够正确编译。保存并切换到Unity3D即可。

当然我们可以利用VS的模板功能将上述步骤制作为一个模板,可以在新建项目的时候自动生成正确的Unity3D可以编译的文件。这个工作已经有人完成了,你可以从这里 下载模板。然后,将zip文件放置在C:/Documents and Settings/<用户名> /My Documents/Visual Studio 2008/Templates/ProjectTemplates/Visual C#下,重启VS2008就可以看到我的模板中多出的UnityLibrary。

 

结论:这种方案只是一个折中的方案,并没有很好的处理VS生成的其他文件,因此在使用上并不是非常方便!


http://tank2308635.iteye.com/category/165288


你可能感兴趣的:(Unity3D开发一些初级问题)