找回密码
 注册帐号

扫一扫,访问微社区

开发技巧-场景状态管理器(状态模式)
UnityTerminator 2018-9-11 20:04
1.状态接口 csharpcode: using System.Collections; using System.Collections.Generic; using UnityEngine; /// summary /// 场景状态 /// /summary public class ISceneState { //状态名称 private string m_StateName = "ISceneState"; public string StateName { get ...
个人分类: Unity-开发技巧|635 次阅读|0 个评论 热度 1
开发技巧-HUDFps
UnityTerminator 2018-9-6 09:54
csharpcode: using UnityEngine; using UnityEngine.UI; using System.Collections; public class HUDFPS : MonoBehaviour { // Attach this to a Text to make a frames/second indicator. // // It calculates frames/second over each updateInterval, // so the display does not keep changing wi ...
个人分类: Unity-开发技巧|373 次阅读|0 个评论
开发技巧-世界坐标转屏幕坐标
UnityTerminator 2018-8-24 16:41
csharpcode: //世界坐标转屏幕坐标 public Vector3 WorldToScreenPoint(Vector3 position) { Vector3 screenPosition = Camera.main.WorldToScreenPoint(position); Vector3 uipoint = WindowManager.instance.uiCamera.ScreenToWorldPoint(screenPosition); uipoint.z = 0; ...
个人分类: Unity-开发技巧|471 次阅读|0 个评论
开发技巧-小游戏的本地存储模块
UnityTerminator 2018-8-10 13:29
自己写着玩的,感觉挺好用,就是代码比较Low 后续再优化,话不多说,上代码 搜索 复制 csharpcode: using UnityEngine; public static class SaveManager : object { public static int diamondAmmound = 100; //钻石数量 public static int bestDistance; //最远的距离 ...
个人分类: Unity-开发技巧|634 次阅读|2 个评论 热度 1
游戏框架-XML解析配置工具
UnityTerminator 2018-8-10 13:21
1—这个为解析的接口 csharpcode: using System.Collections.Generic; using System; using System.Xml; using System.Reflection; public abstract class IConfigParser { public abstract Dictionaryint, T LoadingT(string tablename); protected T GreateAndSetValueT(XmlElement node) ...
229 次阅读|0 个评论
开发技巧-一键创建工程需要的文件夹
UnityTerminator 2018-8-10 13:13
csharpcode: using UnityEngine; using System.Collections; using System.IO; #if UNITY_EDITOR using UnityEditor; #endif public class GenerateFolders : MonoBehaviour { #if UNITY_EDITOR private static void CreateBasicFolder() { GenerateFolder(); Debug.Log ...
个人分类: Unity-开发技巧|516 次阅读|0 个评论 热度 2
开发技巧-屏蔽敏感字符
UnityTerminator 2018-7-23 14:06
csharpcode: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class MaskSpeakingTool : MonoBehaviour { private static ListInputField lists=new ListInputField(); static string[] maskStrs; private static MaskSpeak ...
个人分类: Unity-开发技巧|228 次阅读|0 个评论 热度 1
开发技巧-unity sprite 尺寸问题
UnityTerminator 2018-7-23 10:22
相机的Size 设置为分辨率的最大值/100/2; 比如 1280*720,1280/100/2 =6.4;相机的Size设置为6.4即可。 100 指的是 Texture 的 Pixels One Unit 属性设置,也就是说 1 个unity的 Size 单位对应 多少个图片 Pixels 。默认是100。 搜索 复制
个人分类: Unity-开发技巧|1007 次阅读|1 个评论 热度 5
开发技巧-携程方法库
UnityTerminator 2018-7-18 11:02
csharpcode: using UnityEngine; using System.Collections; public static class FunctionLibrary : object { public delegate void myDelegate(); public delegate void myDelegateInt(int i); //Moves a menu element by the received ammount in time //通过接收到的文件来移动菜单元 ...
个人分类: Unity-开发技巧|1101 次阅读|0 个评论 热度 1
开发技巧-UI分层
UnityTerminator 2018-7-18 10:25
csharpcode: using UnityEngine; using System.Collections; public class SetRenderingLayer : MonoBehaviour { public string sortingLayer; //分类层 public int sortingOrder; //排序顺序 void Start() { this.GetComponentRenderer().sortingLayerNa ...
个人分类: Unity-开发技巧|1161 次阅读|0 个评论 热度 2
12