|
|
|
@ -1,6 +1,11 @@
|
|
|
|
|
/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ |
|
|
|
|
using UnityEngine; |
|
|
|
|
|
|
|
|
|
// This code is part of the Fungus library (https://github.com/snozbot/fungus) |
|
|
|
|
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) |
|
|
|
|
|
|
|
|
|
using System.Collections; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using UnityEngine; |
|
|
|
|
|
|
|
|
|
namespace Fungus |
|
|
|
|
{ |
|
|
|
@ -39,11 +44,10 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
|
protected Property property; |
|
|
|
|
|
|
|
|
|
protected Property property = Property.Position; |
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
|
[VariableProperty(typeof(TransformVariable))] |
|
|
|
|
protected TransformVariable transformVar; |
|
|
|
|
protected TransformData transformData; |
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
|
[VariableProperty(typeof(Vector3Variable), |
|
|
|
@ -63,8 +67,7 @@ namespace Fungus
|
|
|
|
|
var ioi = inOutVar as IntegerVariable; |
|
|
|
|
var iob = inOutVar as BooleanVariable; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var target = transformVar.Value; |
|
|
|
|
var target = transformData.Value; |
|
|
|
|
|
|
|
|
|
switch (getOrSet) |
|
|
|
|
{ |
|
|
|
@ -132,7 +135,6 @@ namespace Fungus
|
|
|
|
|
Debug.Log("Unsupported get or set attempted"); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
case GetSet.Set: |
|
|
|
|
switch (property) |
|
|
|
@ -180,7 +182,6 @@ namespace Fungus
|
|
|
|
|
Debug.Log("Unsupported get or set attempted"); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
@ -191,15 +192,17 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
public override string GetSummary() |
|
|
|
|
{ |
|
|
|
|
if (transformVar == null) |
|
|
|
|
if (transformData.Value == null) |
|
|
|
|
{ |
|
|
|
|
return "Error: no transformVar set"; |
|
|
|
|
return "Error: no transform set"; |
|
|
|
|
} |
|
|
|
|
if (inOutVar == null) |
|
|
|
|
{ |
|
|
|
|
return "Error: no variable set to push or pull data to or from"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//We could do further checks here, eg, you have selected childcount but set a vec3variable |
|
|
|
|
|
|
|
|
|
return getOrSet.ToString() + " " + property.ToString(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -210,7 +213,7 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
public override bool HasReference(Variable variable) |
|
|
|
|
{ |
|
|
|
|
if (transformVar == variable || inOutVar == variable) |
|
|
|
|
if (transformData.transformRef == variable || inOutVar == variable) |
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|