diff --git a/Assets/Demo/scripts/FPSHUD.cs b/Assets/Demo/scripts/FPSHUD.cs index 030cc50..7cdee9f 100644 --- a/Assets/Demo/scripts/FPSHUD.cs +++ b/Assets/Demo/scripts/FPSHUD.cs @@ -33,7 +33,7 @@ void Awake() void Start() { - if( !guiText ) + if( !GetComponent() ) { Debug.Log("UtilityFramesPerSecond needs a GUIText component!"); enabled = false; @@ -55,18 +55,18 @@ void Update() // display two fractional digits (f2 format) float fps = accum/frames; string format = System.String.Format("{0:F2} FPS",fps); - guiText.text = format; + GetComponent().text = format; if( fps < 20 ) { - guiText.material.color = Color.yellow; + GetComponent().material.color = Color.yellow; } else { if( fps < 10 ) - guiText.material.color = Color.red; + GetComponent().material.color = Color.red; else - guiText.material.color = Color.green; + GetComponent().material.color = Color.green; timeleft = updateInterval; accum = 0.0F; diff --git a/Assets/Plugins/GoKit/Go.cs b/Assets/Plugins/GoKit/Go.cs index 94fadb6..0818022 100644 --- a/Assets/Plugins/GoKit/Go.cs +++ b/Assets/Plugins/GoKit/Go.cs @@ -363,6 +363,39 @@ public static bool removeTween( AbstractGoTween tween ) return false; } + /// + /// removes the Tween with specific tag + /// + public static void removeTweenWithTag( string tag ) + { + List tweenList = tweensWithTag( tag ); + if( tweenList != null ) + { + foreach( var tween in tweenList ) + { + removeTween( tween ); + } + } + } + + /// + /// returns a list of all Tweens, TweenChains and TweenFlows with the given tag + /// + public static List tweensWithTag( string tag ) + { + List list = null; + foreach( var tween in _tweens ) + { + if( tween.tag == tag ) + { + if( list == null ) + list = new List(); + list.Add( tween ); + } + } + + return list; + } /// /// returns a list of all Tweens, TweenChains and TweenFlows with the given id diff --git a/Assets/Plugins/GoKit/GoProxyProp.cs b/Assets/Plugins/GoKit/GoProxyProp.cs new file mode 100644 index 0000000..32decf4 --- /dev/null +++ b/Assets/Plugins/GoKit/GoProxyProp.cs @@ -0,0 +1,14 @@ +using UnityEngine; +using System.Collections; + +public class GoProxyProp +{ + + public T value { get; set; } + + public GoProxyProp( T startValue ) + { + value = startValue; + } + +} diff --git a/Assets/Plugins/GoKit/base/AbstractGoTween.cs b/Assets/Plugins/GoKit/base/AbstractGoTween.cs index d3ad6f3..586a072 100644 --- a/Assets/Plugins/GoKit/base/AbstractGoTween.cs +++ b/Assets/Plugins/GoKit/base/AbstractGoTween.cs @@ -10,7 +10,8 @@ /// public abstract class AbstractGoTween { - public int id = 0; // optional id used for identifying this tween + public int id { get; set; } // optional id used for identifying this tween + public string tag { get; set; } // optional tag used for identifying this tween public GoTweenState state { get; protected set; } // current state of the tween public float duration { get; protected set; } // duration for a single loop public float totalDuration { get; protected set; } // duration for all loops of this tween diff --git a/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialColorTweenProperty.cs b/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialColorTweenProperty.cs index 5e8ff26..b11b778 100644 --- a/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialColorTweenProperty.cs +++ b/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialColorTweenProperty.cs @@ -33,9 +33,9 @@ public override void init( GoTween owner ) if( owner.target is Material ) _target = (Material)owner.target; else if( owner.target is GameObject ) - _target = ((GameObject)owner.target).renderer.material; + _target = ((GameObject)owner.target).GetComponent().material; else if( owner.target is Transform ) - _target = ((Transform)owner.target).renderer.material; + _target = ((Transform)owner.target).GetComponent().material; else if( owner.target is Renderer ) _target = ((Renderer)owner.target).material; diff --git a/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialFloatTweenProperty.cs b/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialFloatTweenProperty.cs index 87ef6a1..989486a 100644 --- a/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialFloatTweenProperty.cs +++ b/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialFloatTweenProperty.cs @@ -33,9 +33,9 @@ public override void init( GoTween owner ) if( owner.target is Material ) _target = (Material)owner.target; else if( owner.target is GameObject ) - _target = ((GameObject)owner.target).renderer.material; + _target = ((GameObject)owner.target).GetComponent().material; else if( owner.target is Transform ) - _target = ((Transform)owner.target).renderer.material; + _target = ((Transform)owner.target).GetComponent().material; else if( owner.target is Renderer ) _target = ((Renderer)owner.target).material; diff --git a/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialVectorTweenProperty.cs b/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialVectorTweenProperty.cs index a82710c..0cc9308 100644 --- a/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialVectorTweenProperty.cs +++ b/Assets/Plugins/GoKit/properties/abstracts/AbstractMaterialVectorTweenProperty.cs @@ -33,9 +33,9 @@ public override void init( GoTween owner ) if( owner.target is Material ) _target = (Material)owner.target; else if( owner.target is GameObject ) - _target = ((GameObject)owner.target).renderer.material; + _target = ((GameObject)owner.target).GetComponent().material; else if( owner.target is Transform ) - _target = ((Transform)owner.target).renderer.material; + _target = ((Transform)owner.target).GetComponent().material; else if( owner.target is Renderer ) _target = ((Renderer)owner.target).material; diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index 91be959..d75e792 100644 Binary files a/ProjectSettings/GraphicsSettings.asset and b/ProjectSettings/GraphicsSettings.asset differ diff --git a/ProjectSettings/NavMeshAreas.asset b/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 0000000..53da2ee Binary files /dev/null and b/ProjectSettings/NavMeshAreas.asset differ diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index cbb17ef..307c0ca 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ