![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
unity
唐孝辉
QQ:1351105506
微信:xt411526
展开
-
AStar
using System.Collections.Generic;//优先队列(二叉堆),这里实现的是"小堆",即堆顶一直为最小值,用于AStar中对OpenList的维护//下标为i的节点其左子节点下标是(i*2+1),右子节点下标是(i*2+2),父节点的下标是((i-1)/2)public class BinaryHeap{#pragma warning disable 0414 private List<stARoadPoint> _HeapArray = new L原创 2020-12-26 15:27:23 · 473 阅读 · 0 评论 -
游戏启动热更检测
using UnityEngine;using UnityEngine.Events;using UnityEngine.Networking;using System.Collections;using System.Collections.Generic;using System.IO;using AssetManagement;/// <summary>/// 游戏启动更新检查/// </summary>public partial class Launc原创 2020-12-26 14:56:30 · 379 阅读 · 0 评论 -
动画缩放和移动
using DG.Tweening;using System.Collections;using System.Collections.Generic;using UnityEngine;namespace XGUI{ public class XScaleTween : MonoBehaviour { public Ease m_ease = Ease.InOutBack; public Vector3 startValue = new Vecto原创 2020-12-26 14:55:24 · 214 阅读 · 0 评论 -
动画循环和特效播放
using System.Collections;using System.Collections.Generic;using UnityEngine;using DG.Tweening;using UnityEngine.UI;public class AnimLoop : MonoBehaviour{ public enum AnimLoopType { MoveX, //水平 MoveY, //垂直 Fa原创 2020-12-26 14:52:02 · 173 阅读 · 0 评论 -
Utility
using UnityEngine;using System.Collections;using System.IO;using System.Text;using System;using System.Security.Cryptography;public class MD5Utility{ public static string FileMd5(string file) { try { FileStream f原创 2020-12-26 14:48:12 · 416 阅读 · 0 评论 -
红点类
using UnityEngine;using System.Collections;using System.Collections.Generic;using System.Text;using System.Text.RegularExpressions;using UnityEngine.Events;using UnityEngine.UI;namespace XGUI{ public class XHotSpot : MonoBehaviour {原创 2020-12-26 14:40:55 · 148 阅读 · 0 评论 -
红点系统
01.RedManager原创 2020-11-14 16:01:48 · 687 阅读 · 0 评论 -
无限背包
无限原创 2020-08-31 20:51:49 · 553 阅读 · 0 评论 -
性能优化
包体比较大的原因程序在mono虚拟机运行02.原创 2020-06-30 13:03:04 · 122 阅读 · 0 评论 -
前端面试题
下图是一个装备系统的合成图谱,箭头指向的是合成之后的装备,每合成一个装备需要消耗一些金币(标注在矩形框里面),箭头上的数字表示合成所需的材料数量。比如,要合成n个装备A,需要消耗3n个装备B、1n个装备C、4n个装备D,而且还需要消耗26n金币(装备B和装备D的合成与此类似)。为了简单起见,下面两个题目的装备图谱都是一棵多叉树,而且玩家最初只拥有指定数量的叶子节点的装备,也就是图中的装备C、装备E、装备F和装备G。注意,下面的图谱只是一个例子,作答的时候不要局限于这个图谱。请从下面的题目中选择一个来原创 2020-06-16 18:35:37 · 887 阅读 · 4 评论 -
MVC
01.介绍02.原创 2020-05-12 09:51:32 · 214 阅读 · 0 评论 -
02.XML
01.读取XML文件原创 2020-05-02 18:28:03 · 114 阅读 · 0 评论 -
01.XML
01.介绍原创 2020-05-02 17:37:38 · 97 阅读 · 0 评论 -
存档
01.二进制原创 2020-05-01 20:53:03 · 157 阅读 · 0 评论 -
3D轮转图
原创 2020-04-26 22:02:37 · 182 阅读 · 0 评论 -
04.基础框架 事件中心模块和音效模块
using System;using System.Collections;using System.Collections.Generic;using System.Reflection;using UnityEngine;interface IEventInfo{ }class EventInfo<T>: IEventInfo{ publ...原创 2020-04-25 19:23:03 · 181 阅读 · 0 评论 -
03.基础框架场景和资源加载模块
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.Events;using UnityEngine.SceneManagement;public class SceneMgr : BaseManager<SceneMgr>{ ...原创 2020-04-20 16:59:17 · 150 阅读 · 0 评论 -
02.基础框架Mono模块
using System;using System.Collections;using System.Collections.Generic;using UnityEngine;public class MonoController : MonoBehaviour{ private Action callBack = null; void Update() ...原创 2020-04-20 11:01:55 · 993 阅读 · 0 评论 -
01.基础框架单利和对象池
01.单利模式基类using System.Collections;using System.Collections.Generic;/// <summary>///不继承mono的单利基类/// </summary>/// <typeparam name="T"></typeparam>public class BaseManage...原创 2020-04-19 17:32:56 · 129 阅读 · 0 评论 -
02.A*
using System.Collections;using System.Collections.Generic;using UnityEngine;/// <summary>/// 格子的类型/// </summary>public enum NodeType{ Walk, Stop,}/// <summary>/...原创 2020-04-17 17:13:35 · 133 阅读 · 0 评论 -
A*
01.原创 2020-04-16 15:44:28 · 133 阅读 · 0 评论 -
Navigation跳跃导航
Drop Height:代理跳落高度。(只能往下跳,不可往上跳)。表示寻路者可以跳落的高度限。Jump Distance:代理跳跃距离。(往远处跳跃的距离)。 表示寻路者的跳跃距离极限01.勾选 Links02.设置跳跃的高度和距离03....原创 2020-04-06 22:08:30 · 560 阅读 · 0 评论 -
Navigation
01.02.原创 2020-04-06 19:47:40 · 327 阅读 · 0 评论 -
摇杆制做
01.创建点击的区域 轮盘 bg 和拖动的小图标02.创建摇杆控制界面脚本并赋值using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;public class JoyPanel : MonoBehaviour{ public Imag...原创 2020-04-06 13:26:49 · 199 阅读 · 0 评论 -
Android安装
01.Unity中的Android Build Support下载在Unity中的File>Building Settings>Android>Open Download Page或在Unity官网下载对应版本的Unity安装助手自行追加安装02.JDK下载(请勿使用JDK9,JDK8u152,JDK8u151任选,x64版本出现签名错误的话可以尝试x86版本)http:...原创 2020-02-05 11:32:07 · 1312 阅读 · 0 评论 -
炮弹轨迹
using UnityEngine;public class TestSpeed : MonoBehaviour { public float time = 3; // 代表从A点出发到B经过的时长 public Transform pointA; // 点A public Transform pointB; // 点B...原创 2020-01-06 23:06:27 · 875 阅读 · 0 评论 -
05.障碍物清除算法的实现
//清除障碍物的方法 private void ClearBarrier(int x,int y) { //遍历他的左边和右边 是否是障碍物 不包括他自身 for (int fiendX = x-1; fiendX <= x+1; fiendX++) { if (fiendX!=x&&f...原创 2019-11-26 23:02:59 · 318 阅读 · 0 评论 -
04L型匹配和T型匹配的核心算法
//自己写的不完全public List<GameSweet> MatchSweets(GameSweet sweet,int newX,int newY) { if (sweet.CanColor()) { ColorSweet.ColorType color=sweet.ColoredComponent.Color...原创 2019-11-24 23:38:52 · 1058 阅读 · 0 评论 -
03.甜品相邻与交换方法和直线匹配的核心算法
//判断甜品是否相邻居 public bool IsFriend(GameSweet sweet1,GameSweet sweet2) { return (sweet1.X == sweet2.X && Mathf.Abs(sweet1.Y - sweet2.Y) == 1) || (sweet1.Y =...原创 2019-11-24 22:59:35 · 149 阅读 · 0 评论 -
02.消消乐斜向填充算法
//分步填充 public bool Fill() { bool filledNotFinished = false;//判断本次填充是否完成 for (int y = yRow-2; y >=0; y--) { for (int x = 0; x < xColumn; x++) ...原创 2019-11-24 19:43:12 · 658 阅读 · 0 评论 -
Touch
using UnityEngine;using UnityEngine.UI;public class TouchDemo : MonoBehaviour{ public Text text; private void Update() { //每当一个手指触摸屏幕时候,unity都会为其生成一个Touch对象 //nput.touc...原创 2019-11-21 22:27:50 · 193 阅读 · 0 评论 -
图片切割
/*** UnityVersion: 2018.3.10f1* FileName: ImageSlicer.cs* Author: TYQ* CreateTime: 2019/04/19 00:04:26* Description: *//** Author:* Date:2019/01/30 10:24:22 * Desc:图集切割器 (针对Mult...原创 2019-11-20 09:44:26 · 173 阅读 · 0 评论 -
多重血条的制作
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;public class TestHp : MonoBehaviour{ //背景色图片和前景色图片 public Image background; ...转载 2019-10-20 16:56:55 · 293 阅读 · 0 评论 -
Test
public class ScrollViewTest : MonoBehaviour,IBeginDragHandler,IDragHandler,IEndDragHandler { private ScrollRect scrollRect; private RectTransform contentRectTrans; // Use this for initiali...原创 2019-10-14 22:31:17 · 70 阅读 · 0 评论 -
产怪
```csharp // 自定义每波敌人的参数2 [System.Serializable] // 序列化3 public class Wave4 {5 public GameObject enemyPrefab; // 敌人模型6 public int count; // 敌人数量7...原创 2019-10-14 21:41:55 · 183 阅读 · 0 评论 -
02定时回调增加任务循环功能
/**************************************************** 文件:TimeTask.cs 作者:唐孝辉 邮箱: 1351105506@qq.com 日期:#CreateTime# 功能:任务类*****************************************************/using Syst...原创 2019-06-13 19:59:17 · 124 阅读 · 0 评论 -
01定时回调
public class TimeTask{ public Action action; public float time;}public class TimerSys : MonoBehaviour{ private List<TimeTask> taskList=new List<TimeTask>(); void ...原创 2019-06-13 14:49:09 · 203 阅读 · 0 评论 -
背包
01:创建基类Itemusing UnityEngine;public class Item { public int ID { get; set;} public string Name { get; set; } public ItemType itemType { get; set;} public QualityType qualityType ...原创 2019-05-31 13:50:49 · 91 阅读 · 0 评论 -
UI框架
使用UGUI,想要panel依次显示,退出,更好的管理各种UI界面,使用栈的方式管理所有的想要加载的UI界面。原创 2019-05-22 12:40:05 · 170 阅读 · 0 评论 -
unity编辑器扩展
的原创 2019-05-10 15:11:42 · 242 阅读 · 0 评论