C#
逍遥叹ling
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
unity相机远近缩放和拖拽移动
unity相机远近缩放和拖拽原创 2022-08-23 18:01:12 · 2071 阅读 · 1 评论 -
unity实现神笔马良效果
在unity中,用鼠标画出图案并设置碰撞和重量,蛮牛上看到的代码如下:/// <summary>/// 画线,脚本随便挂载,要求Camera的Projection设置为Orthographic/// </summary>public class DrawLine : MonoBehaviour{ /// <summary> /// 划线的宽度 /// </summary> public float width = 0.1f; /// &原创 2022-03-11 17:16:38 · 5053 阅读 · 0 评论 -
上下浮动的图片提示
using System.Collections;using System.Collections.Generic;using UnityEngine;/// <summary>/// 图片提示上下浮动/// </summary>public class ImgTipsPosCtrl : MonoBehaviour{ private Transform trans; /// <summary> /// 高度 /// </summary>.原创 2021-12-29 11:37:01 · 3205 阅读 · 0 评论 -
获取不重复随机数
思路:获取到一个随机数后把它移出listint listMaxCount = 20; List<int> ints = new List<int>(); private void Start() { for(int i = 0; i < listMaxCount; i++) { ints.Add(i); } } private void Update() { if(Input.GetMouseButtonDown(0)) {.原创 2021-04-02 11:32:35 · 246 阅读 · 0 评论 -
委托与事件
using UnityEngine;using UnityEngine.UI; public class TestCtrl : MonoBehaviour{ /// <summary> /// 定义一个委托 /// </summary> public delegate void Xian(); /// <summary> /// 给委托绑定一个事件 /// </summary> .原创 2021-04-02 11:24:06 · 125 阅读 · 0 评论 -
C#几种排序
void Start() { List<int> ints = new List<int>() {5, 8, 7, 2, 1, 4, 6}; BubbleSort(ints); //使用简单选择排序法 //SimpleSort(ints); //使用快速排序法 //QuickSort(ints, ...原创 2018-09-17 15:25:41 · 1715 阅读 · 0 评论 -
C#几种常见算法
一、求以下表达式的值,写出您想到的一种或几种实现方法: 1-2+3-4+……+mstatic int F1(int m) { int sum =0; bool flag =true; for (int i = 1; i <= m; i++) { if (f...原创 2018-09-17 15:35:40 · 6633 阅读 · 0 评论
分享