From c6c82dbb446b461f2865e963e5cf3e713b328eab Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Thu, 11 Sep 2014 13:09:13 +0100 Subject: [PATCH] Reverted variables back to MonoBehavior --- Assets/Example/Scenes/Example.unity | Bin 124300 -> 124308 bytes .../FungusScript/Editor/FungusScriptEditor.cs | 2 +- Assets/Fungus/FungusScript/Editor/IfEditor.cs | 2 +- .../Fungus/FungusScript/Scripts/Variable.cs | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Example/Scenes/Example.unity b/Assets/Example/Scenes/Example.unity index 0093cd73af0489a16f002b6779566ad9993f3cb9..caf5b82c853d69463b2dde93657335e6cecd53b8 100644 GIT binary patch delta 8951 zcmb7}3tUxI_Q&^DKl8=${g=Kmz9nnF=LIp*^2ZFCeMK2U6724Gc zZd6pL92rxCu6mhDBp*qdhLuW_8op+%$q9Q&lf?Y?KIgzWGynPgXZW}|_k7RVYp=cb zZ?AnW=AH4&KjY`mDE4_qxAM#Vds^HhF0b--%?=K8KV*5_-<4zwbH6(5C2yB0%h%P- z_O!e3!FRk}l?&Ut`aQVN^>N>@@+dqk9^>np+;@%ZSa_KGAAPHRTmy%Mxo5;&@Y>w^ zpsVIxKlhr!hsl*Vti}4y&=szeqlE9@`nZ;Ka-LTzJXt46GDv89M%=vg2U3){Ld$d85isfH}cJz^&x)%@uHeKiMCRia@9N0h9U~Yjm zfJK9OV|@I=!@s&rQSBI8sq6d;SPhsynES%6J!5&W`&o6^2v!FsGSi^4U%|pV7z2EK z@vr76uxYw6hB^St0F`KzV1|MD2QU^3LoMo#e|)xMJea<-1*{58-?tN()x=mj`hKQ1 z-*3t-PB49D{J`qL9Ac1rYSjLKcC*ppXJ;xc#bCu)qp!S_)_Lu(mPm`yVHdDsFnusq zum&)FF!`C|I;VAFY#zpiONU(h0>C=JeSmdp+XChcG_E@bW1Wp@?Oi`1$OcxX3-F|raKa=?IWg!v4jLp$? zP5>(g)9Ygvm@R~{T-a&)mC%8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QV^Bbad?csB=&0X$C~m^qt|8kLQN#$_WP!3;mg;E|h+ z>4VwcZ0dl=k!+fZN6)!PM+h4^SM}hTKNs1i)}DLw$m4?yMpe*Ic6R|X9?GI}=p#H% z=TK)hZxOuvEhMLZD0b!rb|!~9YVg!TD&%l5+qRhcvsH_z8}AR{M#$v3MTF$Amlo4_ z{vw`zry91cLMH#Rn9Ll$tXW%FnO-t$TOc`sHWLdSxC2iF#q1=5C`^c#Y6XrEB+Vvr7Qo_#UyV<-A6z$o(p1eM6-VUU_U;}mYLs)ya zU}Pw3vy}%qd8-~|`D+vjksR0xC4{rCC9n!-`6cRW3};m(^el$`Sc1v{C#6E8quFQM zsUyVObsNp*xfsKV(EK*a;BcG-XKtqixHzy~o7uwtv0WUO*EFm2<5*eE`{H;cOG6`f zP%QU1fkTQ?PeDgN_5WhAtZ5X@%t_*yq-q8hc54S0ahDGsmX9SL{I}&JZ|6f1*Y5mJ zD(kt6t1M*~FDCEqA~z~wTp4M(awG}$rswbJTUBqUH&cdS5(rQY1dJa$>_k2yxs zy#J=wuh9EBEbj!~b0?NM;bf8Ko_`OL>!^v3T%y5#l@K^D>&uP{y}l)xpE@p1jpLUg zW}Oh;-{x(cBh^Y#sH=Eazg-2GX zITU(wp2UYfkfofWV@O%o)AT@n)bomwTd(K1qMj1@;1w*dp69sdpQwbBRh)>gVFNih zbV~4(29eCQ5{x`UHf~uY!J;!__+B4pi*3Q9%rY{@lt{N zj(TPJFFuyI>WFKKdL2nQ&+ExbTw2du|}Xg;5uhWL}}?_`7n}{tESCjaMicIPNM9{J$!Eh34U# wt722D)KPueh-*TW)ojjXWaIEPvU0C~(E1fsfSs>XPYyrPAU}`=*QxEl0kABwasU7T diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs index ea71ff8e..aefe5caa 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs @@ -127,7 +127,7 @@ namespace Fungus } Undo.RecordObject(fungusScript, "Add Variable"); - T newVariable = ScriptableObject.CreateInstance(); + T newVariable = fungusScript.gameObject.AddComponent(); newVariable.key = fungusScript.GetUniqueVariableKey(""); fungusScript.variables.Add(newVariable); } diff --git a/Assets/Fungus/FungusScript/Editor/IfEditor.cs b/Assets/Fungus/FungusScript/Editor/IfEditor.cs index aa560dc0..6dd6c829 100644 --- a/Assets/Fungus/FungusScript/Editor/IfEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/IfEditor.cs @@ -50,7 +50,7 @@ namespace Fungus return; } - Variable selectedVariable = (Variable)variableProp.objectReferenceValue; + Variable selectedVariable = variableProp.objectReferenceValue as Variable; System.Type variableType = selectedVariable.GetType(); List operatorList = new List(); diff --git a/Assets/Fungus/FungusScript/Scripts/Variable.cs b/Assets/Fungus/FungusScript/Scripts/Variable.cs index b78f45b9..de5e70bf 100644 --- a/Assets/Fungus/FungusScript/Scripts/Variable.cs +++ b/Assets/Fungus/FungusScript/Scripts/Variable.cs @@ -18,7 +18,7 @@ namespace Fungus Global } - public class Variable : ScriptableObject + public class Variable : MonoBehaviour { public VariableScope scope; public string key = "";