public override void Play(object target) { if (_played) { return; } _played = true; #if DEBUG if (DebugMode) { Debug.Log(string.Format("SetProperty.Play {0}, {1}, {2}", Target, Property, Value)); } #endif //object val; //if (Relative) // val = ReflectionUtil.GetValue(Target, Property) + Value; //else // val = Value; CoreReflector.SetValue(Target, Property, Value); //if (IsChild) //{ // //Parent.FinishedCount++; // Parent.Count--; //} }
/// <summary> /// Used for deffered parts /// </summary> /// <param name="e"></param> private void SkinPropertyChangeHandler(Event e) { if (null != SkinParts) { PropertyChangeEvent pce = (PropertyChangeEvent)e; string skinPartID = pce.Property; if (SkinParts.ContainsKey(skinPartID)) { var part = CoreReflector.GetValue(Skin, skinPartID); if (pce.NewValue == null) { if (!(part is IFactory)) { PartRemoved(skinPartID, part); } CoreReflector.SetValue(this, skinPartID, pce.NewValue); } else { part = pce.NewValue; if (!(part is IFactory)) { PartAdded(skinPartID, part); } } } } }
private void ClearSkinParts() { if (null == _thisType) // not yet added { return; } var partDict = SkinPartCache.Instance.Get(_thisType); if (null != partDict) { foreach (var id in partDict.Keys) { var p = CoreReflector.GetValue(this, id); if (!(p is IFactory)) { PartRemoved(id, p); } else { //var len:int = numDynamicParts(id); //for (var j:int = 0; j < len; j++) // removeDynamicPartInstance(id, getDynamicPartAt(id, j)); } CoreReflector.SetValue(this, id, null); } } }
public FadeInUp2() { Name = "Fade in up"; Add( new SetProperty("Visible", true) { Name = "Setting Visible" }, new SetProperty("Alpha", 0f) { Name = "Setting Alpha" }, new SetPropertyFunc(delegate(object target) { CoreReflector.SetValue(target, "Y", (float)CoreReflector.GetValue(target, "Y") + Offset * 2); }), new Sequence( new Parallel( new Tween { Property = "Alpha", Duration = 0.3f, Easer = Linear.EaseIn, StartValue = 0f, //StartValueReader = new PropertyReader("Alpha"), EndValue = 1f }, new Tween { Property = "Y", Duration = 0.5f, Easer = Expo.EaseOut, StartValueReaderFunction = StartValueReaderFunc, EndValueReaderFunction = EndValueReaderFunc } ), new Tween { Property = "Y", Duration = 0.5f, Easer = Expo.EaseInOut, StartValueReaderFunction = StartValueReaderFunc, EndValueReaderFunction = EndValueReaderFunc } ) //new Action(delegate { Debug.Log("Finished"); }) ); }
public override void Play() { #if DEBUG if (DebugMode) { Debug.Log(string.Format("SetProperty.Play {0}, {1}, {2}", Target, Property, Value)); } #endif CoreReflector.SetValue(Target, Property, Value); //if (IsChild) //{ // //Parent.FinishedCount++; // Parent.Count--; //} //if (DestroyOnFinish) // Destroy(); }