Browse Source

Partial Revert of TransformProperty

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

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

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

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

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

Loading…
Cancel
Save