Unity技巧
WePead
这个作者很懒,什么都没留下…
展开
-
#Unity _ 计时器使用
#Unity _ 计时器使用 GameTimerData using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameTimerData { private System.Action callback; private float time; public GameTimerData(float t,System.Action callback)原创 2021-04-23 14:23:11 · 113 阅读 · 0 评论 -
#Unity _ 对象池
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PoolManager { public static PoolManager instance; private Dictionary<string, List<GameObject>> poolDic; public PoolManager() {原创 2021-04-21 21:11:38 · 59 阅读 · 0 评论 -
#Unity _ 快速排序
using System.Collections; using System.Collections.Generic; using UnityEngine; public class 快速排序 : MonoBehaviour { void Start() { 快速排序Test(arr, 0, arr.Length - 1); } public int[] arr = new int[] { 1, 3, 2, 4, 5, 8, 7, 22, 32, 18, .原创 2021-04-09 22:16:42 · 428 阅读 · 0 评论 -
#Unity _ 希尔排序
using System.Collections; using System.Collections.Generic; using UnityEngine; public class 希尔排序 : MonoBehaviour { int[] arr = { 8, 7, 10, 2, 1, 0, 21, 20 }; void Start() { for (int i = 0; i < arr.Length; i++) {原创 2021-04-06 15:03:23 · 100 阅读 · 0 评论 -
#Unity _ 插入排序
using System.Collections; using System.Collections.Generic; using UnityEngine; public class 插入排序 : MonoBehaviour { public int[] arr = new int[] { 8, 7, 10, 2, 1, 0, 21, 20 }; private int lastIndex; //下标 private int curValue;//当前的值 privat原创 2021-04-03 14:48:43 · 175 阅读 · 0 评论 -
#Unity _ 斐波那契数列
【代码】#Unity _ 斐波那契数列。原创 2021-04-01 18:04:28 · 77 阅读 · 0 评论 -
#Unity _ 冒泡排序
using System.Collections; using System.Collections.Generic; using UnityEngine; public class 冒泡排序 : MonoBehaviour { int[] arr = new int[] { 2, 1, 6, 5, 8, 7, 9 }; public int[] 冒泡Test(int[] arr)//大到小排序 { for (int i = 0; i < arr.Length原创 2021-03-23 14:50:34 · 182 阅读 · 0 评论 -
#Unity _ 选择排序
using System.Collections; using System.Collections.Generic; using UnityEngine; public class 快速排序 : MonoBehaviour { private int[] arr = new int[] { 22, 3, 43, 24, 6, 9, 10, 12, 5, 1, 8, 7 }; public void Start() { int[] temp = 快速排序Test(a原创 2021-03-22 21:02:17 · 131 阅读 · 0 评论 -
关于Unity 攻击敌人感官反馈
关于Unity 攻击敌人感官反馈 镜头震动+攻击停顿 //using System.Collections; using System.Collections.Generic; using UnityEngine; public class CameraShake : MonoBehaviour { public bool isShake; //是否震动 public float shakeTime = 0.1f; //震动时长 public float shake原创 2021-03-09 14:47:07 · 455 阅读 · 0 评论 -
Characher Ctl
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace WePead { public class Player : MonoBehaviour { [Header(“状态”)] public float speed = 6.0F; public float jumpSpeed = 8.0F; public float gravity = 20.0F; private Vecto原创 2021-01-07 17:56:59 · 72 阅读 · 0 评论 -
2DPlayerMove&&PlayerLookAtMousePos
原创 2021-01-06 13:42:24 · 109 阅读 · 0 评论