Tools
工具
Bug敲起来
一名U3D程序员,欢迎一起讨论问题
展开
-
两种单例工具
单例工具 直接继承类,后面跟类的类型using System; namespace Frame.Utility{ public class Singleton<T> where T : class { private static T instance; public static T GetInstance() { if (instance == null) { ..原创 2021-10-14 23:23:48 · 101 阅读 · 0 评论 -
异步加载场景
using System.Collections;using UnityEngine;using UnityEngine.UI;using UnityEngine.SceneManagement;public class RobSceneLoad : MonoBehaviour { public Text text; public Slider slider; public Image fader; public Animator animator; .原创 2021-10-08 22:11:50 · 132 阅读 · 0 评论 -
数据库工具类
using System;-------------数据库工具类--------------using System.Collections;using System.Collections.Generic;using UnityEngine;using Mono.Data.Sqlite;//如何在unity中使用数据库//封装一个工具类 负责创建 增删改查等操作public class SqlLiteDataHelper : MonoBehaviour{ //数据库连接定义 ..原创 2021-10-05 12:41:31 · 247 阅读 · 0 评论 -
延时协程代码
using System.Collections;using System.Collections.Generic;using UnityEngine;using System;using System.Reflection;public class ActionController : MonoBehaviour{ public static ActionController Instance; private void Awake() { Insta...原创 2021-10-05 12:40:31 · 134 阅读 · 0 评论 -
JsonMapper工具类
using UnityEngine;using System;using System.Text;using LitJson;using System.IO;public class SaveWithJson { private static SaveWithJson instance; public static SaveWithJson Instance { get { if(instance ==null...原创 2021-10-05 12:40:41 · 1956 阅读 · 3 评论 -
Json系统自带工具类
using System;using System.IO;using UnityEngine; [Serializable]//Json工具类 负责处理游戏对象与json字符串之间的序列化与反序列化public class JsonTool{ //默认保存数据的库的名字 private const string DefaultName="GameData.json"; //将json字符串持久化到默认文件 public static void S.原创 2021-10-05 12:40:18 · 109 阅读 · 0 评论 -
UI框架。
using System.Collections;------UI基类----------------------using System.Collections.Generic;using UnityEngine; public class UIBase : MonoBehaviour{ /// <summary> /// 进入游戏 /// </summary> public virtual void DoOnEnter() {..原创 2021-10-05 12:40:10 · 134 阅读 · 0 评论 -
声音框架。
using System;------------------声音框架-----------------------------using System.Collections;using System.Collections.Generic;using UnityEngine; public class SoundManage : MonoBehaviour{ //单例 public static SoundManage Instance; //音乐播放器组件 .原创 2021-10-05 12:39:49 · 106 阅读 · 0 评论 -
摄像机跟随
using UnityEngine;using System.Collections;public class Cam360View : MonoBehaviour{ public Transform target; public float xSpeed = 200; public float ySpeed = 200; public float mSpeed = 10; public float yMinLimit = -50; public ...原创 2021-10-04 14:33:19 · 78 阅读 · 0 评论 -
第三人称移动
using UnityEngine;using System.Collections; public class ThirdPlayerMove : MonoBehaviour{ float h; float v; public float speed = 6; public float turnSpeed = 15; public Transform camTransform; Vector3 movement; Vector3 ca...原创 2021-10-04 14:30:54 · 160 阅读 · 0 评论