资源简介
主要是用于初学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#绘制折线图实时展示数据
相关资源
- Socket网络模块Unity c#
- Unity 3D《魔兽》动作类回合制游戏源码
- 《Unity5实战使用C#和Unity开发多平台游
- Unity5实战:使用C#和Unity开发多平台游
- Untiy官方资源Car主控脚本CarController全
- unity3D 根据UI适配摄像机Rect值,完美解
- unity 赛车race手游开发教程视频[MP4]
- Unity GameView相机移动和旋转脚本
- Unity Windows Speech
- Unity3D场景中画线脚本
- 《Unity5实战使用C#和Unity开发多平台游
- Unity5麦克风录音Record MicroPhone Audio 更
- Unity麦克风录音Record MicroPhone Audio
- Unity测距脚本
- 一套类moba的教学视频百度云地址
- Unity网络正常状态下优先加载网络图片
- Unity3D虚拟现实开发之标签跟随功能
- Unity面试题30题含答案——C#基础.
- unity模型贴图滚动脚本
- 跑酷游戏源码
- unity3d 连接外置摄像头
-
Js to CSharp sc
ript converter - unity上传文件7牛云存储服务器
- 鱼类游动代码
- unity旋转,缩放,移动控制脚本
- unity旧粒子系统转换为新粒子系统
- MoveCamera.cs
- Unity3D场景中对模型旋转放大缩小脚本
- unity3d实现物体透明渐变效果
- 使用C#在Unity中制作VR游戏
评论
共有 条评论