原创 unity 讀取中文文件報錯 NotSupportedException: Encoding 936 data

C# File.ReadAllText設置gbk編碼後就可以讀取中文文件 var text = File.ReadAllText(path, Encoding.GetEncoding("GB2312")); 這行代碼在編輯器中運行時正常的

原创 UnityShader--漫反射

逐頂點 Shader "Custom/Diffuse/DiffuseVertexLevel" { Properties{ _Diffuse("Diffuse", Color) = (1, 1, 1, 1) } SubSh

原创 Unity--加載預製體時通過特性將腳本掛載在預製體上

        定義特性類BindPre using System; [AttributeUsage(AttributeTargets.Class)]//特性使用限定爲類 public class BindPre : Attribut

原创 UnityShader--高光反射

逐頂點 Shader "Custom/Specular/SpecularVertexLevel" { Properties{ _Diffuse("Diffuse", Color) = (1, 1, 1, 1) _Specu

原创 Unity--Base64和Texture2D互相轉換

    public Texture2D Base64ToTexture2D(string Base64STR)     {         Texture2D pic = new Texture2D(190, 190, Texture

原创 unity--消息機制

/// 1.同模塊上下級之間進行訪問,可用可不用,推薦不用。消息機制的一個特點是誰訂閱,誰會收到消息 /// 沒有訂閱就不會,如果我們代碼開發內容很多很複雜,那麼我們後期維護不方便查找相關引用。 /// 2.跨模塊訪問調用管理者相關方法

原创 Unity--設置圖片導入的默認格式

將TextureSetting 腳本放在Editor文件夾下 using UnityEditor; public class TextureSetting : AssetPostprocessor {     private void O

原创 unity--讀寫ini文件

 第一種  這個測試用的  寫的比較亂 using System.Collections.Generic; using System.IO; using System.Text; using UnityEngine; public

原创 微信小程序--騰訊框架wepy的使用

WePY項目的創建與使用 WePY的安裝或更新都通過npm進行。NPM是隨同NodeJS一起安裝的包管理工具,可以直接去nodejs官網https://nodejs.org/en/下載安裝nodejs 全局安裝或更新WePY命令行工

原创 unity--Excel讀寫

需要加入庫文件 Excel.dll 和ICSharpCode.SharpZipLib庫文件,官方鏈接 http://exceldatareader.codeplex.com/ 鏈接:https://pan.baidu.com/s/135R

原创 kinect基本使用

KinectSDKv2.0下載地址 https://www.microsoft.com/en-us/download/details.aspx?id=44561 Kinect-unity插件: 鏈接:https://pan.baidu.c

原创 微信小程序--輪播圖

<!--pages/index/index.wxml--> <view> <swiper indicator-dots="true" indicator-color="green" indicator-active-colo

原创 unity--圖表 插件(XCharts)

 圖表插件地址:https://github.com/monitor1394/unity-ugui-XCharts 需要先將Image移除再添加對應的Chart組件 代碼:  using System.Collections;

原创 unity--直接打開某個場景

  將CommonUtility腳本放在Editor文件夾下,就可以直接通過快捷鍵或者菜單欄上的按鈕打開相應的場景,不用在Project下去查找 場景比較多的情況下,通過這個方法打開常用的場景會比較便捷 using UnityEngin

原创 unity--打開電腦裏的某個程序(比如word,網易雲)

將StartProcess.dll導入unity 鏈接:https://pan.baidu.com/s/1qo1wftmlRx0Tj3sMKCWccw  提取碼:niwv    靜態類InternalServerProcess如下