void Start() { // Object References transf = this.transform; if (GameObject.Find("SUIMONO_Module")) { moduleObject = (Suimono.Core.SuimonoModule)FindObjectOfType(typeof(Suimono.Core.SuimonoModule)); if (moduleObject != null) { fxObject = moduleObject.suimonoModuleLibrary.fxObject; } } //populate system names if (fxObject != null) { sysNames = fxObject.sysNames; } //set random randSeed = System.Environment.TickCount; fxRand = new Suimono.Core.Random(randSeed); //run update loop at set FPS interval staggerOffset++; stagger = (staggerOffset + 0f) * 0.05f; staggerOffset = staggerOffset % staggerModulus; InvokeRepeating("SetUpdate", 0.1f + stagger, (1.0f / 30.0f)); }
void Awake() { //get Suimono Specific Objects suimonoGameObject = GameObject.Find("SUIMONO_Module"); if (suimonoGameObject != null) { suimonoModuleObject = suimonoGameObject.GetComponent <Suimono.Core.SuimonoModule>(); } targetPosition = cameraTarget.position; targetRotation = cameraTarget.rotation; if (cameraTarget != null) { targetAnimator = cameraTarget.gameObject.GetComponent <sui_demo_animCharacter>(); } if (buoyancyTarget != null) { buoyancyObject = buoyancyTarget.GetComponent <Suimono.Core.fx_buoyancy>(); } MC = this.gameObject.GetComponent <sui_demo_ControllerMaster>() as sui_demo_ControllerMaster; IC = this.gameObject.GetComponent <sui_demo_InputController>() as sui_demo_InputController; }
void Start() { // Object References if (GameObject.Find("SUIMONO_Module")) { moduleObject = GameObject.Find("SUIMONO_Module").GetComponent <Suimono.Core.SuimonoModule>() as SuimonoModule; if (moduleObject != null) { fxObject = moduleObject.fxObject; } } //populate system names if (fxObject != null) { sysNames = fxObject.sysNames; } //set random randSeed = System.Environment.TickCount; fxRand = new Suimono.Core.Random(randSeed); //run update loop at set FPS interval staggerOffset++; stagger = (staggerOffset + 0f) * 0.05f; staggerOffset = staggerOffset % staggerModulus; InvokeRepeating("SetUpdate", 0.1f + stagger, (1.0f / 30.0f)); }
void Start() { //get master objects moduleObject = GameObject.Find("SUIMONO_Module").GetComponent <Suimono.Core.SuimonoModule>(); causticObject = GameObject.Find("_caustic_effects").GetComponent <Suimono.Core.fx_causticModule>(); lightComponent = GetComponent <Light>(); }
void Start() { //Get object references if (GameObject.Find("SUIMONO_Module") != null) { suimonoModuleObject = GameObject.Find("SUIMONO_Module").gameObject.GetComponent <Suimono.Core.SuimonoModule>(); } if (cameraType != suiCamToolType.localReflection) { if (transform.parent != null) { surfaceRenderer = transform.parent.gameObject.GetComponent <Renderer>(); } } else { if (transform.parent != null) { surfaceRenderer = transform.parent.Find("Suimono_Object").gameObject.GetComponent <Renderer>(); scaleRenderer = transform.parent.Find("Suimono_ObjectScale").gameObject.GetComponent <Renderer>(); } } cam = gameObject.GetComponent <Camera>() as Camera; if (suimonoModuleObject != null && suimonoModuleObject.setCamera != null) { copyCam = suimonoModuleObject.setCamera.GetComponent <Camera>(); } UpdateRenderTex(); CameraUpdate(); }
void Start() { cam = gameObject.GetComponent <Camera>(); camtr = cam.transform; if (GameObject.Find("SUIMONO_Module") != null) { moduleObject = (Suimono.Core.SuimonoModule)FindObjectOfType(typeof(Suimono.Core.SuimonoModule)); moduleLibrary = (SuimonoModuleLib)FindObjectOfType(typeof(SuimonoModuleLib)); //moduleLibrary = GameObject.Find("SUIMONO_Module").GetComponent<SuimonoModuleLib>(); } if (moduleLibrary != null) { distortTex = moduleLibrary.texNormalC; //mask1Tex = moduleLibrary.texHeightC; mask2Tex = moduleLibrary.texDrops; } randSeed = System.Environment.TickCount; dropRand = new Suimono.Core.Random(randSeed); fogShader = Shader.Find("Hidden/SuimonoUnderwaterFog"); fogMaterial = new Material(fogShader); }
void Start() { //Get object references suimonoModuleObject = (Suimono.Core.SuimonoModule)FindObjectOfType(typeof(Suimono.Core.SuimonoModule)); if (cameraType != suiCamToolType.localReflection) { if (transform.parent != null) { surfaceRenderer = transform.parent.gameObject.GetComponent <Renderer>(); } } else { if (transform.parent != null) { surfaceRenderer = transform.parent.Find("Suimono_Object").gameObject.GetComponent <Renderer>(); scaleRenderer = transform.parent.Find("Suimono_ObjectScale").gameObject.GetComponent <Renderer>(); } } cam = gameObject.GetComponent <Camera>() as Camera; SetCopyCamera(); //if (suimonoModuleObject != null && suimonoModuleObject.setCamera != null){ // copyCam = suimonoModuleObject.setCamera.GetComponent<Camera>(); //} UpdateRenderTex(); CameraUpdate(); }
void Start() { //set objects fxParentObject = this.transform.Find("_particle_effects"); moduleObject = (Suimono.Core.SuimonoModule)FindObjectOfType(typeof(Suimono.Core.SuimonoModule)); //instantiate systems if (Application.isPlaying) { if (effectsSystems.Length > 0 && fxParentObject != null) { var instPos = new Vector3(transform.position.x, -10000.0f, transform.position.z); fxObjects = new Transform[effectsSystems.Length]; fxParticles = new ParticleSystem[effectsSystems.Length]; for (int fx = 0; fx < (effectsSystems.Length); fx++) { var fxObjectPrefab = Instantiate(effectsSystems[fx], instPos, transform.rotation) as Transform; fxObjectPrefab.transform.parent = fxParentObject.transform; fxObjects[fx] = (fxObjectPrefab); fxParticles[fx] = fxObjectPrefab.gameObject.GetComponent <ParticleSystem>(); } } } //do clamp checks at 6fps staggerOffset++; stagger = (staggerOffset + 0f) * 0.05f; staggerOffset = staggerOffset % staggerModulus; var clampSpeed = 1.0f / 4.0f; InvokeRepeating("ClampSystems", 0.15f + stagger, clampSpeed); InvokeRepeating("UpdateSystems", 0.2f + stagger, 1.0f); }
void Start() { //DISCONNECT FROM PREFAB #if UNITY_EDITOR #if !UNITY_2018_3_OR_NEWER PrefabUtility.DisconnectPrefabInstance(this.gameObject); #endif #endif //turn off debig at start if (Application.isPlaying) { debug = false; } //get main object if (GameObject.Find("SUIMONO_Module") != null) { moduleObject = (Suimono.Core.SuimonoModule)FindObjectOfType(typeof(Suimono.Core.SuimonoModule)); suimonoVersionNumber = moduleObject.suimonoVersionNumber; } //setup camera CamInfo = transform.Find("cam_LocalShore").gameObject.GetComponent <Camera>(); CamInfo.depthTextureMode = DepthTextureMode.DepthNormals; CamTools = transform.Find("cam_LocalShore").gameObject.GetComponent <Suimono.Core.cameraTools>() as Suimono.Core.cameraTools; CamDepth = transform.Find("cam_LocalShore").gameObject.GetComponent <Suimono.Core.SuimonoCamera_depth>() as Suimono.Core.SuimonoCamera_depth; //setup renderer renderObject = gameObject.GetComponent <Renderer>() as Renderer; meshObject = gameObject.GetComponent <MeshFilter>() as MeshFilter; //find parent surface if (transform.parent) { if (transform.parent.gameObject.GetComponent <Suimono.Core.SuimonoObject>() != null) { attachToSurface = transform.parent; } } //turn on surface if (attachToSurface != null) { attachToSurface.Find("Suimono_Object").gameObject.GetComponent <Renderer>().enabled = true; } //setup material matObject = new Material(Shader.Find("Suimono2/Suimono2_FX_ShorelineObject")); renderObject.material = matObject; //set rendering flag hasRendered = false; }
void Awake() { if (GameObject.Find("SUIMONO_Module") != null) { moduleObject = GameObject.Find("SUIMONO_Module").gameObject.GetComponent <Suimono.Core.SuimonoModule>() as Suimono.Core.SuimonoModule; } if (GameObject.Find("SUIMONO_Surface_Ocean") != null) { oceanObject = GameObject.Find("SUIMONO_Surface_Ocean").gameObject.GetComponent <Suimono.Core.SuimonoObject>() as Suimono.Core.SuimonoObject; } }
void Start() { //get master object moduleObject = GameObject.Find("SUIMONO_Module").GetComponent <Suimono.Core.SuimonoModule>(); //get caustic light object if (moduleObject != null) { causticLight = moduleObject.causticObjectLight; } }
void Start() { //get master object moduleObject = (Suimono.Core.SuimonoModule)FindObjectOfType(typeof(Suimono.Core.SuimonoModule)); //get caustic light object if (moduleObject != null) { causticLight = moduleObject.suimonoModuleLibrary.causticObjectLight; } }
void Start() { //get main object lightObject = GameObject.Find("Directional Light").GetComponent <Transform>(); suimonoModule = GameObject.Find("SUIMONO_Module").GetComponent <Suimono.Core.SuimonoModule>(); suimonoObject = GameObject.Find("SUIMONO_Surface").GetComponent <Suimono.Core.SuimonoObject>(); uiCanvasScale = this.transform.GetComponent <CanvasScaler>(); //find UI objects textVersion = GameObject.Find("Text_version").GetComponent <Text>(); sliderTOD = GameObject.Find("Slider_TOD").GetComponent <Slider>(); sliderBeaufort = GameObject.Find("Slider_Beaufort").GetComponent <Slider>(); }
void Awake() { //get Suimono Specific Objects suimonoGameObject = GameObject.Find("SUIMONO_Module"); if (suimonoGameObject != null) { suimonoModuleObject = suimonoGameObject.GetComponent <Suimono.Core.SuimonoModule>(); } targetPosition = cameraTarget.position; targetRotation = cameraTarget.rotation; MC = this.gameObject.GetComponent <sui_demo_ControllerMaster>() as sui_demo_ControllerMaster; IC = this.gameObject.GetComponent <sui_demo_InputController>() as sui_demo_InputController; }
void Start() { if (GameObject.Find("SUIMONO_Module") != null) { moduleObject = (Suimono.Core.SuimonoModule)FindObjectOfType(typeof(Suimono.Core.SuimonoModule)); } //set random randSeed = System.Environment.TickCount; buyRand = new Suimono.Core.Random(randSeed); //get number of buoyant objects if (applyToParent) { var buoyancyObjects = transform.parent.gameObject.GetComponentsInChildren <fx_buoyancy>(); if (buoyancyObjects != null) { splitFac = 1f / buoyancyObjects.Length; } } //set physics target if (applyToParent) { physTarget = this.transform.parent.transform; if (physTarget != null) { if (rigidbodyComponent == null) { rigidbodyComponent = physTarget.GetComponent <Rigidbody>(); } } } else { physTarget = this.transform; if (physTarget != null) { if (rigidbodyComponent == null) { rigidbodyComponent = GetComponent <Rigidbody>(); } } } }
void LateUpdate() { //get objects while in editor mode #if UNITY_EDITOR if (!Application.isPlaying) { if (moduleObject == null) { if (GameObject.Find("SUIMONO_Module")) { moduleObject = GameObject.Find("SUIMONO_Module").GetComponent <Suimono.Core.SuimonoModule>() as Suimono.Core.SuimonoModule; } } } #endif if (!Application.isPlaying) { sysNames = new List <string>(); sysNames.Add("None"); for (sN = 0; sN < effectsSystems.Length; sN++) { setName = "---"; if (effectsSystems[sN] != null) { setName = effectsSystems[sN].transform.name; } for (s = 0; s < sN; s++) { setName += " "; } sysNames.Add(setName); } } }
private void Start() { moduleObject = GameObject.Find("SUIMONO_Module").gameObject.GetComponent <Suimono.Core.SuimonoModule>(); }
void Start() { #if UNITY_EDITOR moduleObject = (Suimono.Core.SuimonoModule)FindObjectOfType(typeof(Suimono.Core.SuimonoModule)); #endif }
void Start() { //get master objects moduleObject = (Suimono.Core.SuimonoModule)FindObjectOfType(typeof(Suimono.Core.SuimonoModule)); lightObject = transform.Find("mainCausticObject").gameObject; }
void Start() { #if UNITY_EDITOR moduleObject = GameObject.Find("SUIMONO_Module").GetComponent <Suimono.Core.SuimonoModule>(); #endif }
void SetUpdate() { if (moduleObject != null) { //Cache Time for performance _deltaTime = Time.deltaTime; //check for action timing actionPass = false; if (actionIndex == 0 && actionCount < 1) { actionPass = true; } if (actionIndex == 2 && actionCount < actionNum) { actionPass = true; } if (actionIndex == 1) { actionPass = true; } if (actionCount > 0 && (actionIndex == 0 || actionIndex == 2)) { actionTimer += _deltaTime; if (actionTimer > actionReset && actionReset > 0f) { actionCount = 0; actionTimer = 0f; } } //set Random if (fxRand == null) { fxRand = new Suimono.Core.Random(randSeed); } //get objects while in editor mode #if UNITY_EDITOR if (!Application.isPlaying) { if (moduleObject == null) { if (GameObject.Find("SUIMONO_Module")) { moduleObject = GameObject.Find("SUIMONO_Module").GetComponent <Suimono.Core.SuimonoModule>() as Suimono.Core.SuimonoModule; fxObject = moduleObject.fxObject; } } } #endif if (Application.isPlaying) { //calculate camera distance if (moduleObject.setTrack != null) { currentCamDistance = Vector3.Distance(this.transform.position, moduleObject.setTrack.transform.position); if (currentCamDistance <= effectDistance) { //track position / speed if (savePos != this.transform.position) { currentSpeed = Vector3.Distance(savePos, new Vector3(this.transform.position.x, this.transform.position.y, this.transform.position.z)) / _deltaTime; } savePos = this.transform.position; // track timers and emit timerParticle += _deltaTime; timerAudio += _deltaTime; EmitFX(); if (timerAudio > audioSpeed) { timerAudio = 0f; EmitSoundFX(); } } } } } }
void Start() { //get master objects moduleObject = GameObject.Find("SUIMONO_Module").GetComponent <Suimono.Core.SuimonoModule>(); lightObject = transform.Find("mainCausticObject").gameObject; }
public override void OnInspectorGUI() { //bool isPro = true; //bool showErrors = false; //bool showUnderwater = false; Color colorEnabled = new Color(1.0f, 1.0f, 1.0f, 1.0f); Color colorDisabled = new Color(1.0f, 1.0f, 1.0f, 0.25f); //Color colorWarning = new Color(0.9f,0.5f,0.1f,1.0f); Texture logoTexb; Texture divTex; //Texture divRevTex; //Texture divVertTex; Texture divHorizTex; //bool showCaustic = false; int verAdd = 0; Suimono.Core.SuimonoModule script = (Suimono.Core.SuimonoModule)target; Undo.RecordObject(target, "Changed Area Of Effect"); //load textures logoTexb = Resources.Load("textures/gui_tex_suimonologob") as Texture; divTex = Resources.Load("textures/gui_tex_suimonodiv") as Texture; //divRevTex = Resources.Load("textures/gui_tex_suimonodivrev") as Texture; //divVertTex = Resources.Load("textures/gui_tex_suimono_divvert") as Texture; divHorizTex = Resources.Load("textures/gui_tex_suimono_divhorz") as Texture; #if UNITY_PRO_LICENSE divTex = Resources.Load("textures/gui_tex_suimonodiv") as Texture; logoTexb = Resources.Load("textures/gui_tex_suimonologob") as Texture; #else divTex = Resources.Load("textures/gui_tex_suimonodiv_i") as Texture; logoTexb = Resources.Load("textures/gui_tex_suimonologob_i") as Texture; #endif //int setWidth = Screen.width-220; //if (setWidth < 120) setWidth = 120; //SET SCREEN WIDTH int setWidth = (int)EditorGUIUtility.currentViewWidth - 220; if (setWidth < 120) { setWidth = 120; } //SUIMONO LOGO GUIContent buttonText = new GUIContent(""); GUIStyle buttonStyle = GUIStyle.none; Rect rt = GUILayoutUtility.GetRect(buttonText, buttonStyle); int margin = 15; //start menu GUI.contentColor = new Color(1.0f, 1.0f, 1.0f, 0.4f); EditorGUI.LabelField(new Rect(rt.x + margin + 2, rt.y + 37, 50, 18), "Version"); GUI.contentColor = new Color(1.0f, 1.0f, 1.0f, 0.6f); Rect linkVerRect = new Rect(rt.x + margin + 51, rt.y + 37, 90, 18); EditorGUI.LabelField(linkVerRect, script.suimonoVersionNumber); //if (Event.current.type == EventType.MouseUp && linkVerRect.Contains(Event.current.mousePosition)) Application.OpenURL("http://www.tanukidigital.com/suimono/"); GUI.contentColor = new Color(1.0f, 1.0f, 1.0f, 1.0f); GUI.contentColor = new Color(1.0f, 1.0f, 1.0f, 0.4f); Rect linkHelpRect = new Rect(rt.x + margin + 165, rt.y + 37, 28, 18); Rect linkBugRect = new Rect(rt.x + margin + 165 + 42, rt.y + 37, 65, 18); Rect linkURLRect = new Rect(rt.x + margin + 165 + 120, rt.y + 37, 100, 18); if (Event.current.type == EventType.MouseUp && linkHelpRect.Contains(Event.current.mousePosition)) { Application.OpenURL("http://www.tanukidigital.com/forum/"); } if (Event.current.type == EventType.MouseUp && linkBugRect.Contains(Event.current.mousePosition)) { Application.OpenURL("http://www.tanukidigital.com/forum/"); } if (Event.current.type == EventType.MouseUp && linkURLRect.Contains(Event.current.mousePosition)) { Application.OpenURL("http://www.tanukidigital.com/suimono/"); } EditorGUI.LabelField(new Rect(rt.x + margin + 165 + 30, rt.y + 37, 220, 18), "|"); EditorGUI.LabelField(new Rect(rt.x + margin + 165 + 110, rt.y + 37, 220, 18), "|"); GUI.contentColor = new Color(1.0f, 1.0f, 1.0f, 0.4f); EditorGUI.LabelField(linkHelpRect, "help"); EditorGUI.LabelField(linkBugRect, "report bug"); EditorGUI.LabelField(linkURLRect, "tanukidigital.com"); // end menu GUI.contentColor = new Color(1.0f, 1.0f, 1.0f, 1.0f); EditorGUI.DrawPreviewTexture(new Rect(rt.x + margin, rt.y, 387, 36), logoTexb); GUILayout.Space(40.0f); rt = GUILayoutUtility.GetRect(buttonText, buttonStyle); EditorGUI.DrawPreviewTexture(new Rect(rt.x + margin, rt.y, 387, 24), divTex); verAdd = 0; GUI.contentColor = colorEnabled; GUI.Label(new Rect(rt.x + margin + 10, rt.y + 5, 300, 20), new GUIContent("CONFIGURATION")); EditorGUI.LabelField(new Rect(rt.x + margin + 10, rt.y + 25, 180, 18), "Camera Mode"); script.cameraTypeIndex = EditorGUI.Popup(new Rect(rt.x + margin + 165, rt.y + 25, 150, 18), "", script.cameraTypeIndex, script.cameraTypeOptions.ToArray()); if (script.cameraTypeIndex == 0) { GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; } EditorGUI.LabelField(new Rect(rt.x + margin + 10, rt.y + verAdd + 45, 140, 18), "Scene Camera Object"); script.manualCamera = EditorGUI.ObjectField(new Rect(rt.x + margin + 165, rt.y + verAdd + 45, setWidth, 18), "", script.manualCamera, typeof(Transform), true) as Transform; GUI.contentColor = colorEnabled; GUI.backgroundColor = colorEnabled; EditorGUI.LabelField(new Rect(rt.x + margin + 10, rt.y + verAdd + 75, 140, 18), "Scene Track Object"); script.setTrack = EditorGUI.ObjectField(new Rect(rt.x + margin + 165, rt.y + verAdd + 75, setWidth, 18), "", script.setTrack, typeof(Transform), true) as Transform; EditorGUI.LabelField(new Rect(rt.x + margin + 10, rt.y + verAdd + 95, 140, 18), "Scene Light Object"); script.setLight = EditorGUI.ObjectField(new Rect(rt.x + margin + 165, rt.y + verAdd + 95, setWidth, 18), "", script.setLight, typeof(Light), true) as Light; EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + verAdd + 120, 140, 18), "Set Automatic Layers"); script.autoSetLayers = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + verAdd + 120, 140, 18), "", script.autoSetLayers); EditorGUI.LabelField(new Rect(rt.x + margin + 220, rt.y + verAdd + 120, 140, 18), "Set Automatic FX"); script.autoSetCameraFX = EditorGUI.Toggle(new Rect(rt.x + margin + 200, rt.y + verAdd + 120, 140, 18), "", script.autoSetCameraFX); GUILayout.Space(130.0f + verAdd); rt = GUILayoutUtility.GetRect(buttonText, buttonStyle); EditorGUI.DrawPreviewTexture(new Rect(rt.x + margin, rt.y, 407, 24), divTex); script.showGeneral = EditorGUI.Foldout(new Rect(rt.x + margin + 3, rt.y + 5, 10, 20), script.showGeneral, ""); GUI.Label(new Rect(rt.x + margin + 10, rt.y + 5, 300, 20), new GUIContent("GENERAL SETTINGS")); GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 0.0f); if (GUI.Button(new Rect(rt.x + margin + 10, rt.y + 5, 370, 20), "")) { script.showGeneral = !script.showGeneral; } GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 1.0f); if (script.showGeneral) { EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 30, 140, 18), "Enable Sounds"); script.playSounds = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 30, setWidth, 18), "", script.playSounds); if (!script.playSounds) { GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; } EditorGUI.LabelField(new Rect(rt.x + margin + 10, rt.y + 50, 140, 18), "Max Sound Volume"); script.maxVolume = EditorGUI.Slider(new Rect(rt.x + margin + 165, rt.y + 50, setWidth, 18), "", script.maxVolume, 0.0f, 1.0f); GUI.contentColor = colorEnabled; GUI.backgroundColor = colorEnabled; EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 70, 160, 18), "Enable Underwater Sound"); script.playSoundBelow = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 70, 20, 18), "", script.playSoundBelow); EditorGUI.LabelField(new Rect(rt.x + margin + 220, rt.y + 70, 160, 18), "Enable Above-Water Sound"); script.playSoundAbove = EditorGUI.Toggle(new Rect(rt.x + margin + 200, rt.y + 70, 20, 18), "", script.playSoundAbove); EditorGUI.DrawPreviewTexture(new Rect(rt.x + margin + 10, rt.y + 95, 372, 1), divHorizTex); EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 100, 140, 18), "Enable Underwater FX"); script.enableUnderwaterFX = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 100, 130, 18), "", script.enableUnderwaterFX); EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 120, 140, 18), "Enable Transition FX"); script.enableTransition = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 120, 130, 18), "", script.enableTransition); EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 140, 110, 18), "Enable Interaction"); script.enableInteraction = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 140, 130, 18), "", script.enableInteraction); EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 160, 380, 18), "Disable MSAA (fixes display errors in Forward Rendering)"); script.disableMSAA = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 160, 130, 18), "", script.disableMSAA); GUILayout.Space(160.0f); } GUILayout.Space(10.0f); rt = GUILayoutUtility.GetRect(buttonText, buttonStyle); EditorGUI.DrawPreviewTexture(new Rect(rt.x + margin, rt.y, 387, 24), divTex); script.showPerformance = EditorGUI.Foldout(new Rect(rt.x + margin + 3, rt.y + 5, 10, 20), script.showPerformance, ""); GUI.Label(new Rect(rt.x + margin + 10, rt.y + 5, 300, 20), new GUIContent("ADVANCED WATER SETTINGS")); GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 0.0f); if (GUI.Button(new Rect(rt.x + margin + 10, rt.y + 5, 370, 20), "")) { script.showPerformance = !script.showPerformance; } GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 1.0f); if (script.showPerformance) { GUI.contentColor = colorEnabled; GUI.backgroundColor = colorEnabled; script.enableTransparency = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 30, 20, 18), "", script.enableTransparency); if (!script.enableTransparency) { GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; } EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 30, 160, 18), "WATER TRANSPARENCY"); if (!script.enableTransparency) { GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; } EditorGUI.LabelField(new Rect(rt.x + margin + 230, rt.y + 47, 180, 18), "Render Layers"); if (script.gameObject.activeInHierarchy) { script.transLayer = EditorGUI.MaskField(new Rect(rt.x + margin + 230, rt.y + 67, 150, 18), "", script.transLayer, script.suiLayerMasks.ToArray()); } EditorGUI.LabelField(new Rect(rt.x + margin + 110, rt.y + 47, 180, 18), "Use Resolution"); if (script.gameObject.activeInHierarchy) { script.transResolution = EditorGUI.Popup(new Rect(rt.x + margin + 110, rt.y + 67, 100, 18), "", script.transResolution, script.resOptions.ToArray()); } EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 47, 100, 18), "Distance"); script.transRenderDistance = EditorGUI.FloatField(new Rect(rt.x + margin + 30, rt.y + 67, 60, 18), "", script.transRenderDistance); GUI.contentColor = colorEnabled; GUI.backgroundColor = colorEnabled; EditorGUI.DrawPreviewTexture(new Rect(rt.x + margin + 10, rt.y + 95, 372, 1), divHorizTex); script.enableReflections = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 103, 20, 18), "", script.enableReflections); if (!script.enableReflections) { GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; } EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 103, 160, 18), "WATER REFLECTIONS"); EditorGUI.LabelField(new Rect(rt.x + margin + 50, rt.y + 123, 170, 18), "Enable Dynamic Reflections"); script.enableDynamicReflections = EditorGUI.Toggle(new Rect(rt.x + margin + 30, rt.y + 123, setWidth, 18), "", script.enableDynamicReflections); GUI.contentColor = colorEnabled; GUI.backgroundColor = colorEnabled; EditorGUI.DrawPreviewTexture(new Rect(rt.x + margin + 10, rt.y + 145, 372, 1), divHorizTex); script.enableCaustics = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 150, 20, 18), "", script.enableCaustics); if (!script.enableCaustics) { GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; } EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 150, 160, 18), "CAUSTIC FX"); EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 170, 140, 18), "FPS"); script.causticObject.causticFPS = EditorGUI.IntField(new Rect(rt.x + margin + 30, rt.y + 185, 30, 18), "", script.causticObject.causticFPS); EditorGUI.LabelField(new Rect(rt.x + margin + 90, rt.y + 170, 140, 18), "Caustic Tint"); script.causticObject.causticTint = EditorGUI.ColorField(new Rect(rt.x + margin + 90, rt.y + 187, 120, 14), "", script.causticObject.causticTint); EditorGUI.LabelField(new Rect(rt.x + margin + 230, rt.y + 170, 100, 18), "Render Layers"); if (script.gameObject.activeInHierarchy) { script.causticLayer = EditorGUI.MaskField(new Rect(rt.x + margin + 230, rt.y + 187, 155, 18), "", script.causticLayer, script.suiLayerMasks.ToArray()); } EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 210, 100, 18), "Bright"); script.causticObject.causticIntensity = EditorGUI.Slider(new Rect(rt.x + margin + 90, rt.y + 210, 120, 18), "", script.causticObject.causticIntensity, 0.0f, 3.0f); EditorGUI.LabelField(new Rect(rt.x + margin + 230, rt.y + 210, 80, 18), "Scale"); script.causticObject.causticScale = EditorGUI.Slider(new Rect(rt.x + margin + 275, rt.y + 210, 115, 18), "", script.causticObject.causticScale, 0.5f, 15.0f); if (script.setLight == null) { GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; } script.causticObject.inheritLightColor = EditorGUI.Toggle(new Rect(rt.x + margin + 30, rt.y + 235, 120, 18), "", script.causticObject.inheritLightColor); EditorGUI.LabelField(new Rect(rt.x + margin + 50, rt.y + 235, 140, 18), "Inherit Light Color"); script.causticObject.inheritLightDirection = EditorGUI.Toggle(new Rect(rt.x + margin + 200, rt.y + 235, 120, 18), "", script.causticObject.inheritLightDirection); EditorGUI.LabelField(new Rect(rt.x + margin + 220, rt.y + 235, 140, 18), "Inherit Light Direction"); if (script.enableCaustics) { GUI.contentColor = colorEnabled; GUI.backgroundColor = colorEnabled; } script.enableCausticsBlending = EditorGUI.Toggle(new Rect(rt.x + margin + 30, rt.y + 255, 120, 18), "", script.enableCausticsBlending); EditorGUI.LabelField(new Rect(rt.x + margin + 50, rt.y + 255, 320, 18), "Enable Advanced Caustic FX (effects performance)"); GUI.contentColor = colorEnabled; GUI.backgroundColor = colorEnabled; EditorGUI.DrawPreviewTexture(new Rect(rt.x + margin + 10, rt.y + 285, 372, 1), divHorizTex); script.enableAdvancedDistort = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 290, 20, 18), "", script.enableAdvancedDistort); if (!script.enableAdvancedDistort) { GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; } EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 290, 340, 18), "ADVANCED WAKE AND DISTORTION EFFECTS"); GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 305, 340, 18), "Enables rendering of advanced scene effects such as wake"); EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 317, 340, 18), "and boat trail generation and water ripple distortion fx."); GUI.contentColor = colorEnabled; GUI.backgroundColor = colorEnabled; EditorGUI.DrawPreviewTexture(new Rect(rt.x + margin + 10, rt.y + 340, 372, 1), divHorizTex); script.enableAutoAdvance = EditorGUI.Toggle(new Rect(rt.x + margin + 10, rt.y + 345, 20, 18), "", script.enableAutoAdvance); if (!script.enableAutoAdvance) { GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; } EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 345, 340, 18), "AUTO-ADVANCE SYSTEM TIMER"); script.systemTime = EditorGUI.FloatField(new Rect(rt.x + margin + 260, rt.y + 345, 120, 18), "", script.systemTime); GUI.contentColor = colorDisabled; GUI.backgroundColor = colorDisabled; EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 360, 340, 18), "the 'systemTime' variable is automatically advanced by"); EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 372, 340, 18), "default. This variable can be shared across a network to"); EditorGUI.LabelField(new Rect(rt.x + margin + 30, rt.y + 384, 340, 18), "sync wave positions between client and server computers."); GUI.contentColor = colorEnabled; GUI.backgroundColor = colorEnabled; GUILayout.Space(390.0f); } GUILayout.Space(10.0f); if (script.useTenkoku == 1.0f) { rt = GUILayoutUtility.GetRect(buttonText, buttonStyle); EditorGUI.DrawPreviewTexture(new Rect(rt.x + margin, rt.y, 387, 24), divTex); script.showTenkoku = EditorGUI.Foldout(new Rect(rt.x + margin + 3, rt.y + 5, 20, 20), script.showTenkoku, ""); GUI.Label(new Rect(rt.x + margin + 20, rt.y + 5, 300, 20), new GUIContent("TENKOKU SKY SYSTEM - INTEGRATION")); if (script.showTenkoku) { EditorGUI.LabelField(new Rect(rt.x + margin + 10, rt.y + 30, 140, 18), "Use Wind Settings"); script.tenkokuUseWind = EditorGUI.Toggle(new Rect(rt.x + margin + 125, rt.y + 30, setWidth, 18), "", script.tenkokuUseWind); EditorGUI.LabelField(new Rect(rt.x + margin + 195, rt.y + 30, 150, 18), "Calculate Sky Reflections"); script.tenkokuUseReflect = EditorGUI.Toggle(new Rect(rt.x + margin + 350, rt.y + 30, setWidth, 18), "", script.tenkokuUseReflect); } GUILayout.Space(50.0f); } GUILayout.Space(10.0f); if (GUI.changed) { EditorUtility.SetDirty(target); } }