原创 Unity 手機“搖一搖” 手機震動
檢測“搖一搖”的行爲: Input.acceleration Input.accelerationEvents Input.accelerationEventCount手機震動: Handheld.Vibrate(); 代碼如下, u
原创 Unity接口函數Vector3.Project()
using UnityEngine; using System.Collections; /// <summary> /// Vector3.Project()函數測試。 /// </summary> public class Vec
原创 Camera.main == null 爲什麼?
Camera.main 主相機 static var main : Camera Description描述 The first enabled camera tagged "MainCamera" (Read Only). 第一個啓
原创 【VS2015使用】VS2015新版小問題,無法打開包括文件stdio.h等
申明:Win10 環境安裝vs2015如果安裝vs2015時使用默認安裝,那麼vs2015是無法創建C++工程的。VS2015默認安裝時候沒有安裝C++,如果安裝C++沒有選擇全部C++項目,則無法創建C++工程,在控制面板裏的刪除程序中
原创 Unity應用發佈如何在本地查看Debug輸出?
在使用Unity引擎開發遊戲的過程中,我們能將想要看到的內容通過Debug類來輸出到Console窗口中,極大的方便了程序的調試過程。但是,我們將遊戲發佈成對應的平臺應用程序後,這些輸出還能不能看到呢?如可才能看到這些輸出呢?這裏我就介
原创 C#對象的淺拷貝、序列化深拷貝
using System; using System.Collections.Generic; //using System.Linq; //using System.Text; //using System.Threading.Task
原创 Unity Vector3.Slerp() 球形插值詳解之二
using UnityEngine; using System.Collections; /// <summary> /// 在日出和日落之間動畫弧線 /// 網上看到有人對Vector3.Slerp()的詳解,但是經過962f之力將他
原创 Unity中寫文件到本地
環境:unity5.3,C# 目的:將信息寫入到本地文件,方便查看。 using UnityEngine; //using System.Collections; using System.IO; /// <summary> /// 寫
原创 C# Dictionary 遍歷
using UnityEngine; using System.Collections; using System.Collections.Generic; /// <summary> /// C# Dictionary 語法測試 /
原创 C#時間格式轉換爲時間戳(互轉)
</pre><pre name="code" class="csharp">using UnityEngine; using System.Collections; using System; /// <summary> /// C#時
原创 tolua學習資料彙總貼
原文地址:http://doc.ulua.org/article/ulua/ziliaotietoluaxuexiziliaohuizongtie.html tolua工程地址 https://github.com/topameng/
原创 VS2015 代碼縮略圖的設置
一個文件中代碼太長,難以定位到你想要的位置可以打開代碼縮略圖功能。 方法設置如下: 工具->選項->文本編輯器->所有語言->滾動條->行爲(使用垂直滾動條的縮略圖模式) 可參考下圖A->B->C->D->E:
原创 Unity射線碰撞檢測的LayerMask的使用
Unity射線碰撞檢測接口:Raycast (ray : Ray, out hitInfo : RaycastHit, distance : float = Mathf.Infinity, layerMask : int = kDefau
原创 Unity 手機遊戲屏幕翻轉問題
上述圖片代表在Plyer Seettings設置中禁止翻轉,使用的是Unity5.3版本 下面是代買修改屏幕是否可翻轉。 using UnityEngine; using System.Collections; /// <summa
原创 Unity Vector3.Lerp()與Vecotr3.MoveTowards()方法區別
<pre name="code" class="html">static function Lerp (from : Vector3, to : Vector3, t : float) : Vector3 兩個向量之間的線性插值。 按照