利用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) 人氣()

今天就來介紹unity3D 常用到且一定會用到的prefab

這個是什麼東西呢?簡單來說就是預製物件

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

今天來寫些腳本的東西  熟悉一下unity3D 實際上是怎麼去運作的吧

1 一樣  我們先創造一個新場景吧點上面選項file/new scene

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

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


文章標籤

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

using UnityEngine;
using System.Collections;
//以下是從http://game.ceeger.com/Script/
//取得的翻譯 我只是轉成程式碼的方式 方便取用

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

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


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

今天就來說說  Component這個項目是在幹什麼的吧!!!!

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

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

剛接觸unity3D時  對這個編輯器真的是又愛又恨

愛的是它跨平台的方便性

文章標籤

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

«12