|
|
@ -1,6 +1,11 @@ |
|
|
|
/*This script has been, partially or completely, generated by the Fungus.GenerateVariableWindow*/ |
|
|
|
/*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 |
|
|
|
namespace Fungus |
|
|
|
{ |
|
|
|
{ |
|
|
@ -39,11 +44,10 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
[SerializeField] |
|
|
|
protected Property property; |
|
|
|
protected Property property = Property.Position; |
|
|
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
[SerializeField] |
|
|
|
[VariableProperty(typeof(TransformVariable))] |
|
|
|
protected TransformData transformData; |
|
|
|
protected TransformVariable transformVar; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
[SerializeField] |
|
|
|
[VariableProperty(typeof(Vector3Variable), |
|
|
|
[VariableProperty(typeof(Vector3Variable), |
|
|
@ -63,8 +67,7 @@ namespace Fungus |
|
|
|
var ioi = inOutVar as IntegerVariable; |
|
|
|
var ioi = inOutVar as IntegerVariable; |
|
|
|
var iob = inOutVar as BooleanVariable; |
|
|
|
var iob = inOutVar as BooleanVariable; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var target = transformData.Value; |
|
|
|
var target = transformVar.Value; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (getOrSet) |
|
|
|
switch (getOrSet) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -132,7 +135,6 @@ namespace Fungus |
|
|
|
Debug.Log("Unsupported get or set attempted"); |
|
|
|
Debug.Log("Unsupported get or set attempted"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case GetSet.Set: |
|
|
|
case GetSet.Set: |
|
|
|
switch (property) |
|
|
|
switch (property) |
|
|
@ -180,7 +182,6 @@ namespace Fungus |
|
|
|
Debug.Log("Unsupported get or set attempted"); |
|
|
|
Debug.Log("Unsupported get or set attempted"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
@ -191,15 +192,17 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
public override string GetSummary() |
|
|
|
public override string GetSummary() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (transformVar == null) |
|
|
|
if (transformData.Value == null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return "Error: no transformVar set"; |
|
|
|
return "Error: no transform set"; |
|
|
|
} |
|
|
|
} |
|
|
|
if (inOutVar == null) |
|
|
|
if (inOutVar == null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return "Error: no variable set to push or pull data to or from"; |
|
|
|
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(); |
|
|
|
return getOrSet.ToString() + " " + property.ToString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -210,7 +213,7 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
public override bool HasReference(Variable variable) |
|
|
|
public override bool HasReference(Variable variable) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (transformVar == variable || inOutVar == variable) |
|
|
|
if (transformData.transformRef == variable || inOutVar == variable) |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|