资源简介
DaLianZhiYiKeJi-roomgame-master.zip
代码片段和文件信息
//This script will only work in editor mode. You cannot adjust the scale dynamically in-game!
using UnityEngine;
using UnityEditor;
#if UNITY_EDITOR
#endif
namespace Assets.scripts.Common.Utils
{
[ExecuteInEditMode]
public class ParticleScaler : MonoBehaviour
{
public float particleScale = 1.0f;
public bool alsoScaleGameobject = true;
float prevScale;
void Start()
{
prevScale = particleScale;
}
void Update ()
{
#if UNITY_EDITOR
//check if we need to update
if (prevScale != particleScale && particleScale > 0)
{
if (alsoScaleGameobject)
transform.localScale = new Vector3(particleScale particleScale particleScale);
float scaleFactor = particleScale / prevScale;
//scale legacy particle systems
ScaleLegacySystems(scaleFactor);
//scale shuriken particle systems
ScaleShurikenSystems(scaleFactor);
//scale trail renders
ScaleTrailRenderers(scaleFactor);
prevScale = particleScale;
}
#endif
}
void ScaleShurikenSystems(float scaleFactor)
{
#if UNITY_EDITOR
//get all shuriken systems we need to do scaling on
ParticleSystem[] systems = GetComponentsInChildren();
foreach (ParticleSystem system in systems)
{
system.startSpeed *= scaleFactor;
system.startSize *= scaleFactor;
system.gravityModifier *= scaleFactor;
Serializedobject so = new Serializedobject(system);
so.FindProperty(“VelocityModule.x.scalar“).floatValue *= scaleFactor;
so.FindProperty(“VelocityModule.y.scalar“).floatValue *= scaleFactor;
so.FindProperty(“VelocityModule.z.scalar“).floatValue *= scaleFactor;
so.FindProperty(“ClampVelocityModule.magnitude.scalar“).floatValue *= scaleFactor;
so.FindProperty(“ClampVelocityModule.x.scalar“).floatValue *= scaleFactor;
so.FindProperty(“ClampVelocityModule.y.scalar“).floatValue *= scaleFactor;
so.FindProperty(“ClampVelocityModule.z.scalar“).floatValue *= scaleFactor;
so.FindProperty(“ForceModule.x.scalar“).floatValue *= scaleFactor;
so.FindProperty(“ForceModule.y.scalar“).floatValue *= scaleFactor;
so.FindProperty(“ForceModule.z.scalar“).floatValue *= scaleFactor;
so.FindProperty(“ColorBySpeedModule.range“).vector2Value *= scaleFactor;
so.FindProperty(“SizeBySpeedModule.range“).vector2Value *= scaleFactor;
so.FindProperty(“RotationBySpeedModule.range“).vector2Value *= scaleFactor;
so.ApplyModifiedProperties();
}
#endif
}
void ScaleLegacySystems(float scaleFactor)
{
#if UNITY_EDITOR
//get all emitters we need to do scaling on
ParticleEmitter[] emitters = GetComponentsInChildren();
//get all animators we need to do scaling on
ParticleAnimator[] animators = GetComponentsInChildren();
//apply scaling to emitters
foreach (ParticleEmitter emitter in emitters)
{
emitter.minSize *= scaleFactor;
emitter.maxSize *= scaleFactor;
emi
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-06-26 10:15 roomgame\
文件 89133 2019-06-26 10:15 roomgame\.gitignore
目录 0 2019-06-26 10:15 roomgame\Assets\
文件 191 2019-06-26 10:15 roomgame\Assets\AutoFile.me
目录 0 2019-06-26 10:15 roomgame\Assets\AutoFile\
文件 2848 2019-06-26 10:15 roomgame\Assets\AutoFile\DefualtIcon.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\DefualtIcon.png.me
文件 191 2019-06-26 10:15 roomgame\Assets\AutoFile\Icons.me
文件 191 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages.me
目录 0 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\
文件 70 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_0.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_0.png.me
文件 70 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_1.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_1.png.me
文件 70 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_2.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_2.png.me
文件 70 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_3.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_3.png.me
文件 70 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_4.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_4.png.me
文件 70 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_5.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_5.png.me
文件 70 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_6.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_6.png.me
文件 70 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_7.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_7.png.me
文件 70 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_8.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImages\SplashImg_8.png.me
文件 2848 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImg.png
文件 1261 2019-06-26 10:15 roomgame\Assets\AutoFile\SplashImg.png.me
文件 191 2019-06-26 10:15 roomgame\Assets\AutoFile\ziptemp.me
............此处省略3140个文件信息
- 上一篇:opencv for qt5.8
- 下一篇:京瓷4125维修手册
相关资源
- 矩阵分析-史荣昌.rar
- ccleaner-清理器-5.46.rar
- teamviewer_11.0.55321破解企业版任意换I
- GPS原理与应用第二版-寇艳红.pdf
- duoqy.part3.rar
- Sysprogs破解.zip
- BPM技术的理论、规范、模式及最佳实
- ZenTaoPMS.8.1.3.zbox_64.tar.gz
- setup_proteus_v75sp3.part2.rar
- Natural_Language_Processing_with_PyTorch.pdf
- StrapdownInertialNavigaitonTechnology(2ndEdi
- StrapdownInertialNavigationTechnology_2ED.pdf
- 鲁棒控制课件.zip
- 1ax62l.rar
- Cass加密.rar
- 开关电源实用技术热设计、电磁兼容
- 雷顿网络验证.rar
- Hex-Rays.IDA.Pro.Advanced.v6.1.Windows.incl.He
- SI4安装及破解文件.zip
- 归档(1).zip
- gpupro7-phone.7z
- 计算机程序的构造和解释中文版.pdf
- Git-2.20.0-64-bit.zip
- IDM.zip
- C必知必会.pdf
- 19536823GB∕T36325-2018信息技术云计算云
- 56Classi.png
- ventsim中文版.zip
- yz2zcx_10382219.zip
- 保密检查工具简化版.iso
评论
共有 条评论