目前分類:其他 (6)

瀏覽方式: 標題列表 簡短摘要

2015最夯的題材應該就是物聯網的題材吧

其實物聯網不算是新的議題

文章標籤

cwa1022 發表在 痞客邦 留言(0) 人氣()

UITexture.cs  當中都有英文說明(基於商業版權問題  就不貼上原碼了)

如果你沒有或不希望創建一個atlas,你可以簡單地使用這個腳本來繪製紋理。

cwa1022 發表在 痞客邦 留言(0) 人氣()

利用BMFont製作字體檔的方法

下載 bmfont 這個免費的軟體,並安裝。http://www.angelcode.com/products/bmfont/

文章標籤

cwa1022 發表在 痞客邦 留言(0) 人氣()

using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
/*
 * 這只是打包assetBunldes的編輯項目
 * androidr使用就要使用forAndroid結尾的項目打包
 * 電腦上要使用的則不用
 * IOS目前無需求
 * 以下是全打包及單一打包差別
 * BuildPipeline.BuildAssetBundle (obj, null, targetPath, BuildAssetBundleOptions.CollectDependencies,BuildTarget.Android)
 * BuildPipeline.BuildAssetBundle (null, SelectedAsset, Path, BuildAssetBundleOptions.CollectDependencies,BuildTarget.Android)
 * */
public class CreateAssetBunldes : MonoBehaviour 
{
    [MenuItem("yuchiHelper/CreateAssetBunldesMain")]
    static void CreateAssetBunldesMain ()
    {
        //取得在Project中選擇的所有對象
        Object[] SelectedAsset = Selection.GetFiltered (typeof(Object), SelectionMode.DeepAssets);
        //遍歷這個選擇到的對象
        foreach (Object obj in SelectedAsset) 
        {
            string sourcePath = AssetDatabase.GetAssetPath (obj);
            //将Assetbundle放在AssetBundles文件夹下,如果没有就創建一個
            //AssetBundles是只是路徑
            //網路下载:就不需要放在這裡。
            string Path = Application.dataPath + "/AssetBundles/" + obj.name + ".assetbundle";
            if (BuildPipeline.BuildAssetBundle (obj, null, Path, BuildAssetBundleOptions.CollectDependencies)) 
            {
                Debug.Log(obj.name +"打包成功");
            } 
            else 
            {
                Debug.Log(obj.name +"打包失敗");
            }
        }
        //刷新
        AssetDatabase.Refresh ();    
    }
    [MenuItem("yuchiHelper/CreateAssetBunldesMainForAndroid")]
    static void CreateAssetBunldesMainForAndroid ()
    {
        Object[] SelectedAsset = Selection.GetFiltered (typeof(Object), SelectionMode.DeepAssets);
        foreach (Object obj in SelectedAsset) 
        {
            string sourcePath = AssetDatabase.GetAssetPath (obj);
            string Path = Application.dataPath + "/AssetBundles/" + obj.name + ".assetbundle";
            if (BuildPipeline.BuildAssetBundle (obj, null, Path, BuildAssetBundleOptions.CollectDependencies,BuildTarget.Android)) 
            {
                Debug.Log(obj.name +"打包成功");
            } 
            else 
            {
                Debug.Log(obj.name +"打包失敗");
            }
        }
        AssetDatabase.Refresh ();
    }
    [MenuItem("yuchiHelper/CreateAssetBunldesALLForAndroid")]
    static void CreateAssetBunldesALLForAndroid  ()
    {
        Caching.CleanCache ();
        
        string Path = Application.dataPath + "/AssetBundles/ALL.assetbundle";
        
        Object[] SelectedAsset = Selection.GetFiltered (typeof(Object), SelectionMode.DeepAssets);
        
        foreach (Object obj in SelectedAsset) 
        {
            Debug.Log ("Create AssetBunldes name :" + obj);
        }
        
        //跟單獨打包最大的差異就在參數二
        if (BuildPipeline.BuildAssetBundle (null, SelectedAsset, Path, BuildAssetBundleOptions.CollectDependencies,BuildTarget.Android)) 
        {
            Debug.Log("Success!!!  for  android");
            AssetDatabase.Refresh ();
        } 
        else 
        {
            Debug.Log("false!!!!!");
        }
    }
    [MenuItem("yuchiHelper/CreateAssetBunldesALL")]
    static void CreateAssetBunldesALL  ()
    {
        Caching.CleanCache ();
        string Path = Application.dataPath + "/AssetBundles/ALL.assetbundle";
        Object[] SelectedAsset = Selection.GetFiltered (typeof(Object), SelectionMode.DeepAssets);
        foreach (Object obj in SelectedAsset) 
        {
            Debug.Log ("Create AssetBunldes name :" + obj);
        }
        if (BuildPipeline.BuildAssetBundle (null, SelectedAsset, Path, BuildAssetBundleOptions.CollectDependencies)) 
        {
            Debug.Log("Success!!!");
            AssetDatabase.Refresh ();
        } 
        else 
        {
            Debug.Log("false!!!!!");
        }
    }
}


cwa1022 發表在 痞客邦 留言(0) 人氣()

https://docs.google.com/file/d/0BztNf1-CnDEhOWhzRnV1T1Vya28/edit?usp=drive_web


文章標籤

cwa1022 發表在 痞客邦 留言(0) 人氣()

http://www.onejar99.com/2012/11/blog.html


cwa1022 發表在 痞客邦 留言(0) 人氣()