资源简介
主要是用于初学unity用的,此篇unity的脚本使用C#实现的,gensui.cs脚本是放在摄像机上面的,Player....cs是放在第一人称的人物上的
代码片段和文件信息
using UnityEngine;
using System;
using UnityEditor;
[CustomEditor(typeof(GerstnerDisplace))]
public class GerstnerDisplaceEditor : Editor
{
private Serializedobject serObj;
public void OnEnable ()
{
serObj = new Serializedobject (target);
}
public override void OnInspectorGUI ()
{
serObj.Update();
Gameobject go = ((GerstnerDisplace)serObj.targetobject).gameobject;
Waterbase wb = (Waterbase)go.GetComponent(typeof(Waterbase));
Material sharedWaterMaterial = wb.sharedMaterial;
GUILayout.Label (“Animates vertices using up 4 generated waves“ Editorstyles.miniBoldLabel);
if(sharedWaterMaterial)
{
Vector4 amplitude = WaterEditorUtility.GetMaterialVector(“_GAmplitude“ sharedWaterMaterial);
Vector4 frequency = WaterEditorUtility.GetMaterialVector(“_GFrequency“ sharedWaterMaterial);
Vector4 steepness = WaterEditorUtility.GetMaterialVector(“_GSteepness“ sharedWaterMaterial);
Vector4 speed = WaterEditorUtility.GetMaterialVector(“_GSpeed“ sharedWaterMaterial);
Vector4 directionAB = WaterEditorUtility.GetMaterialVector(“_GDirectionAB“ sharedWaterMaterial);
Vector4 directionCD = WaterEditorUtility.GetMaterialVector(“_GDirectionCD“ sharedWaterMaterial);
amplitude = EditorGUILayout.Vector4Field(“Amplitude (Height offset)“ amplitude);
frequency = EditorGUILayout.Vector4Field(“Frequency (Tiling)“ frequency);
steepness = EditorGUILayout.Vector4Field(“Steepness“ steepness);
speed = EditorGUILayout.Vector4Field(“Speed“ speed);
directionAB = EditorGUILayout.Vector4Field(“Direction scale (Wave 1 (XY) and 2 (ZW))“ directionAB);
directionCD = EditorGUILayout.Vector4Field(“Direction scale (Wave 3 (XY) and 4 (ZW))“ directionCD);
if (GUI.changed) {
WaterEditorUtility.SetMaterialVector(“_GAmplitude“ amplitude sharedWaterMaterial);
WaterEditorUtility.SetMaterialVector(“_GFrequency“ frequency sharedWaterMaterial);
WaterEditorUtility.SetMaterialVector(“_GSteepness“ steepness sharedWaterMaterial);
WaterEditorUtility.SetMaterialVector(“_GSpeed“ speed sharedWaterMaterial);
WaterEditorUtility.SetMaterialVector(“_GDirectionAB“ directionAB sharedWaterMaterial);
WaterEditorUtility.SetMaterialVector(“_GDirectionCD“ directionCD sharedWaterMaterial);
}
/*
Vector4 animationTiling = WaterEditorUtility.GetMaterialVector(“_AnimationTiling“ sharedWaterMaterial);
Vector4 animationDirection = WaterEditorUtility.GetMaterialVector(“_AnimationDirection“ sharedWaterMaterial);
float firstTilingU = animationTiling.x*100.0F;
float firstTilingV = animationTiling.y*100.0F;
float firstDirectionU = animationDirection.x;
float firstDirectionV = animationDirection.y;
float secondTilingU = animationTiling.z*100.0F;
float secondTilingV = animationTiling.w*100.0F;
float secondDirectionU = animationDirection.z;
float secondDirectionV = animationDirection.w;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-04-07 22:31 movesth\
目录 0 2019-03-26 22:43 movesth\.vs\
目录 0 2019-03-26 22:43 movesth\.vs\movesth-csharp\
目录 0 2019-03-26 22:53 movesth\.vs\movesth-csharp\v14\
文件 64512 2019-04-07 22:23 movesth\.vs\movesth-csharp\v14\.suo
文件 14091 2019-03-26 22:53 movesth\Assembly-Boo-firstpass-vs.booproj
文件 14091 2019-03-26 22:53 movesth\Assembly-Boo-firstpass.booproj
文件 15185 2019-03-26 22:43 movesth\Assembly-CSharp-Editor-vs.csproj
文件 15245 2019-03-26 22:43 movesth\Assembly-CSharp-Editor.csproj
文件 16684 2019-03-29 08:48 movesth\Assembly-CSharp-firstpass-vs.csproj
文件 16684 2019-03-29 08:48 movesth\Assembly-CSharp-firstpass.csproj
文件 15800 2019-03-26 22:43 movesth\Assembly-Unitysc
文件 15860 2019-03-26 22:43 movesth\Assembly-Unitysc
文件 17443 2019-03-26 22:43 movesth\Assembly-Unitysc
文件 17443 2019-03-26 22:43 movesth\Assembly-Unitysc
文件 15444 2019-03-26 22:43 movesth\Assembly-Unitysc
文件 15471 2019-03-26 22:43 movesth\Assembly-Unitysc
目录 0 2019-03-29 09:21 movesth\Assets\
目录 0 2019-03-26 17:11 movesth\Assets\Editor\
文件 107 2019-03-26 17:08 movesth\Assets\Editor.me
目录 0 2019-03-26 17:08 movesth\Assets\Editor\Image Effects\
文件 107 2019-03-26 17:08 movesth\Assets\Editor\Image Effects.me
文件 2410 2014-06-11 05:51 movesth\Assets\Editor\Image Effects\AntialiasingAsPostEffectEditor.js
文件 178 2019-03-26 17:08 movesth\Assets\Editor\Image Effects\AntialiasingAsPostEffectEditor.js.me
文件 6823 2014-06-11 05:51 movesth\Assets\Editor\Image Effects\BloomAndLensFlaresEditor.js
文件 178 2019-03-26 17:08 movesth\Assets\Editor\Image Effects\BloomAndLensFlaresEditor.js.me
文件 7024 2014-06-11 05:51 movesth\Assets\Editor\Image Effects\BloomEditor.js
文件 178 2019-03-26 17:08 movesth\Assets\Editor\Image Effects\BloomEditor.js.me
文件 3894 2014-06-11 05:51 movesth\Assets\Editor\Image Effects\CameraMotion
文件 178 2019-03-26 17:08 movesth\Assets\Editor\Image Effects\CameraMotion
文件 5090 2014-06-11 05:51 movesth\Assets\Editor\Image Effects\ColorCorrectionCurvesEditor.js
............此处省略2632个文件信息
- 上一篇:ASP.NET Core应用开发
- 下一篇:C#绘制折线图实时展示数据
相关资源
- unity+Socket+KCP+Protobuf的Unity局域网联机
- AssetStudio V0.16.0 源代码 使用VS2019
- Unity摄像机分辨率自适应设计尺寸脚本
- unity 2d-extras-master插件
- polyvav2D-1.5.2_BehaviorDesigner.unitypackage
- unity读取Excel
- 软键盘(Package_KeyBoard.unitypackage)
- unity5圣典中文API手册v0.02.chm
- Unity 房间游览
- 百塞尔曲线粒子插件(.unitypackage)
- 皮带传送、齿轮unity
- unity3d脚本学习教程
- Unity日历插件
- Unity5实战:使用C#和Unity开发多平台游
- Unity5.0切水果游戏C#
- Unity2D小游戏——炸弹人类似qq堂的小
- 俄罗斯方框UNITY项目案例包含代码
- unity 键鼠控制摄像机移动 脚本
- Unity通过TCP接收服务端数据
- Unity和C#实现TCP网络聊天
- 愤怒的小鸟unity3d279320
- Unity in Action: Multiplatform Game Developmen
- unity开发贪吃蛇
- snake vs blocks 素材和源码
- PureMVC for Unity3d Demo
- unity编辑器源代码.zip
- unity迷你太空射击游戏源码
- System.web源码C#
- Unity3dMYO肌电臂环二次开发例程(保证
- Unity 3D Paint in 3D 最新版(1.56)
评论
共有 条评论