Commit 07ad0480 authored by hex's avatar hex

upgrade to 2021.3

parent 0cf202a5
Pipeline #38550 failed

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

...@@ -3,10 +3,15 @@ ...@@ -3,10 +3,15 @@
[Oo]bj/ [Oo]bj/
[Bb]uild/ [Bb]uild/
[Bb]uilds/ [Bb]uilds/
Logs/
UserSettings/
Assets/AssetStoreTools* Assets/AssetStoreTools*
# Visual Studio cache directory # Visual Studio cache directory
.vs /.vs/
.idea
.vsconfig
/.vscode/
# Autogenerated VS/MD/Consulo solution and project files # Autogenerated VS/MD/Consulo solution and project files
ExportedObj/ ExportedObj/
...@@ -33,35 +38,36 @@ sysinfo.txt ...@@ -33,35 +38,36 @@ sysinfo.txt
# Builds # Builds
*.apk *.apk
*.unitypackage *.unitypackage
Temp/
ygopro.jks
AI_core_vs2017solution/bin/
AI_core_vs2017solution/obj/
AI_core_vs2017solution/build/android/libs/
AI_core_vs2017solution/build/android/obj/
# ygopro # ygopro
ai/ /ai
cdb/ /cdb
puzzle/ /data
texture/ /deck
update/ /expansions
cards.cdb /picture
lflist.conf /puzzle
strings.conf /replay
commamd.shell /script
AI_core_vs2017solution/core.VC.db /bin/
AI_core_vs2017solution/core.VC.VC.opendb /Release/
AI_core_vs2017solution/System.Servicemodel.Faltexception.dll /Debug/
[Ll]ibrary_/ /AI_core_vs2017solution/core.VC.db
Assets/StreamingAssets/update.zip* /AI_core_vs2017solution/core.VC.VC.opendb
commamd.shell /AI_core_vs2017solution/System.Servicemodel.Faltexception.dll
/[Ll]ibrary_/
/output /AI_core_vs2017solution/.vs
/Classes /commamd.shell
/Libraries /Windbot
/URLUtility.o /config/config.conf
/ygopro2-data/cdb /config/hosts.conf
/ygopro2-data/deck /config/lflist.conf
/ygopro2-data/picture /config/translation.conf
/ygopro2-data/pack /AI_core_vs2017solution/ocgcore
/AI_core_vs2017solution/sqlite3
/AI_core_vs2017solution/bin
/AI_core_vs2017solution/obj
/AI_core_vs2017solution/Release
/AI_core_vs2017solution/Debug
/AI_core_vs2017solution/lua
/pack
 using UnityEngine;
using UnityEngine;
using System.Collections;
public class AnimUnit : MonoBehaviour public class AnimUnit : MonoBehaviour
{ {
public float m_fspeed = 1; public float m_fspeed = 1;
private MegaWorldPathDeform m_kMWPD = null;
private MegaShapeArc m_kShapeArc = null;
private float m_fAccumAnimOffset = 0.0f; private float m_fAccumAnimOffset;
private float m_fArrowHeadLenth = 0.57f;
private readonly float m_fArrowHeadLenth = 0.57f;
//private float m_fRGB = 1/255.0f; //private float m_fRGB = 1/255.0f;
private float m_fHigh = 1.0f; //画线高度定值 --CardGame private readonly float m_fHigh = 1.0f; //画线高度定值 --CardGame
void Start() private MegaWorldPathDeform m_kMWPD;
private MegaShapeArc m_kShapeArc;
private void Start()
{ {
m_kMWPD = GetComponent<MegaWorldPathDeform> (); m_kMWPD = GetComponent<MegaWorldPathDeform>();
m_fAccumAnimOffset = m_kMWPD.Offset.z; m_fAccumAnimOffset = m_kMWPD.Offset.z;
//Debug.Log ("offset val is " + m_kAccumAnimOffset + " when init"); //Debug.Log ("offset val is " + m_kAccumAnimOffset + " when init");
...@@ -26,12 +25,11 @@ public class AnimUnit : MonoBehaviour ...@@ -26,12 +25,11 @@ public class AnimUnit : MonoBehaviour
//Color color = new Color(141* m_fRGB, m_fRGB, m_fRGB); //Color color = new Color(141* m_fRGB, m_fRGB, m_fRGB);
//this.gameObject.renderer.material.SetColor("_BlendColor",color); //this.gameObject.renderer.material.SetColor("_BlendColor",color);
this.gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha",0); gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha", 0);
} }
void Update() private void Update()
{ {
// float fnowoffset = m_kShapeArc.GetCurveLength (0) - m_fAccumAnimOffset; // float fnowoffset = m_kShapeArc.GetCurveLength (0) - m_fAccumAnimOffset;
// //
// float linelenth = (m_kShapeArc.GetCurveLength (0) - (m_fArrowHeadLenth*0.04f)/2 + 0.764f)/5; // float linelenth = (m_kShapeArc.GetCurveLength (0) - (m_fArrowHeadLenth*0.04f)/2 + 0.764f)/5;
...@@ -56,30 +54,16 @@ public class AnimUnit : MonoBehaviour ...@@ -56,30 +54,16 @@ public class AnimUnit : MonoBehaviour
} }
// void AlphaSet() private void FixedUpdate()
// {
// m_kShapeArc.GetCurveLength (0);
// }
public void SetAllAlphaZero()
{ {
this.gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha",0); if (m_kShapeArc == null) return;
}
void FixedUpdate()
{
if (m_kShapeArc == null)
{
return;
}
m_fAccumAnimOffset += -m_fspeed * Time.deltaTime; m_fAccumAnimOffset += -m_fspeed * Time.deltaTime;
//if (m_fAccumAnimOffset >= m_kShapeArc.GetCurveLength (0)-(m_fArrowHeadLenth*0.02f)/2 - 0.382f) //if (m_fAccumAnimOffset >= m_kShapeArc.GetCurveLength (0)-(m_fArrowHeadLenth*0.02f)/2 - 0.382f)
if (m_fAccumAnimOffset <= (m_fArrowHeadLenth*0.04f)/2 + 0.764f) if (m_fAccumAnimOffset <= m_fArrowHeadLenth * 0.04f / 2 + 0.764f)
{ {
//m_fAccumAnimOffset = 0.0f; //m_fAccumAnimOffset = 0.0f;
this.gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha",0); gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha", 0);
m_kShapeArc.GetComponent<LoopPathAnim>().moveToTail(m_kMWPD); m_kShapeArc.GetComponent<LoopPathAnim>().moveToTail(m_kMWPD);
} }
...@@ -105,36 +89,35 @@ public class AnimUnit : MonoBehaviour ...@@ -105,36 +89,35 @@ public class AnimUnit : MonoBehaviour
// } // }
float fnowoffset = m_kShapeArc.GetCurveLength (0) - m_fAccumAnimOffset; var fnowoffset = m_kShapeArc.GetCurveLength(0) - m_fAccumAnimOffset;
float linelenth = (m_fArrowHeadLenth*0.04f)/2 + 0.764f; var linelenth = m_fArrowHeadLenth * 0.04f / 2 + 0.764f;
if(fnowoffset>0&&fnowoffset<= m_fHigh) if (fnowoffset > 0 && fnowoffset <= m_fHigh)
{ {
this.gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha",fnowoffset/m_fHigh); gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha", fnowoffset / m_fHigh);
} }
else if(fnowoffset>m_fHigh && fnowoffset<=m_kShapeArc.GetCurveLength (0) - m_fHigh - linelenth) else if (fnowoffset > m_fHigh && fnowoffset <= m_kShapeArc.GetCurveLength(0) - m_fHigh - linelenth)
{ {
this.gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha",0.7f); gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha", 0.7f);
} }
else if(fnowoffset>m_kShapeArc.GetCurveLength (0) - m_fHigh - linelenth && fnowoffset<=m_kShapeArc.GetCurveLength (0)) else if (fnowoffset > m_kShapeArc.GetCurveLength(0) - m_fHigh - linelenth &&
fnowoffset <= m_kShapeArc.GetCurveLength(0))
{ {
float f = (1 - ((fnowoffset - m_kShapeArc.GetCurveLength(0) + m_fHigh + linelenth) / m_fHigh)) * 0.7f; var f = (1 - (fnowoffset - m_kShapeArc.GetCurveLength(0) + m_fHigh + linelenth) / m_fHigh) * 0.7f;
//if (f > 0.05f) //if (f > 0.05f)
//{ //{
// f = 1; // f = 1;
//} //}
this.gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha",f); gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha", f);
} }
else else
{ {
this.gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha",0); gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha", 0);
} }
//float linelenth = m_kShapeArc.GetCurveLength (0)/5; //float linelenth = m_kShapeArc.GetCurveLength (0)/5;
//设置alpha //设置alpha
// if(fnowoffset>0&&fnowoffset<= linelenth) // if(fnowoffset>0&&fnowoffset<= linelenth)
...@@ -155,6 +138,17 @@ public class AnimUnit : MonoBehaviour ...@@ -155,6 +138,17 @@ public class AnimUnit : MonoBehaviour
// } // }
} }
// void AlphaSet()
// {
// m_kShapeArc.GetCurveLength (0);
// }
public void SetAllAlphaZero()
{
gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha", 0);
}
public void setMegaShape(MegaShapeArc msa) public void setMegaShape(MegaShapeArc msa)
{ {
m_kShapeArc = msa; m_kShapeArc = msa;
...@@ -170,4 +164,3 @@ public class AnimUnit : MonoBehaviour ...@@ -170,4 +164,3 @@ public class AnimUnit : MonoBehaviour
m_fAccumAnimOffset = val; m_fAccumAnimOffset = val;
} }
} }
\ No newline at end of file
using UnityEngine; using UnityEngine;
using System.Collections;
public class LoopMegaCtrl : MonoBehaviour { public class LoopMegaCtrl : MonoBehaviour
{
public GameObject Path;
public int m_iID;
public GameObject m_kFirstOb;
public int m_iCount;
private bool m_bneedtoFollow = true;
private float m_fBeforeLenth;
private float m_ObjectLenth;
private float m_offsetpercent;
// Use this for initialization // Use this for initialization
private float m_offsetZ; private float m_offsetZ;
private float m_offsetpercent;
private float m_pathLenth; private float m_pathLenth;
public GameObject Path = null;
float m_ObjectLenth; private void Start()
float m_fBeforeLenth = 0.0f; {
public int m_iID;
public GameObject m_kFirstOb = null;
bool m_bneedtoFollow = true;
public int m_iCount = 0;
void Start () {
//物体长度 --CardGame //物体长度 --CardGame
m_ObjectLenth = 0.9f*0.02f; m_ObjectLenth = 0.9f * 0.02f;
//this.GetComponent<MegaWorldPathDeform>().animate = false; //this.GetComponent<MegaWorldPathDeform>().animate = false;
//this.GetComponent<MegaWorldPathDeform>().percent = 0; //this.GetComponent<MegaWorldPathDeform>().percent = 0;
} }
// Update is called once per frame // Update is called once per frame
void Update () { private void Update()
{
} }
void LateUpdate() private void LateUpdate()
{ {
LoopMegaAntmation(); LoopMegaAntmation();
} }
void LoopMegaAntmation() private void LoopMegaAntmation()
{ {
//if(m_offsetZ>0) //if(m_offsetZ>0)
//{ //{
//获得线段长度 --CardGame //获得线段长度 --CardGame
if(m_bneedtoFollow && m_kFirstOb!=null ) if (m_bneedtoFollow && m_kFirstOb != null)
{ {
this.GetComponent<MegaWorldPathDeform>().percent = m_kFirstOb.GetComponent<MegaWorldPathDeform>().percent; GetComponent<MegaWorldPathDeform>().percent = m_kFirstOb.GetComponent<MegaWorldPathDeform>().percent;
m_bneedtoFollow = false; m_bneedtoFollow = false;
} }
...@@ -51,8 +51,7 @@ public class LoopMegaCtrl : MonoBehaviour { ...@@ -51,8 +51,7 @@ public class LoopMegaCtrl : MonoBehaviour {
// } // }
m_pathLenth = Path.GetComponent<MegaShapeArc>().GetCurveLength(0);
m_pathLenth=Path.GetComponent<MegaShapeArc>().GetCurveLength(0);
// if(m_fBeforeLenth>m_pathLenth) // if(m_fBeforeLenth>m_pathLenth)
// { // {
...@@ -72,34 +71,28 @@ public class LoopMegaCtrl : MonoBehaviour { ...@@ -72,34 +71,28 @@ public class LoopMegaCtrl : MonoBehaviour {
// } // }
m_fBeforeLenth = m_pathLenth; m_fBeforeLenth = m_pathLenth;
m_offsetZ = -this.GetComponent<MegaWorldPathDeform>().Offset.z; m_offsetZ = -GetComponent<MegaWorldPathDeform>().Offset.z;
m_offsetpercent = ((m_ObjectLenth + m_offsetZ)/m_pathLenth)*100; m_offsetpercent = (m_ObjectLenth + m_offsetZ) / m_pathLenth * 100;
//Debug.Log(this.name+":" + m_offsetpercent); //Debug.Log(this.name+":" + m_offsetpercent);
this.GetComponent<MegaWorldPathDeform>().path = Path.GetComponent<MegaShapeArc>(); GetComponent<MegaWorldPathDeform>().path = Path.GetComponent<MegaShapeArc>();
if(this.GetComponent<MegaWorldPathDeform>().percent >= 100+m_offsetpercent) if (GetComponent<MegaWorldPathDeform>().percent >= 100 + m_offsetpercent)
{ {
//调整位置方法 --CardGame //调整位置方法 --CardGame
if(m_kFirstOb!=null) if (m_kFirstOb != null)
{ {
Debug.Log ("else follow first"); Debug.Log("else follow first");
this.GetComponent<MegaWorldPathDeform>().percent = m_kFirstOb.GetComponent<MegaWorldPathDeform>().percent; GetComponent<MegaWorldPathDeform>().percent = m_kFirstOb.GetComponent<MegaWorldPathDeform>().percent;
m_bneedtoFollow = true; m_bneedtoFollow = true;
} }
else else
{ {
Debug.Log ("first to 0"); Debug.Log("first to 0");
this.GetComponent<MegaWorldPathDeform>().percent = 0; GetComponent<MegaWorldPathDeform>().percent = 0;
} }
} }
} }
......
 using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class LoopPathAnim : MonoBehaviour public class LoopPathAnim : MonoBehaviour
{ {
// public GameObject m_kStartObject = null;
// public GameObject m_kEndObject = null;
private MegaShapeArc m_kShapeArc = null;
public List<MegaWorldPathDeform> m_kMWPD_List = public List<MegaWorldPathDeform> m_kMWPD_List =
new List<MegaWorldPathDeform>(); new List<MegaWorldPathDeform>();
public float m_fOffsetValueStep = 1.0f; public float m_fOffsetValueStep = 1.0f;
// public GameObject m_kStartObject = null;
// public GameObject m_kEndObject = null;
void Start () private MegaShapeArc m_kShapeArc;
private void Start()
{ {
m_kShapeArc = GetComponent<MegaShapeArc> (); m_kShapeArc = GetComponent<MegaShapeArc>();
// m_kStartObject.transform.position = m_kShapeArc.splines [0].knots [0].p; // m_kStartObject.transform.position = m_kShapeArc.splines [0].knots [0].p;
// m_kEndObject.transform.position = // m_kEndObject.transform.position =
// m_kShapeArc.splines [0].knots[ m_kShapeArc.splines [0].knots.Count-1 ].p; // m_kShapeArc.splines [0].knots[ m_kShapeArc.splines [0].knots.Count-1 ].p;
foreach(MegaWorldPathDeform iter in m_kMWPD_List) foreach (var iter in m_kMWPD_List)
{ if (iter.GetComponent<AnimUnit>())
if( iter.GetComponent<AnimUnit>() )
{
iter.GetComponent<AnimUnit>().setMegaShape(m_kShapeArc); iter.GetComponent<AnimUnit>().setMegaShape(m_kShapeArc);
//Debug.Log("set shaps..."); //Debug.Log("set shaps...");
} }
}
}
void Update () private void Update()
{ {
} }
void LateUpdate() private void LateUpdate()
{ {
// m_kShapeArc.splines [0].knots [0].p = m_kStartObject.transform.position; // m_kShapeArc.splines [0].knots [0].p = m_kStartObject.transform.position;
// //
...@@ -59,18 +48,14 @@ public class LoopPathAnim : MonoBehaviour ...@@ -59,18 +48,14 @@ public class LoopPathAnim : MonoBehaviour
//添加到箭头组成尾部 --CardGame //添加到箭头组成尾部 --CardGame
public void moveToTail(MegaWorldPathDeform mwpd) public void moveToTail(MegaWorldPathDeform mwpd)
{ {
if( m_kMWPD_List.Contains(mwpd) ) if (m_kMWPD_List.Contains(mwpd))
{ {
float val = var val =
m_kMWPD_List[m_kMWPD_List.Count-1]. m_kMWPD_List[m_kMWPD_List.Count - 1].GetComponent<AnimUnit>().getAccumOffset() + m_fOffsetValueStep;
GetComponent<AnimUnit>().getAccumOffset() + m_fOffsetValueStep;
mwpd.GetComponent<AnimUnit>().setAccumOffset(val); mwpd.GetComponent<AnimUnit>().setAccumOffset(val);
m_kMWPD_List.Remove(mwpd); m_kMWPD_List.Remove(mwpd);
m_kMWPD_List.Add(mwpd); m_kMWPD_List.Add(mwpd);
} }
} }
} }
\ No newline at end of file
using UnityEngine; using UnityEngine;
using System.Collections;
public class RendMega : MonoBehaviour {
public class RendMega : MonoBehaviour
{
public Vector3 StartPosition = Vector3.zero; public Vector3 StartPosition = Vector3.zero;
public Vector3 FingerPosition = Vector3.zero; public Vector3 FingerPosition = Vector3.zero;
public Transform SkillPosition = null; public Transform SkillPosition;
public Transform SkillPositionForm = null; public Transform SkillPositionForm;
public GameObject m_kPath = null; public GameObject m_kPath;
public float k = 3f; public float k = 3f;
// Use this for initialization // Use this for initialization
void Start () { private void Start()
{
} }
// Update is called once per frame // Update is called once per frame
void Update() private void Update()
{ {
MyRenderPath(); MyRenderPath();
} }
public void MyRenderPath() public void MyRenderPath()
{ {
m_kPath.transform.localScale = new Vector3(k, k, k); m_kPath.transform.localScale = new Vector3(k, k, k);
Vector3 v3FromPos = SkillPosition.position/k; var v3FromPos = SkillPosition.position / k;
Vector3 v3TargetPos = SkillPositionForm.position/k; var v3TargetPos = SkillPositionForm.position / k;
Vector3 v3MidPos = (v3FromPos + v3TargetPos)/2; var v3MidPos = (v3FromPos + v3TargetPos) / 2;
v3MidPos += new Vector3(0, Vector3.Distance(v3TargetPos, v3FromPos) / 10f * 3f, 0); v3MidPos += new Vector3(0, Vector3.Distance(v3TargetPos, v3FromPos) / 10f * 3f, 0);
v3MidPos += (v3TargetPos - v3FromPos) / 10f * 3f; v3MidPos += (v3TargetPos - v3FromPos) / 10f * 3f;
Vector3 V3Midvect = (v3TargetPos - v3FromPos)/4; var V3Midvect = (v3TargetPos - v3FromPos) / 4;
Vector3 v3FromAnchorIn = v3FromPos+new Vector3(0,-(v3MidPos.y/3),0) ; var v3FromAnchorIn = v3FromPos + new Vector3(0, -(v3MidPos.y / 3), 0);
//Vector3 v3FromAnchorOut = v3FromPos+new Vector3(0,(v3MidPos.y/3),0) ; //Vector3 v3FromAnchorOut = v3FromPos+new Vector3(0,(v3MidPos.y/3),0) ;
Vector3 v3FromAnchorOut = v3FromPos + V3Midvect; var v3FromAnchorOut = v3FromPos + V3Midvect;
//Vector3 v3TarGetAnchorIn = v3TargetPos +new Vector3(0,(v3MidPos.y/3),0) ; //Vector3 v3TarGetAnchorIn = v3TargetPos +new Vector3(0,(v3MidPos.y/3),0) ;
Vector3 v3TarGetAnchorIn = v3TargetPos + new Vector3(0, (v3MidPos.y / 3), 0) - V3Midvect/10; var v3TarGetAnchorIn = v3TargetPos + new Vector3(0, v3MidPos.y / 3, 0) - V3Midvect / 10;
Vector3 v3TarGetAnchorOut = v3TargetPos + new Vector3(0, -(v3MidPos.y / 3), 0); var v3TarGetAnchorOut = v3TargetPos + new Vector3(0, -(v3MidPos.y / 3), 0);
Vector3 v3MidAnchorIn = v3MidPos - V3Midvect;
Vector3 v3MidAnchorOut = v3MidPos + V3Midvect ;
var v3MidAnchorIn = v3MidPos - V3Midvect;
var v3MidAnchorOut = v3MidPos + V3Midvect;
m_kPath.GetComponent<MegaShapeArc>().SetKnotEx(0,0,v3FromPos,v3FromAnchorIn,v3FromAnchorOut);
m_kPath.GetComponent<MegaShapeArc>().SetKnotEx(0,1,v3MidPos,v3MidAnchorIn,v3MidAnchorOut);
m_kPath.GetComponent<MegaShapeArc>().SetKnotEx(0,2,v3TargetPos,v3TarGetAnchorIn,v3TarGetAnchorOut);
m_kPath.GetComponent<MegaShapeArc>().SetKnot(0, 0, v3FromPos, v3FromAnchorIn, v3FromAnchorOut);
m_kPath.GetComponent<MegaShapeArc>().SetKnot(0, 1, v3MidPos, v3MidAnchorIn, v3MidAnchorOut);
m_kPath.GetComponent<MegaShapeArc>().SetKnot(0, 2, v3TargetPos, v3TarGetAnchorIn, v3TarGetAnchorOut);
} }
} }
\ No newline at end of file
using UnityEngine; using UnityEngine;
using System.Collections;
public class arrowCtrl : MonoBehaviour {
public class arrowCtrl : MonoBehaviour
{
public GameObject[] m_karrow; public GameObject[] m_karrow;
// Use this for initialization
void Start () {
// Use this for initialization
private void Start()
{
} }
public void AllAlphaZero() public void AllAlphaZero()
{ {
for(int i = 0;i<m_karrow.Length;i++) for (var i = 0; i < m_karrow.Length; i++)
{ if (m_karrow[i].GetComponent<AnimUnit>() != null)
if(m_karrow[i].GetComponent<AnimUnit>()!=null)
{
m_karrow[i].GetComponent<AnimUnit>().SetAllAlphaZero(); m_karrow[i].GetComponent<AnimUnit>().SetAllAlphaZero();
} }
}
}
} }
\ No newline at end of file
using UnityEngine; using UnityEngine;
using System.Collections;
public class blinding : MonoBehaviour {
public class blinding : MonoBehaviour
{
// Use this for initialization // Use this for initialization
void Start () { private void Start()
{
} }
// Update is called once per frame // Update is called once per frame
void Update () { private void Update()
this.gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha", (1f + Mathf.Sin(Time.time*10)) / 2f); {
gameObject.GetComponent<Renderer>().material.SetFloat("_Alpha", (1f + Mathf.Sin(Time.time * 10)) / 2f);
} }
} }
\ No newline at end of file
fileFormatVersion: 2
guid: b71b024f995aa0843a87af2b3fae595e
folderAsset: yes
timeCreated: 1482167356
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3a855b0cdc26a8240b3c8c14654239cd
folderAsset: yes
timeCreated: 1482163012
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
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:

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MegaPush))]
public class MegaPushEditor : MegaModifierEditor
{
public override string GetHelpString() { return "Push Modifier by Chris West"; }
public override Texture LoadImage() { return (Texture)EditorGUIUtility.LoadRequired("MegaFiers/push_help.png"); }
public override bool Inspector()
{
MegaPush mod = (MegaPush)target;
EditorGUIUtility.LookLikeControls();
mod.amount = EditorGUILayout.FloatField("Amount", mod.amount);
mod.method = (MegaNormType)EditorGUILayout.EnumPopup("Method", mod.method);
return false;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 68e5680e4c4f617479828a66038f98ed
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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