原创 AI-簡單FSM

using System.Collections; using System.Collections.Generic; using UnityEngine; public class SimpleFSM : MonoBehaviour

原创 Shader-(頂點實現)漫反射相關;自定義顏色

漫反射 Diffuse = 直射光顏色 * max(0,cos夾角(光和法線的夾角) )  點積cosθ = 光方向· 法線方向    //max表示小於0時取最大值0 只有定義了正確的LightMode才能得到一些Unity的內置光照變

原创 Shader-漫反射(像素實現)

系統內置漫反射Shader "Diffuse" // Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject' Shader "LXC/05 Diffuse

原创 Shader-紋理添加偏移和縮放

// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject' // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*

原创 Shader-頂點函數與片元函數

// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' Shader "LXC/02 CanRun" { SubShade

原创 燈光與渲染

Edit=>Project Setting=>Player Setting=>Other Setting=>Color Space線性空間最好選擇Linear 烘焙錯誤UVs(不是真實的模型效果):在模型select=>Model菜單下l

原创 AI-羣組行爲

不使用羣組行爲 using System.Collections; using System.Collections.Generic; using UnityEngine; public class Crow : MonoBehavi

原创 Shader-基本結構與屬性定義

Shader "LXC/ 01 myshader"//這裏指定的shader名字,不要求和文件名一致,/前的爲路徑 { //屬性 Properties { //屬性的定義 屬性名("Inspector顯示名",類型)=(默認值

原创 udpclient

客戶端 using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; usi

原创 tcpclient與tcplistener

客戶端 using System; using System.Collections.Generic; using System.Linq; using System.Net.Sockets; using System.Text; us

原创 UDP聊天室

客戶端 using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; usi

原创 Vuforia學習

Android TV Vuforia不支持 DefaultTrackableEventHandler腳本下 動畫跟隨物體生成 public GameObject aiXiPrefab; //找到了需要識別的物體 protect

原创 Lua中#的解讀

table t 的長度被定義成一個整數下標 n 。 它滿足 t[n] 不是 nil 而 t[n+1] 爲 nil; 此外,如果 t[1] 爲 nil ,n 就可能是零。 對於常規的數組,裏面從 1 到 n 放着一些非空的值的時候, 它的長

原创 Unity聊天室Tcp協議

客戶端unity腳本 using System.Collections; using System.Collections.Generic; using System.Net; using System.Net.Sockets; usi

原创 Socket-tcp協議客戶端與服務器端互聯

客戶端 using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; usi