Browse Source

Partial Revert of TransformProperty

master
Steve Halliwell 5 years ago
parent
commit
14a242146a
  1. 25
      Assets/Fungus/Scripts/Commands/Property/TransformProperty.cs
  2. 5
      Assets/Fungus/Scripts/Commands/Property/TransformProperty.cs.meta

25
Assets/Fungus/Scripts/Commands/Property/TransformProperty.cs

@ -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;

5
Assets/Fungus/Scripts/Commands/Property/TransformProperty.cs.meta

@ -1,7 +1,8 @@
fileFormatVersion: 2
guid: f9c3eb9160fdceb448b5e55362ac1ee4
guid: 2fb064de1b711a449845627f19b7f7b1
timeCreated: 1504942828
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0

Loading…
Cancel
Save