void OnEnable() { dimObj = new SerializedObject(target); bUseGPU = dimObj.FindProperty("useGPU"); bStickToTarget = dimObj.FindProperty("stickToTarget"); bMoveTextures = dimObj.FindProperty("moveTextures"); bMoveMesh = dimObj.FindProperty("moveMesh"); bPreviewMode = dimObj.FindProperty("previewMode"); tTarget = dimObj.FindProperty("target"); fSize = dimObj.FindProperty("size"); fMeshPointDistance = dimObj.FindProperty("meshPointDistance"); cWaterColor = dimObj.FindProperty("waterColor"); cWaveColor = dimObj.FindProperty("waveColor"); tMainTexture = dimObj.FindProperty("mainTexture"); tDetailTexture = dimObj.FindProperty("detailTexture"); v2MainTextureTitle = dimObj.FindProperty("mainTextureTitle"); v2DetailTextureTitle = dimObj.FindProperty("detailTextureTitle"); v2MainTexturScroll = dimObj.FindProperty("mainTexturScroll"); v2DetailTexturScroll = dimObj.FindProperty("detailTexturScroll"); fColorTextureRatio = dimObj.FindProperty("colorTextureRatio"); fHeightColoring = dimObj.FindProperty("heightColoring"); fShoreFoamLine = dimObj.FindProperty("shoreFoamLine"); fShoreFoamCut = dimObj.FindProperty("shoreFoamCut"); fTextureBias = dimObj.FindProperty("textureBias"); aWaveForms = dimObj.FindProperty("waveForms"); fNow = dimObj.FindProperty("now"); UltimateToonWater UTW = (UltimateToonWater)target; UTW.Init(); EditorApplication.update += Simulate; }