Commit 77646b7d authored by 神楽坂玲奈's avatar 神楽坂玲奈

remove Mega-Fiers & TextMesh Pro Editor Scripts for upgrade

parent 8b764b4f
fileFormatVersion: 2
guid: 2122222f545717b4da829b89981ac8cf
folderAsset: yes
timeCreated: 1482163012
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaBend))]
public class MegaBendEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Bend Modifier by Chris West"; }
public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers/bend_help.png"); }
public override bool Inspector()
{
MegaBend mod = (MegaBend)target;
EditorGUIUtility.LookLikeControls();
mod.angle = EditorGUILayout.FloatField("Angle", mod.angle);
mod.dir = EditorGUILayout.FloatField("Dir", mod.dir);
mod.axis = (MegaAxis)EditorGUILayout.EnumPopup("Axis", mod.axis);
mod.doRegion = EditorGUILayout.Toggle("Do Region", mod.doRegion);
mod.from = EditorGUILayout.FloatField("From", mod.from);
mod.to = EditorGUILayout.FloatField("To", mod.to);
return false;
}
}
fileFormatVersion: 2
guid: f3bf905f7f3752c48989d1fe027de131
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaBubble))]
public class MegaBubbleEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Bubble Modifier by Chris West"; }
public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers/bubble_help.png"); }
public override bool Inspector()
{
MegaBubble mod = (MegaBubble)target;
EditorGUIUtility.LookLikeControls();
mod.radius = EditorGUILayout.FloatField("Radius", mod.radius);
mod.falloff = EditorGUILayout.FloatField("Falloff", mod.falloff);
return false;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 96ac112a275b6c243bb9d23e22c303ab
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEditor;
[CustomEditor(typeof(MegaBulge))]
public class MegaBulgeEditor : MegaModifierEditor
{
public override bool Inspector()
{
MegaBulge mod = (MegaBulge)target;
EditorGUIUtility.LookLikeControls();
mod.Amount = EditorGUILayout.Vector3Field("Radius", mod.Amount);
mod.FallOff = EditorGUILayout.Vector3Field("Falloff", mod.FallOff);
mod.LinkFallOff = EditorGUILayout.Toggle("Link Falloff", mod.LinkFallOff);
return false;
}
}
fileFormatVersion: 2
guid: 7501f331fecc5f14cb3089cd98ddbeb4
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaCrumple))]
public class MegaCrumpleEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Crumple Modifier by Unity"; }
public override bool Inspector()
{
MegaCrumple mod = (MegaCrumple)target;
EditorGUIUtility.LookLikeControls();
mod.scale = EditorGUILayout.FloatField("Scale", mod.scale);
mod.speed = EditorGUILayout.FloatField("Speed", mod.speed);
mod.phase = EditorGUILayout.FloatField("Phase", mod.phase);
mod.animate = EditorGUILayout.Toggle("Animate", mod.animate);
return false;
}
}
fileFormatVersion: 2
guid: 564e9efbaaf72884685ca7f8201e714f
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaCurveDeform))]
public class MegaCurveDeformEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Mega Curve Deform Modifier by Chris West"; }
public override bool Inspector()
{
MegaCurveDeform mod = (MegaCurveDeform)target;
EditorGUIUtility.LookLikeControls();
mod.axis = (MegaAxis)EditorGUILayout.EnumPopup("Axis", mod.axis);
mod.defCurve = EditorGUILayout.CurveField("Curve", mod.defCurve);
mod.MaxDeviation = EditorGUILayout.FloatField("Max Deviation", mod.MaxDeviation);
return false;
}
}
fileFormatVersion: 2
guid: 81a2c84abdb3e9a41af369347d41d9e6
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEditor;
[CustomEditor(typeof(MegaCylindrify))]
public class MegaCylindrifyEditor : MegaModifierEditor
{
public override bool Inspector()
{
MegaCylindrify mod = (MegaCylindrify)target;
EditorGUIUtility.LookLikeControls();
mod.Percent = EditorGUILayout.FloatField("Percent", mod.Percent);
mod.Decay = EditorGUILayout.FloatField("Decay", mod.Decay);
return false;
}
}
fileFormatVersion: 2
guid: 910aa6eb5ee321c43a0f1444fb45ffb1
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaDisplace))]
public class MegaDisplaceEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Displace Modifier by Chris West"; }
//public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers/bend_web.png"); }
public override bool Inspector()
{
MegaDisplace mod = (MegaDisplace)target;
EditorGUIUtility.LookLikeControls();
mod.map = (Texture2D)EditorGUILayout.ObjectField("Map", mod.map, typeof(Texture2D), true);
mod.amount = EditorGUILayout.FloatField("Amount", mod.amount);
mod.offset = EditorGUILayout.Vector2Field("Offset", mod.offset);
mod.scale = EditorGUILayout.Vector2Field("Scale", mod.scale);
mod.channel = (MegaChannel)EditorGUILayout.EnumPopup("Channel", mod.channel);
mod.CentLum = EditorGUILayout.Toggle("Cent Lum", mod.CentLum);
mod.CentVal = EditorGUILayout.FloatField("Cent Val", mod.CentVal);
mod.Decay = EditorGUILayout.FloatField("Decay", mod.Decay);
return false;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 2feb81174795e7848b9a0f1c530106c1
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MegaFFD2x2x2))]
public class MegaFFD2x2x2Editor : MegaFFDEditor
{
public override string GetHelpString() { return "FFD2x2x2 Modifier by Chris West"; }
}
\ No newline at end of file
fileFormatVersion: 2
guid: 36e485a5e3715de41ae82f93cf9d0e48
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MegaFFD3x3x3))]
public class MegaFFD3x3x3Editor : MegaFFDEditor
{
public override string GetHelpString() { return "FFD3x3x3 Modifier by Chris West"; }
}
\ No newline at end of file
fileFormatVersion: 2
guid: cec875d5a9be15e42ac18602efb1139a
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MegaFFD4x4x4))]
public class MegaFFD4x4x4Editor : MegaFFDEditor
{
public override string GetHelpString() { return "FFD4x4x4 Modifier by Chris West"; }
}
\ No newline at end of file
fileFormatVersion: 2
guid: ff963bd5a3b2a704bbce0cd2d5128954
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
public class MegaFFDEditor : MegaModifierEditor
{
Vector3 pm = new Vector3();
public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers/ffd_help.png"); }
bool showpoints = true;
public override bool Inspector()
{
MegaFFD mod = (MegaFFD)target;
EditorGUIUtility.LookLikeControls();
mod.KnotSize = EditorGUILayout.FloatField("Knot Size", mod.KnotSize);
mod.inVol = EditorGUILayout.Toggle("In Vol", mod.inVol);
showpoints = EditorGUILayout.Foldout(showpoints, "Points");
if ( showpoints )
{
int gs = mod.GridSize();
//int num = gs * gs * gs;
for ( int x = 0; x < gs; x++ )
{
for ( int y = 0; y < gs; y++ )
{
for ( int z = 0; z < gs; z++ )
{
int i = (x * gs * gs) + (y * gs) + z;
mod.pt[i] = EditorGUILayout.Vector3Field("p[" + x + "," + y + "," + z + "]", mod.pt[i]);
}
}
}
}
return false;
}
public override void DrawSceneGUI()
{
MegaFFD ffd = (MegaFFD)target;
if ( ffd.DisplayGizmo )
{
MegaModifiers context = ffd.GetComponent<MegaModifiers>();
Vector3 size = ffd.lsize;
Vector3 osize = ffd.lsize;
osize.x = 1.0f / size.x;
osize.y = 1.0f / size.y;
osize.z = 1.0f / size.z;
Matrix4x4 tm1 = Matrix4x4.identity;
Quaternion rot = Quaternion.Euler(ffd.gizmoRot);
tm1.SetTRS(-(ffd.gizmoPos + ffd.Offset), rot, Vector3.one);
if ( context != null && context.sourceObj != null )
Handles.matrix = context.sourceObj.transform.localToWorldMatrix * tm1;
else
Handles.matrix = ffd.transform.localToWorldMatrix * tm1;
DrawGizmos(ffd, Handles.matrix);
Handles.color = Color.yellow;
int pc = ffd.GridSize();
pc = pc * pc * pc;
for ( int i = 0; i < pc; i++ )
{
Vector3 p = ffd.GetPoint(i) + ffd.bcenter;
//pm = Handles.PositionHandle(p, Quaternion.identity);
pm = Handles.FreeMoveHandle(p, Quaternion.identity, ffd.KnotSize * 0.1f, Vector3.zero, Handles.CircleCap);
pm -= ffd.bcenter;
p = Vector3.Scale(pm, osize);
p.x += 0.5f;
p.y += 0.5f;
p.z += 0.5f;
ffd.pt[i] = p;
}
Handles.matrix = Matrix4x4.identity;
}
}
Vector3[] pp3 = new Vector3[3];
public void DrawGizmos(MegaFFD ffd, Matrix4x4 tm)
{
Handles.color = Color.red;
int pc = ffd.GridSize();
for ( int i = 0; i < pc; i++ )
{
for ( int j = 0; j < pc; j++ )
{
for ( int k = 0; k < pc; k++ )
{
pp3[0] = tm.MultiplyPoint(ffd.GetPoint(i, j, k) + ffd.bcenter);
if ( i < pc - 1 )
{
pp3[1] = tm.MultiplyPoint(ffd.GetPoint(i + 1, j, k) + ffd.bcenter);
Handles.DrawLine(pp3[0], pp3[1]);
}
if ( j < pc - 1 )
{
pp3[1] = tm.MultiplyPoint(ffd.GetPoint(i, j + 1, k) + ffd.bcenter);
Handles.DrawLine(pp3[0], pp3[1]);
}
if ( k < pc - 1 )
{
pp3[1] = tm.MultiplyPoint(ffd.GetPoint(i, j, k + 1) + ffd.bcenter);
Handles.DrawLine(pp3[0], pp3[1]);
}
}
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: a8ea7c7ad2d417747a8a01392f0358ec
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 61f6bd5b3ad18024488bf972d1263ee2
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaHump))]
public class MegaHumpEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Hump Modifier by Chris West"; }
public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers/hump_help.png"); }
public override bool Inspector()
{
MegaHump mod = (MegaHump)target;
EditorGUIUtility.LookLikeControls();
mod.amount = EditorGUILayout.FloatField("Amount", mod.amount);
mod.cycles = EditorGUILayout.FloatField("Cycles", mod.cycles);
mod.phase = EditorGUILayout.FloatField("Phase", mod.phase);
mod.animate = EditorGUILayout.Toggle("Animate", mod.animate);
mod.speed = EditorGUILayout.FloatField("Speed", mod.speed);
mod.axis = (MegaAxis)EditorGUILayout.EnumPopup("Axis", mod.axis);
return false;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: d2b823aa1107084428512bb14d96c796
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaMelt))]
public class MegaMeltEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Melt Modifier by Chris West"; }
//public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers/bend_help.png"); }
public override bool Inspector()
{
MegaMelt mod = (MegaMelt)target;
EditorGUIUtility.LookLikeControls();
mod.Amount = EditorGUILayout.FloatField("Amount", mod.Amount);
mod.Spread = EditorGUILayout.FloatField("Spread", mod.Spread);
mod.MaterialType = (MegaMeltMat)EditorGUILayout.EnumPopup("Material Type", mod.MaterialType);
mod.Solidity = EditorGUILayout.FloatField("Solidity", mod.Solidity);
mod.axis = (MegaAxis)EditorGUILayout.EnumPopup("Axis", mod.axis);
mod.FlipAxis = EditorGUILayout.Toggle("Flip Axis", mod.FlipAxis);
return false;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: ea890df6cb5109142b042faea97fe090
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaModifier))]
public class MegaModifierEditor : Editor
{
public Texture image;
public bool showhelp = false;
public virtual Texture LoadImage() { return null; }
public virtual string GetHelpString() { return "Modifer by Chris West"; }
public virtual bool Inspector() { return true; }
public virtual bool DisplayCommon() { return true; }
#if false
[DrawGizmo(GizmoType.NotSelected | GizmoType.Pickable)]
static void RenderGizmo(MegaModifier mod, GizmoType gizmoType)
{
}
[DrawGizmo(GizmoType.SelectedOrChild | GizmoType.Pickable)]
static void RenderGizmoSelected(MegaModifier mod, GizmoType gizmoType)
{
if ( GUI.changed )
{
Debug.Log("Editing " + mod.ModName());
}
}
#endif
void OnDestroy()
{
MegaModifiers[] con = (MegaModifiers[])FindSceneObjectsOfType(typeof(MegaModifiers));
for ( int i = 0; i < con.Length; i++ )
{
con[i].BuildList();
}
}
public bool showmodparams = true;
//bool showweight = true;
public void CommonModParamsBasic(MegaModifier mod)
{
// Basic mod stuff
//showmodparams = EditorGUILayout.Foldout(showmodparams, "Modifier Common Params");
//if ( showmodparams )
//{
mod.ModEnabled = EditorGUILayout.Toggle("Mod Enabled", mod.ModEnabled);
mod.DisplayGizmo = EditorGUILayout.Toggle("Display Gizmo", mod.DisplayGizmo);
int order = EditorGUILayout.IntField("Order", mod.Order);
if ( order != mod.Order )
{
mod.Order = order;
MegaModifiers context = mod.GetComponent<MegaModifiers>();
if ( context != null )
context.BuildList();
}
mod.gizCol1 = EditorGUILayout.ColorField("Giz Col 1", mod.gizCol1);
mod.gizCol2 = EditorGUILayout.ColorField("Giz Col 2", mod.gizCol2);
mod.steps = EditorGUILayout.IntField("Gizmo Detail", mod.steps);
if ( mod.steps < 1 )
mod.steps = 1;
//}
//mod.useWeights = EditorGUILayout.Toggle("Use Weights", mod.useWeights);
//if ( mod.useWeights )
// mod.weightChannel = (MegaWeightChannel)EditorGUILayout.EnumPopup("Weight Channel", mod.weightChannel);
}
public void CommonModParams(MegaModifier mod)
{
showmodparams = EditorGUILayout.Foldout(showmodparams, "Modifier Common Params");
if ( showmodparams )
{
EditorGUILayout.BeginHorizontal();
if ( GUILayout.Button("Rst Off") )
{
mod.Offset = Vector3.zero;
EditorUtility.SetDirty(target);
}
if ( GUILayout.Button("Rst Pos") )
{
mod.gizmoPos = Vector3.zero;
EditorUtility.SetDirty(target);
}
if ( GUILayout.Button("Rst Rot") )
{
mod.gizmoRot = Vector3.zero;
EditorUtility.SetDirty(target);
}
if ( GUILayout.Button("Rst Scl") )
{
mod.gizmoScale = Vector3.one;
EditorUtility.SetDirty(target);
}
EditorGUILayout.EndHorizontal();
mod.Offset = EditorGUILayout.Vector3Field("Offset", mod.Offset);
mod.gizmoPos = EditorGUILayout.Vector3Field("Gizmo Pos", mod.gizmoPos);
mod.gizmoRot = EditorGUILayout.Vector3Field("Gizmo Rot", mod.gizmoRot);
mod.gizmoScale = EditorGUILayout.Vector3Field("Gizmo Scale", mod.gizmoScale);
CommonModParamsBasic(mod);
#if false
mod.ModEnabled = EditorGUILayout.Toggle("Mod Enabled", mod.ModEnabled);
mod.DisplayGizmo = EditorGUILayout.Toggle("Display Gizmo", mod.DisplayGizmo);
int order = EditorGUILayout.IntField("Order", mod.Order);
if ( order != mod.Order )
{
mod.Order = order;
MegaModifiers context = mod.GetComponent<MegaModifiers>();
if ( context != null )
context.BuildList();
}
mod.gizCol1 = EditorGUILayout.ColorField("Giz Col 1", mod.gizCol1);
mod.gizCol2 = EditorGUILayout.ColorField("Giz Col 2", mod.gizCol2);
//showweight = EditorGUILayout.Foldout(showweight, "Modifier Weight Params");
//if ( showweight )
{
//mod.useWeights = EditorGUILayout.Toggle("Use Weights", mod.useWeights);
//if ( mod.useWeights )
//{
//mod.weightChannel = (MegaWeightChannel)EditorGUILayout.EnumPopup("Weight Channel", mod.weightChannel);
//}
}
#endif
}
}
public virtual void DrawGUI()
{
//showhelp = EditorGUILayout.Foldout(showhelp, "Help");
//if ( showhelp )
//{
//if ( image == null )
//image = LoadImage();
//if ( image != null )
//{
//float w = Screen.width - 12.0f;
//float h = (w / image.width) * image.height;
//if ( h > image.height )
//h = image.height;
//GUILayout.Label((Texture)image, GUIStyle.none, GUILayout.Width(w), GUILayout.Height(h));
//}
//}
if ( DisplayCommon() )
CommonModParams((MegaModifier)target);
if ( GUI.changed )
EditorUtility.SetDirty(target);
if ( Inspector() )
DrawDefaultInspector();
//if ( showhelp )
//GUILayout.TextArea(GetHelpString());
}
public virtual void DrawSceneGUI()
{
MegaModifier mod = (MegaModifier)target;
if ( mod.ModEnabled && mod.DisplayGizmo && MegaModifiers.GlobalDisplay && showmodparams )
{
MegaModifiers context = mod.GetComponent<MegaModifiers>();
if ( context != null && context.Enabled && context.DrawGizmos )
{
//mod.Offset = -Handles.PositionHandle(-mod.Offset, Quaternion.identity);
float a = mod.gizCol1.a;
Color col = Color.white;
Quaternion rot = mod.transform.localRotation;
Handles.matrix = Matrix4x4.identity;
if ( mod.Offset != Vector3.zero )
{
Vector3 pos = mod.transform.localToWorldMatrix.MultiplyPoint(-mod.Offset);
Handles.Label(pos, mod.ModName() + " Offset\n" + mod.Offset.ToString("0.000"));
col = Color.blue;
col.a = a;
Handles.color = col;
Handles.ArrowCap(0, pos, rot * Quaternion.Euler(180.0f, 0.0f, 0.0f), mod.GizmoSize());
col = Color.green;
col.a = a;
Handles.color = col;
Handles.ArrowCap(0, pos, rot * Quaternion.Euler(90.0f, 0.0f, 0.0f), mod.GizmoSize());
col = Color.red;
col.a = a;
Handles.color = col;
Handles.ArrowCap(0, pos, rot * Quaternion.Euler(0.0f, -90.0f, 0.0f), mod.GizmoSize());
}
// gizmopos
if ( mod.gizmoPos != Vector3.zero )
{
Vector3 pos = mod.transform.localToWorldMatrix.MultiplyPoint(-mod.gizmoPos);
Handles.Label(pos, mod.ModName() + " Pos\n" + mod.gizmoPos.ToString("0.000"));
col = Color.blue;
col.a = a;
Handles.color = col;
Handles.ArrowCap(0, pos, rot * Quaternion.Euler(180.0f, 0.0f, 0.0f), mod.GizmoSize());
col = Color.green;
col.a = a;
Handles.color = col;
Handles.ArrowCap(0, pos, rot * Quaternion.Euler(90.0f, 0.0f, 0.0f), mod.GizmoSize());
col = Color.red;
col.a = a;
Handles.color = col;
Handles.ArrowCap(0, pos, rot * Quaternion.Euler(0.0f, -90.0f, 0.0f), mod.GizmoSize());
}
Handles.matrix = Matrix4x4.identity;
}
}
}
public override void OnInspectorGUI()
{
DrawGUI();
if ( GUI.changed )
EditorUtility.SetDirty(target);
}
public void OnSceneGUI()
{
DrawSceneGUI();
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: ff7d3520ad764fe42a99fb6e18fc6246
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaModifyGroup))]
public class MegaModifyGroupEditor : Editor
{
Texture image;
//bool showhelp = false;
bool showorder = false;
bool showmulti = false;
//[DrawGizmo(GizmoType.SelectedOrChild)]
//static void RenderGizmoSelected(ModifyObject mod, GizmoType gizmoType)
//{
//mod.ColliderTest();
//}
bool targets = false;
public override void OnInspectorGUI()
{
MegaModifyGroup mod = (MegaModifyGroup)target;
EditorGUIUtility.LookLikeInspector();
MegaModifiers.GlobalDisplay = EditorGUILayout.Toggle("GlobalDisplayGizmos", MegaModifiers.GlobalDisplay);
mod.Enabled = EditorGUILayout.Toggle("Enabled", mod.Enabled);
mod.recalcnorms = EditorGUILayout.Toggle("Recalc Normals", mod.recalcnorms);
MegaNormalMethod method = mod.NormalMethod;
mod.NormalMethod = (MegaNormalMethod)EditorGUILayout.EnumPopup("Normal Method", mod.NormalMethod);
mod.recalcbounds = EditorGUILayout.Toggle("Recalc Bounds", mod.recalcbounds);
mod.recalcCollider = EditorGUILayout.Toggle("Recalc Collider", mod.recalcCollider);
mod.recalcTangents = EditorGUILayout.Toggle("Recalc Tangents", mod.recalcTangents);
mod.DoLateUpdate = EditorGUILayout.Toggle("Do Late Update", mod.DoLateUpdate);
mod.GrabVerts = EditorGUILayout.Toggle("Grab Verts", mod.GrabVerts);
mod.DrawGizmos = EditorGUILayout.Toggle("Draw Gizmos", mod.DrawGizmos);
if ( mod.NormalMethod != method && mod.NormalMethod == MegaNormalMethod.Mega )
{
mod.BuildNormalMapping(mod.mesh, false);
}
if ( GUILayout.Button("Threading Options") )
showmulti = !showmulti;
if ( showmulti )
{
MegaModifiers.ThreadingOn = EditorGUILayout.Toggle("Threading Enabled", MegaModifiers.ThreadingOn);
mod.UseThreading = EditorGUILayout.Toggle("Thread This Object", mod.UseThreading);
}
EditorGUIUtility.LookLikeControls();
if ( GUI.changed )
EditorUtility.SetDirty(target);
showorder = EditorGUILayout.Foldout(showorder, "Modifier Order");
if ( showorder && mod.mods != null )
{
for ( int i = 0; i < mod.mods.Length; i++ )
{
EditorGUILayout.LabelField("", i.ToString() + " - " + mod.mods[i].ModName() + " " + mod.mods[i].Order);
}
}
if ( GUILayout.Button("Targets") )
targets = !targets;
if ( targets )
{
if ( GUILayout.Button("Add Target") )
{
MegaModifierTarget targ = new MegaModifierTarget();
mod.targets.Add(targ);
}
for ( int i = 0; i < mod.targets.Count; i++ )
{
EditorGUILayout.BeginHorizontal();
mod.targets[i].go = (GameObject)EditorGUILayout.ObjectField("Target " + i, mod.targets[i].go, typeof(GameObject), true);
if ( GUILayout.Button("Del") )
{
mod.targets.Remove(mod.targets[i]);
i--;
}
EditorGUILayout.EndHorizontal();
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 3ba58d22565742943b90bf3506b0cda6
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaModifyObject))]
public class MegaModifyObjectEditor : Editor
{
Texture image;
//bool showhelp = false;
bool showorder = false;
bool showmulti = false;
bool showgroups = false;
//[DrawGizmo(GizmoType.SelectedOrChild)]
//static void RenderGizmoSelected(ModifyObject mod, GizmoType gizmoType)
//{
//mod.ColliderTest();
//}
public override void OnInspectorGUI()
{
MegaModifyObject mod = (MegaModifyObject)target;
//showhelp = EditorGUILayout.Foldout(showhelp, "Help");
//if ( showhelp )
//{
//if ( image == null )
//image = (Texture)EditorGUIUtility.LoadRequired("mod_help.png");
//if ( image != null )
//{
//float w = Screen.width - 12.0f;
//float h = (w / image.width) * image.height;
//GUILayout.Label((Texture)image, GUIStyle.none, GUILayout.Width(w), GUILayout.Height(h));
//}
//}
EditorGUIUtility.LookLikeInspector();
MegaModifiers.GlobalDisplay = EditorGUILayout.Toggle("GlobalDisplayGizmos", MegaModifiers.GlobalDisplay);
mod.Enabled = EditorGUILayout.Toggle("Enabled", mod.Enabled);
mod.recalcnorms = EditorGUILayout.Toggle("Recalc Normals", mod.recalcnorms);
MegaNormalMethod method = mod.NormalMethod;
mod.NormalMethod = (MegaNormalMethod)EditorGUILayout.EnumPopup("Normal Method", mod.NormalMethod);
mod.recalcbounds = EditorGUILayout.Toggle("Recalc Bounds", mod.recalcbounds);
mod.recalcCollider = EditorGUILayout.Toggle("Recalc Collider", mod.recalcCollider);
mod.recalcTangents = EditorGUILayout.Toggle("Recalc Tangents", mod.recalcTangents);
mod.DoLateUpdate = EditorGUILayout.Toggle("Do Late Update", mod.DoLateUpdate);
mod.GrabVerts = EditorGUILayout.Toggle("Grab Verts", mod.GrabVerts);
mod.DrawGizmos = EditorGUILayout.Toggle("Draw Gizmos", mod.DrawGizmos);
if ( mod.NormalMethod != method && mod.NormalMethod == MegaNormalMethod.Mega )
{
mod.BuildNormalMapping(mod.mesh, false);
}
//showmulti = EditorGUILayout.Foldout(showmulti, "Multi Core");
if ( GUILayout.Button("Threading Options") )
showmulti = !showmulti;
if ( showmulti )
{
MegaModifiers.ThreadingOn = EditorGUILayout.Toggle("Threading Enabled", MegaModifiers.ThreadingOn);
mod.UseThreading = EditorGUILayout.Toggle("Thread This Object", mod.UseThreading);
}
EditorGUIUtility.LookLikeControls();
if ( GUI.changed )
EditorUtility.SetDirty(target);
showorder = EditorGUILayout.Foldout(showorder, "Modifier Order");
if ( showorder && mod.mods != null )
{
for ( int i = 0; i < mod.mods.Length; i++ )
{
EditorGUILayout.LabelField("", i.ToString() + " - " + mod.mods[i].ModName() + " " + mod.mods[i].Order);
}
}
// Group stuff
if ( GUILayout.Button("Group Members") )
showgroups = !showgroups;
if ( showgroups )
{
//if ( GUILayout.Button("Add Object") )
//{
//MegaModifierTarget targ = new MegaModifierTarget();
// mod.group.Add(targ);
//}
for ( int i = 0; i < mod.group.Count; i++ )
{
EditorGUILayout.BeginHorizontal();
mod.group[i] = (GameObject)EditorGUILayout.ObjectField("Obj " + i, mod.group[i], typeof(GameObject), true);
if ( GUILayout.Button("Del") )
{
mod.group.Remove(mod.group[i]);
i--;
}
EditorGUILayout.EndHorizontal();
}
GameObject newobj = (GameObject)EditorGUILayout.ObjectField("Add", null, typeof(GameObject), true);
if ( newobj )
{
mod.group.Add(newobj);
}
if ( GUILayout.Button("Update") )
{
// for each group member check if it has a modify object comp, if not add one and copy values over
// calculate box for all meshes and set, and set the Offset for each one
// then for each modifier attached find or add and set instance value
// in theory each gizmo should overlap the others
// Have a method to update box and offsets if we allow moving in the group
}
}
}
}
fileFormatVersion: 2
guid: be83e9d9f7d2f32448f09b8515441d77
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaMorphAnim))]
public class MegaMorphAnimEditor : Editor
{
int GetIndex(string name, string[] channels)
{
int index = -1;
for ( int i = 0; i < channels.Length; i++ )
{
if ( channels[i] == name )
{
index = i;
break;
}
}
return index;
}
// TODO: Need none in the popup to clear a channel
public override void OnInspectorGUI()
{
MegaMorphAnim anim = (MegaMorphAnim)target;
MegaMorph morph = anim.gameObject.GetComponent<MegaMorph>();
if ( morph != null )
{
string[] channels = morph.GetChannelNames();
int index = GetIndex(anim.SrcChannel, channels);
index = EditorGUILayout.Popup("Source Channel", index, channels);
if ( index != -1 )
{
anim.SrcChannel = channels[index];
anim.SetChannel(morph, 0);
}
anim.Percent = EditorGUILayout.Slider("Percent", anim.Percent, 0.0f, 100.0f);
if ( index != -1 )
{
index = GetIndex(anim.SrcChannel1, channels);
index = EditorGUILayout.Popup("Source Channel", index, channels);
if ( index != -1 )
{
anim.SrcChannel1 = channels[index];
anim.SetChannel(morph, 1);
}
anim.Percent1 = EditorGUILayout.Slider("Percent", anim.Percent1, 0.0f, 100.0f);
}
if ( index != -1 )
{
index = GetIndex(anim.SrcChannel2, channels);
index = EditorGUILayout.Popup("Source Channel", index, channels);
if ( index != -1 )
{
anim.SrcChannel2 = channels[index];
anim.SetChannel(morph, 2);
}
anim.Percent2 = EditorGUILayout.Slider("Percent", anim.Percent2, 0.0f, 100.0f);
}
if ( index != -1 )
{
index = GetIndex(anim.SrcChannel3, channels);
index = EditorGUILayout.Popup("Source Channel", index, channels);
if ( index != -1 )
{
anim.SrcChannel3 = channels[index];
anim.SetChannel(morph, 3);
}
anim.Percent3 = EditorGUILayout.Slider("Percent", anim.Percent3, 0.0f, 100.0f);
}
if ( index != -1 )
{
index = GetIndex(anim.SrcChannel4, channels);
index = EditorGUILayout.Popup("Source Channel", index, channels);
if ( index != -1 )
{
anim.SrcChannel4 = channels[index];
anim.SetChannel(morph, 4);
}
anim.Percent4 = EditorGUILayout.Slider("Percent", anim.Percent4, 0.0f, 100.0f);
}
if ( index != -1 )
{
index = GetIndex(anim.SrcChannel5, channels);
index = EditorGUILayout.Popup("Source Channel", index, channels);
if ( index != -1 )
{
anim.SrcChannel5 = channels[index];
anim.SetChannel(morph, 5);
}
anim.Percent5 = EditorGUILayout.Slider("Percent", anim.Percent5, 0.0f, 100.0f);
}
if ( index != -1 )
{
index = GetIndex(anim.SrcChannel6, channels);
index = EditorGUILayout.Popup("Source Channel", index, channels);
if ( index != -1 )
{
anim.SrcChannel6 = channels[index];
anim.SetChannel(morph, 6);
}
anim.Percent6 = EditorGUILayout.Slider("Percent", anim.Percent6, 0.0f, 100.0f);
}
if ( index != -1 )
{
index = GetIndex(anim.SrcChannel7, channels);
index = EditorGUILayout.Popup("Source Channel", index, channels);
if ( index != -1 )
{
anim.SrcChannel7 = channels[index];
anim.SetChannel(morph, 7);
}
anim.Percent7 = EditorGUILayout.Slider("Percent", anim.Percent7, 0.0f, 100.0f);
}
if ( index != -1 )
{
index = GetIndex(anim.SrcChannel8, channels);
index = EditorGUILayout.Popup("Source Channel", index, channels);
if ( index != -1 )
{
anim.SrcChannel8 = channels[index];
anim.SetChannel(morph, 8);
}
anim.Percent8 = EditorGUILayout.Slider("Percent", anim.Percent8, 0.0f, 100.0f);
}
if ( index != -1 )
{
index = GetIndex(anim.SrcChannel9, channels);
index = EditorGUILayout.Popup("Source Channel", index, channels);
if ( index != -1 )
{
anim.SrcChannel9 = channels[index];
anim.SetChannel(morph, 9);
}
anim.Percent9 = EditorGUILayout.Slider("Percent", anim.Percent9, 0.0f, 100.0f);
}
if ( GUI.changed )
{
EditorUtility.SetDirty(target);
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 452a4a5661ea1a147b4383812eccad71
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaMorphAnimator))]
public class MegaMorphAnimatorEditor : Editor
{
// TODO: Need none in the popup to clear a channel
public override void OnInspectorGUI()
{
MegaMorphAnimator anim = (MegaMorphAnimator)target;
string[] clips = anim.GetClipNames();
anim.current = EditorGUILayout.Popup("Playing Clip", anim.current, clips);
//anim.t = EditorGUILayout.FloatField("t", anim.t);
//anim.at = EditorGUILayout.FloatField("at", anim.at);
if ( GUILayout.Button("Add Clip") )
anim.AddClip("Clip " + anim.clips.Count, 0.0f, 1.0f, MegaRepeatMode.Loop);
EditorGUILayout.BeginVertical();
for ( int i = 0; i < anim.clips.Count; i++ )
{
EditorGUILayout.BeginHorizontal();
//EditorGUILayout.TextArea("" + i + " - ");
anim.clips[i].name = EditorGUILayout.TextField(anim.clips[i].name);
anim.clips[i].start = EditorGUILayout.FloatField(anim.clips[i].start, GUILayout.Width(40));
anim.clips[i].end = EditorGUILayout.FloatField(anim.clips[i].end, GUILayout.Width(40));
anim.clips[i].loop = (MegaRepeatMode)EditorGUILayout.EnumPopup(anim.clips[i].loop);
if ( GUILayout.Button("-") )
{
anim.clips.Remove(anim.clips[i]);
}
EditorGUILayout.EndHorizontal();
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 94ad28898cb2bea40832ba64aa3e773d
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9723af08f034cdb4f985812746ccb7c2
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 86d0d361473dae24da397fb39a6af0fe
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaNoise))]
public class MegaNoiseEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Noise Modifier by Chris West"; }
public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers/noise_help.png"); }
public override bool Inspector()
{
MegaNoise mod = (MegaNoise)target;
EditorGUIUtility.LookLikeControls();
mod.Scale = EditorGUILayout.FloatField("Scale", mod.Scale);
mod.Freq = EditorGUILayout.FloatField("Freq", mod.Freq);
mod.Phase = EditorGUILayout.FloatField("Phase", mod.Phase);
mod.Fractal = EditorGUILayout.Toggle("Fractal", mod.Fractal);
if ( mod.Fractal )
{
mod.Iterations = EditorGUILayout.FloatField("Iterations", mod.Iterations);
mod.Rough = EditorGUILayout.FloatField("Rough", mod.Rough);
}
mod.Strength = EditorGUILayout.Vector3Field("Strength", mod.Strength);
mod.Animate = EditorGUILayout.Toggle("Animate", mod.Animate);
return false;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 383d612fed95d084dbab985e8eb39c50
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MegaPageFlip))]
public class MegaPageFlipEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Page Flip Modifier by Chris West"; }
//public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers/bend_help.png"); }
bool advanced = false;
public override bool Inspector()
{
MegaPageFlip mod = (MegaPageFlip)target;
EditorGUIUtility.LookLikeControls();
mod.turn = EditorGUILayout.FloatField("Turn", mod.turn);
mod.ap1 = EditorGUILayout.FloatField("Ap1", mod.ap1);
mod.ap2 = EditorGUILayout.FloatField("Ap2", mod.ap2);
mod.ap3 = EditorGUILayout.FloatField("Ap3", mod.ap3);
mod.flipx = EditorGUILayout.Toggle("Flip X", mod.flipx);
advanced = EditorGUILayout.Foldout(advanced, "Advanced");
if ( advanced )
{
mod.animT = EditorGUILayout.Toggle("Anim T", mod.animT);
mod.autoMode = EditorGUILayout.Toggle("Auto Mode", mod.autoMode);
mod.lockRho = EditorGUILayout.Toggle("Lock Rho", mod.lockRho);
mod.lockTheta = EditorGUILayout.Toggle("Lock Theta", mod.lockTheta);
mod.timeStep = EditorGUILayout.FloatField("TimeStep", mod.timeStep);
mod.rho = EditorGUILayout.FloatField("Rho", mod.rho);
mod.theta = EditorGUILayout.FloatField("Theta", mod.theta);
mod.deltaT = EditorGUILayout.FloatField("DeltaT", mod.deltaT);
mod.kT = EditorGUILayout.FloatField("kT", mod.kT);
}
return false;
}
}
fileFormatVersion: 2
guid: 3c93b1c900a49b04c8a13aed577bd2a9
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaPaint))]
public class MegaPaintEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Vertex Paint Modifier by Chris West"; }
public override bool Inspector()
{
MegaPaint mod = (MegaPaint)target;
EditorGUIUtility.LookLikeControls();
mod.radius = EditorGUILayout.FloatField("Radius", mod.radius);
mod.amount = EditorGUILayout.FloatField("Amount", mod.amount);
mod.usedecay = EditorGUILayout.Toggle("Use Decay", mod.usedecay);
if ( mod.usedecay )
mod.decay = EditorGUILayout.FloatField("Decay", mod.decay);
mod.fallOff = (MegaFallOff)EditorGUILayout.EnumPopup("Falloff Mode", mod.fallOff);
mod.gaussc = EditorGUILayout.FloatField("Falloff", mod.gaussc);
mod.useAvgNorm = EditorGUILayout.Toggle("Use Avg Norm", mod.useAvgNorm);
if ( !mod.useAvgNorm )
mod.normal = EditorGUILayout.Vector3Field("Normal", mod.normal);
mod.mode = (MegaPaintMode)EditorGUILayout.EnumPopup("Paint Mode", mod.mode);
return false;
}
}
fileFormatVersion: 2
guid: 7be40678aa61c224681e053ba5eee12c
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEditor;
using UnityEngine;
using System;
using System.IO;
using System.Collections.Generic;
public delegate bool ParseBinCallbackType(BinaryReader br, string id);
public delegate void ParseClassCallbackType(string classname, BinaryReader br);
public class MegaParseBezFloatControl
{
static MegaBezFloatKeyControl con;
static public MegaBezFloatKeyControl LoadBezFloatKeyControl(BinaryReader br)
{
con = new MegaBezFloatKeyControl();
MegaParse.Parse(br, Parse);
return con;
}
static public bool Parse(BinaryReader br, string id)
{
switch ( id )
{
case "Num":
int num = br.ReadInt32();
con.Keys = new MegaBezFloatKey[num];
con.Times = new float[num];
break;
case "Keys":
for ( int i = 0; i < con.Keys.Length; i++ )
{
con.Keys[i] = new MegaBezFloatKey();
con.Keys[i].val = br.ReadSingle();
con.Keys[i].intan = br.ReadSingle();
con.Keys[i].outtan = br.ReadSingle();
con.Times[i] = br.ReadSingle();
}
con.InitKeys();
break;
case "BKeys": // Blender keys
Vector2 co = Vector2.zero;
Vector2 left = Vector2.zero;
Vector3 right = Vector2.zero;
Vector2 pco = Vector2.zero;
Vector2 pleft = Vector2.zero;
Vector3 pright = Vector2.zero;
for ( int i = 0; i < con.Keys.Length; i++ )
{
con.Keys[i] = new MegaBezFloatKey();
co.x = br.ReadSingle();
co.y = br.ReadSingle();
left.x = br.ReadSingle();
left.y = br.ReadSingle();
right.x = br.ReadSingle();
right.y = br.ReadSingle();
if ( i > 0 )
con.MakeKey(con.Keys[i - 1], pco, pleft, pright, co, left, right);
pco = co;
pleft = left;
pright = right;
con.Times[i] = co.x / 30.0f;
}
break;
}
return true;
}
}
public class MegaParseBezVector3Control
{
static MegaBezVector3KeyControl con;
static public MegaBezVector3KeyControl LoadBezVector3KeyControl(BinaryReader br)
{
con = new MegaBezVector3KeyControl();
MegaParse.Parse(br, Parse);
return con;
}
static public bool Parse(BinaryReader br, string id)
{
switch ( id )
{
case "Num":
int num = br.ReadInt32();
con.Keys = new MegaBezVector3Key[num];
con.Times = new float[num];
break;
case "Keys":
for ( int i = 0; i < con.Keys.Length; i++ )
{
con.Keys[i] = new MegaBezVector3Key();
con.Keys[i].val = MegaParse.ReadP3(br);
con.Keys[i].intan = MegaParse.ReadP3(br);
con.Keys[i].outtan = MegaParse.ReadP3(br);
con.Times[i] = br.ReadSingle();
}
con.InitKeys();
break;
}
return true;
}
}
public class MegaParse
{
static public Vector3 ReadP3(BinaryReader br)
{
Vector3 v = Vector3.zero;
v.x = br.ReadSingle();
v.y = br.ReadSingle();
v.z = br.ReadSingle();
return v;
}
static public string ReadString(BinaryReader br)
{
int len = br.ReadInt32();
string str = new string(br.ReadChars(len - 1));
br.ReadChar();
return str;
}
static public string ReadStr(BinaryReader br)
{
string str = "";
while ( true )
{
char c = br.ReadChar();
if ( c == 0 )
break;
str += c;
}
return str;
}
static public Vector3[] ReadP3v(BinaryReader br)
{
int count = br.ReadInt32();
Vector3[] tab = new Vector3[count];
for ( int i = 0; i < count; i++ )
{
tab[i].x = br.ReadSingle();
tab[i].y = br.ReadSingle();
tab[i].z = br.ReadSingle();
}
return tab;
}
static public List<Vector3> ReadP3l(BinaryReader br)
{
int count = br.ReadInt32();
List<Vector3> tab = new List<Vector3>(count);
Vector3 p = Vector3.zero;
for ( int i = 0; i < count; i++ )
{
p.x = br.ReadSingle();
p.y = br.ReadSingle();
p.z = br.ReadSingle();
tab.Add(p);
}
return tab;
}
static public float ReadMotFloat(BinaryReader br)
{
byte[] floatBytes = br.ReadBytes(4);
// swap the bytes
Array.Reverse(floatBytes);
// get the float from the byte array
return BitConverter.ToSingle(floatBytes, 0);
}
static public double ReadMotDouble(BinaryReader br)
{
byte[] floatBytes = br.ReadBytes(8);
// swap the bytes
Array.Reverse(floatBytes);
// get the float from the byte array
return BitConverter.ToDouble(floatBytes, 0);
}
static public int ReadMotInt(BinaryReader br)
{
byte[] floatBytes = br.ReadBytes(4);
// swap the bytes
Array.Reverse(floatBytes);
// get the float from the byte array
return BitConverter.ToInt32(floatBytes, 0);
}
//public delegate bool ParseBinCallbackType(BinaryReader br, string id);
//public delegate void ParseClassCallbackType(string classname, BinaryReader br);
static public void Parse(BinaryReader br, ParseBinCallbackType cb)
{
bool readchunk = true;
while ( readchunk )
{
string id = MegaParse.ReadString(br);
if ( id == "eoc" )
break;
int skip = br.ReadInt32();
long fpos = br.BaseStream.Position;
if ( !cb(br, id) )
{
Debug.Log("Error Loading chunk id " + id);
readchunk = false; // done
break;
}
br.BaseStream.Position = fpos + skip;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 870b6dc2ff38b9d49b6f69af483624ea
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MegaPathDeform))]
public class MegaPathDeformEditor : MegaModifierEditor
{
//void OnSceneGUI()
//{
//PathDeform pd = (PathDeform)target;
//Display(pd);
//}
public override bool Inspector()
{
MegaPathDeform mod = (MegaPathDeform)target;
EditorGUIUtility.LookLikeControls();
mod.percent = EditorGUILayout.FloatField("Percent", mod.percent);
mod.stretch = EditorGUILayout.FloatField("Stretch", mod.stretch);
mod.twist = EditorGUILayout.FloatField("Twist", mod.twist);
mod.rotate = EditorGUILayout.FloatField("Rotate", mod.rotate);
mod.axis = (MegaAxis)EditorGUILayout.EnumPopup("Axis", mod.axis);
mod.flip = EditorGUILayout.Toggle("Flip", mod.flip);
mod.path = (MegaShape)EditorGUILayout.ObjectField("Path", mod.path, typeof(MegaShape), true);
mod.animate = EditorGUILayout.Toggle("Animate", mod.animate);
mod.speed = EditorGUILayout.FloatField("Speed", mod.speed);
mod.drawpath = EditorGUILayout.Toggle("Draw Path", mod.drawpath);
mod.tangent = EditorGUILayout.FloatField("Tangent", mod.tangent);
mod.UseTwistCurve = EditorGUILayout.Toggle("Use Twist Curve", mod.UseTwistCurve);
mod.twistCurve = EditorGUILayout.CurveField("Twist Curve", mod.twistCurve);
mod.UseStretchCurve = EditorGUILayout.Toggle("Use Stretch Curve", mod.UseStretchCurve);
mod.stretchCurve = EditorGUILayout.CurveField("Stretch Curve", mod.stretchCurve);
return false;
}
void Display(MegaPathDeform pd)
{
if ( pd.path != null )
{
Matrix4x4 mat = pd.transform.localToWorldMatrix * pd.path.transform.localToWorldMatrix * pd.mat;
for ( int s = 0; s < pd.path.splines.Count; s++ )
{
float ldist = pd.path.stepdist;
if ( ldist < 0.1f )
ldist = 0.1f;
float ds = pd.path.splines[s].length / (pd.path.splines[s].length / ldist);
int c = 0;
int k = -1;
int lk = -1;
Vector3 first = pd.path.splines[s].Interpolate(0.0f, pd.path.normalizedInterp, ref lk);
for ( float dist = ds; dist < pd.path.splines[s].length; dist += ds )
{
float alpha = dist / pd.path.splines[s].length;
Vector3 pos = pd.path.splines[s].Interpolate(alpha, pd.path.normalizedInterp, ref k);
if ( k != lk )
{
for ( lk = lk + 1; lk <= k; lk++ )
{
Handles.DrawLine(mat.MultiplyPoint(first), mat.MultiplyPoint(pd.path.splines[s].knots[lk].p));
first = pd.path.splines[s].knots[lk].p;
}
}
lk = k;
Handles.DrawLine(mat.MultiplyPoint(first), mat.MultiplyPoint(pos));
c++;
first = pos;
}
if ( pd.path.splines[s].closed )
{
Vector3 pos = pd.path.splines[s].Interpolate(0.0f, pd.path.normalizedInterp, ref k);
Handles.DrawLine(mat.MultiplyPoint(first), mat.MultiplyPoint(pos));
}
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 16c4538e4051f0a4cbfc5cec76eac022
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

using UnityEditor;
[CustomEditor(typeof(MegaPivotAdjust))]
public class MegaPivotAdjustEditor : MegaModifierEditor
{
public override bool Inspector()
{
//MegaPivotAdjust mod = (MegaPivotAdjust)target;
return false;
}
}
fileFormatVersion: 2
guid: 5acd69e52a08d2c469a8b0b423030391
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 20f8c2c788b01ee4f8e7da30126561bd
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment