![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Unity3d
zxcvb036
这个作者很懒,什么都没留下…
展开
-
NewtonJson 自定义的JsonConverter用于自定义文本解析函数
先看一下Json的格式。要解析其中的时间戳字段,自带的Converter无法进行,只能自己创建所需的转换函数 { "id": 1384552022690369570, "machineId": 101, "msgCode": 80002, "startTime": 1618937902137, "endTime": 1618937915316, "createStartTime": 16189379005原创 2021-09-09 08:39:16 · 1687 阅读 · 0 评论 -
Unity中 Animation Clip中添加属性 被锁定 无法通过脚本修改
https://forum.unity.com/threads/animator-locking-animated-value-even-when-current-state-has-no-curves-keys-for-that-value.440363/以上链接并未解决问题,因为官方从12年到现在 都不觉得这是个问题。但是实际用的时候确实非常难受,clip中用到的属性,包括setactive ,enable, position等的修改 ,在其他地方都要用到。不被脚本修改 是不现实的。当前的方案是:原创 2021-07-23 12:50:29 · 1571 阅读 · 2 评论 -
Unity anystate发生抖动的解决方法
将Can Transition To Self 勾掉原创 2021-06-21 12:36:05 · 228 阅读 · 1 评论 -
Unity 双指缩放脚本
using UnityEngine;using System.Collections;/// <summary>/// Found in /// http://unity3d.com/pt/learn/tutorials/modules/beginner/platform-specific/pinch-zoom/// Contains both perspective and orthographic stuff, in this 2D game we'll/// be usin原创 2021-05-28 14:26:28 · 438 阅读 · 0 评论 -
Unity发布Webgl 文件夹下的配置文件读取问题
这是一个PC运行时的文件访问方式,判断有无并加载即可[Serializable]public class SanguConfig : BaseConfig{ public readonly string FileName = Application.dataPath + "/SanguConfig.json"; public SanguConfig() { var item = new IdleSanguConfig().CommandsMap;原创 2021-04-30 13:03:11 · 1808 阅读 · 0 评论 -
Unity 脚本控制UI Panel的切换
以下对代码进行了注释,完整工程 在Asset Store 搜索 Unity UI Simple包含对动画的设置、状态判断 保存等using UnityEngine;using UnityEngine.UI;using UnityEngine.EventSystems;using System.Collections;using System.Collections.Generic;public class PanelManager : MonoBehaviour { /// <原创 2021-04-21 13:01:24 · 2239 阅读 · 0 评论 -
Unity UI 框架,整理Panel和Scene的部分
参考 https://www.bilibili.com/video/BV1Bz4y1D7rL?from=search&seid=5715495669300884846地址 https://gitee.com/friendlyA/XFramework.git原创 2021-04-21 11:00:17 · 282 阅读 · 0 评论 -
Unity 里的Json序列化
常用Json类JsonUtiltity: 只有 fromjson toJson两个方法可用,不能对类中的字典等复杂的字段序列化,功能很有限JsonSimple:改善一点点 ,但是还是不够使Newtonsoft:好很多,对字典可以很好 保存,对父类的公共字段也可以,所以以后主要用用这个哟...原创 2021-04-20 15:43:48 · 305 阅读 · 0 评论 -
Unity 遮罩和滑动显示的实现
遮罩生效原创 2021-04-19 10:13:26 · 493 阅读 · 0 评论 -
unity中mathf.Lerp的运用
用于插值,待补充原创 2021-04-17 16:16:20 · 584 阅读 · 0 评论 -
Unity 动画状态机 动画结构形成一个环状,依次给相应的条件执行,最后回到循环最初
状态之间形成一个环,要做到按顺序执行后,回到Idle进行下一轮次的判断。问题出现在最后回到idle的transition处。为了让动画立即执行,所有transition取消了 “has exit time”这里要明确的概念是,中断的current state/next state 是对自身状态 和连线的下一个动画而言的current state 下Ordered Interruption 选中例如 A-B A-C A-D 这个顺序的转换A...原创 2021-04-15 16:28:11 · 560 阅读 · 0 评论 -
Unity 使用RabbitMq的工程
https://gitee.com/hhhhaxx/unity-rabbit-mq-test1 工程内包含了 所使用的 RabbitMq.Client.dll2 解决 发布程序 Null Reference Supported 的问题3 简单测试原创 2021-03-29 11:36:00 · 952 阅读 · 0 评论 -
Unity 使用RabbitMq导出应用程序后报错 NullReferenceException: Object reference not set to an instance of an obje
将以下位置修改成 .Net 4x原创 2021-03-29 11:10:14 · 405 阅读 · 0 评论 -
blender 导出动画在unity 中添加
1.使用Bender记录关键帧的方式生成动画2.保存模型为unity支持的格式3.在 unity 中导入模型4. 在模型修改时选择 animation type 为legacy5.播放动画坐标回到blender中原点,这种,可以添加一个空白物体,然后将模型挂到底下,就可以 或者将不要将第一帧设为关键帧,然后导出6....原创 2021-03-12 15:57:24 · 3999 阅读 · 0 评论 -
unity 修改天空
1.新建material2. inspector — shader —skybox—6 sided3. 给各个面提供相对应的texture4. texture 明确支持的是png格式的5. texture type 里选择Sprite 2d and ui6. 拖进各个面即可原创 2021-03-12 10:24:45 · 444 阅读 · 0 评论 -
Unity内 旋转物体 若旋转中心不对应时,应在模型修改 将原点设置到几何中心
Unity 修改物体原点的方法。原创 2021-03-11 15:46:16 · 823 阅读 · 0 评论 -
Unity 速度过快 碰撞检查失效的问题总结
1. 碰撞检查要求 其中一方必须是刚体,但都要求添加碰撞属性。两者都是刚体的时候,参数选择会有不同2. 黑方块是 刚体 box collider, 左墙是刚体 box collider,右墙是非刚体 box collider5. 右墙只有collider3.黑块的设置,是连续检查;当碰撞右墙时直接被阻挡4. 左墙的设置为动态检查。设置成其他的,在速度更快时,检查仍然失效...原创 2021-03-11 08:29:49 · 1983 阅读 · 0 评论 -
Unity导出 Webgl托管报JavaScript 错误
保存 web.config 到index.html 所在文件夹下<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer> <staticContent> <remove fileExtension=".mem" /> <remove fileExtension=".data" /> <remo原创 2021-03-10 15:14:28 · 181 阅读 · 0 评论 -
Unity 取消两个刚体的碰撞检查
1.选择物体2.修改原创 2021-03-10 15:01:35 · 1967 阅读 · 0 评论 -
Unity 鼠标滚轮缩放 拖动移动视角
using System.Collections;using System.Collections.Generic;using UnityEngine;public class cameraMove : MonoBehaviour{ public enum RotationAxes { MouseXAndY = 0, MouseX = 1, MouseY = 2 } public RotationAxes m_axe原创 2021-03-09 16:35:09 · 1383 阅读 · 0 评论 -
Unity碰撞检查 自定义事件
using System;using System.Collections;using System.Collections.Generic;using UnityEngine;public class LimitEnterEventArgs : EventArgs{ public GameObject EnteredObject { get; set; } public LimitEnterEventArgs(GameObject ob) { Ente原创 2021-03-09 15:19:01 · 116 阅读 · 0 评论 -
Unity 刚体和碰撞
using System.Collections;using System.Collections.Generic;using UnityEngine;public class NewBehaviourScript : MonoBehaviour{ public GameObject GameObject; public float Speed { get; set; } = 0.01f; void Start() { ...原创 2021-03-09 08:54:12 · 142 阅读 · 0 评论 -
Unity 移动视角,回原点
using System.Collections;using System.Collections.Generic;using UnityEngine;public class MoveCamera : MonoBehaviour{ // Start is called before the first frame update void Start() { if(myCube!= null) homeVec = myCube.t.原创 2021-02-24 09:39:43 · 1955 阅读 · 0 评论 -
Unity3d 脚本控制目标的旋转缩放移动
1.目标显示太小或角度问题要调整相机2.脚本要关联到Mian Camera上3.将 Cube 拖到Scrip的Cube里using System.Collections;using System.Collections.Generic;using UnityEngine;public class MyScript : MonoBehaviour{ // Start is called before the first frame update void Start()原创 2021-02-22 16:49:42 · 1032 阅读 · 0 评论 -
Unity3d 动态添加控件
using System.Collections;using System.Collections.Generic;using UnityEngine;using System;public class Createprimitive : MonoBehaviour{ // Start is called before the first frame update void Start() { } private void OnGUI() {原创 2021-02-22 16:04:18 · 361 阅读 · 0 评论 -
Unity3d GetComponent和 GetComponentInChildren
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;using UnityEngine.Events;public class MainMenuq : MonoBehaviour{ void Start() { List<string> names = new List<string>();原创 2021-02-22 15:33:42 · 803 阅读 · 0 评论