随笔分类 - Unity
摘要:样例 1: 样例 2: 参考了网上一个大神的体积光shader, 增加了光线的线性衰减和地面接受光源。 Light : Shader "Hidden/VertexVolumetricLight" { Properties { } SubShader { Tags { "RenderType" = "
阅读全文
摘要:using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; using System; using System.IO; using ICSharpCode.Sha
阅读全文
摘要:base http protocal & Loom using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Text;using UnityEngine;using S
阅读全文
摘要:根据父节点计算子节点位置,实现类似挂在父节点下效果,未实现缩放 using UnityEngine; public class Test : MonoBehaviour { public Transform m_Father; public Transform m_Child; Vector3 m_
阅读全文
摘要:想使用Animation曲线制作变速移动, 需要 当前曲线下面积/曲线总面积 获取当前移动进度,在网上找到了unity animationCurve的实现代码,修改后做积分可以求得面积代码如下:public float AreaUnderCurve(AnimationCurve curve, float w, float h) { var areaUnderCurve = ...
阅读全文
摘要:在项目中想模仿unity 官方的demo做角色的移动,混合树建好了动画也导入了,但是左右转向动画之间过渡时会有抽搐,做了以下操作,基本还原官方demo的感觉。 1. 勾选loop pose . (Loop Pose 用于控制动画循环播放时,从结束帧切换到起始帧时,动画的动作可以无缝的衔接上,Cycl
阅读全文
摘要:using System.Collections; using System.Collections.Generic; using UnityEngine; public class CreateMesh : MonoBehaviour { public Material m_HexMaterial; List m_CenterList; List m_M...
阅读全文
摘要:今天想要用代码修改Fbx导入动画的设置,但是ModelImporter.clipAnimations设置maskType为Create from model后一直有报错,无奈自己想了个解决办法。 由于我们动画采用同一套骨骼,所以maskType设置完成后动画meta文件中transformMask内
阅读全文
摘要:最近项目中有大量的动画需要在unity中查看,自己一个个托太麻烦,写了段代码自动生成。
阅读全文
摘要:项目中大量用到了PlayableBehaviour,而PlayableBehaviour中的参数是由PlayableAsset传递进去的,因为参数比较复杂同时需要一些控制选项所以定制了Inspector中的显示。 方法其实和一般定制其他类的方法相同。
阅读全文
摘要:效果如图: 思路: 主要问题在于生成随机控制点。 1. 以start -> end 为z轴建立坐标系,获得 x_Axis, y_Axis, z_Axis 2.以z轴方向随机长度, x轴y轴随机所在位置 3.用贝塞尔曲线公式生成曲线
阅读全文
摘要:最近需要通过配置表生成Timeline,自己测试通过,代码如下:
阅读全文

浙公网安备 33010602011771号