2013年10月1日 星期二

UNITY 3D 小小MEMO

取得子物件的component

var script : hitEffectPlanePrefabScript; 
script = hitEffect2.GetComponentInChildren(hitEffectPlanePrefabScript);
script.deadTogether ();

===================================
建立clone物件

var XXXXX:GameObject = Instantiate(YYYYY,Vector3(this.transform.position.x,1,this.transform.position.z),Quaternion.identity);

GameObject creatMenuButton = Instantiate(menuButtonnew Vector3(0,0,0), Quaternion.identityas GameObject;
===================================
mono快速注解
Toggle Line Comments

===================================
使用方向鍵控制物體移動

void Update () {
//Vertical 垂直
var input = Input.GetAxis("Vertical");
transform.Translate(0,input,0);
//Horizontal 水平
var input2 = Input.GetAxis("Horizontal");
transform.Translate(input2,0,0);

}

//GetAxis 移動時有遞增及遞減效果
//GetAxisRaw 無遞增遞減效果

===================================
副執行序
StartCoroutine(start());


IEnumerator start()
{

}

===================================
像螢幕發射子彈
    void Update () {
        if ( Input.GetMouseButtonDown(0))
        {
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            Debug.Log(ray);
            
            fire();
        }
    }
    void fire()
    {        
         Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         Vector3 point = ray.direction;
//            if (Physics.Raycast(ray))
        //{
        GameObject fire = Instantiate(bulletmainCamera.transform.positiontransform.rotationas GameObject;
        fire.rigidbody.AddForce(point*500);
        
        allCount ++;
        updateUI();
        //}    
    }


===================================

===================================
int[,] matrix = new int[,]
{
 {00,00,00},
 {00,00,00}
};

===================================

==特效外掛==
Svn: https://richard6534.no-ip.org/svn/Program/Unity3D/Plugin

*水波紋外掛 unitycoder_com_mWaves2D1.unitypackage
*RPG特效 Dynamic_Elements_FX_Pack_1.2.unitypackage

==NGUI==
中文教學&載點
http://blog.csdn.net/pleasecallmewhy/article/details/8554413

==AR==
http://www.eoeandroid.com/thread-249118-1-1.html

===FaceBook===
https://developers.facebook.com/docs/unity/getting-started/canvas/
http://www.youtube.com/watch?v=YDRh3OkM1Hc

example : https://github.com/fbsamples/friendsmash-unity/



https://www.youtube.com/watch?v=JFKQmylG2mk

2013年9月26日 星期四

最後都市防衛作戰_行動裝置移植計劃



iPod touch 5 (iOS 6.1.3)
iPod touch 5 (iOS 6.1.3)
小米2S (android)

2013年4月17日 星期三

獨立遊戲製作:最後都市防衛作戰


遊戲網址連結:
最後都市防衛作戰
此連結為線上執行遊戲,須安裝UNITY WEBPLAYER,瀏覽器會自動導引安裝。

使用工具:Unity 3D,Photoshop


創作發想來源:
  只是想做一個能讓玩家覺得好玩,
  規則簡單並不用閱讀大量文字就能快速開始的熱血遊戲。

作品簡介:
  面對未知的攻擊,誓死捍衛人類僅存的最後都市。

遊戲簡易操作說明:
  使用滑鼠控制主砲砲擊位置,
  並適時的點擊滑鼠左鍵來殲滅過多的敵人,
  詳細請看遊戲說明。

作品截圖:







此遊戲無任合商業用圖