// Checks if a Component that can be animated with the given animationType is attached to the src bool Validate() { if (_src.animationType == GA.DOTweenAnimationType.None) { return(false); } Component srcTarget; // First check for external plugins #if DOTWEEN_TK2D if (_Tk2dAnimationTypeToComponent.ContainsKey(_src.animationType)) { foreach (Type t in _Tk2dAnimationTypeToComponent[_src.animationType]) { srcTarget = _src.GetComponent(t); if (srcTarget != null) { _src.target = srcTarget; _src.targetType = DOTweenAnimation.TypeToDOTargetType(t); return(true); } } } #endif #if DOTWEEN_TMP if (_TMPAnimationTypeToComponent.ContainsKey(_src.animationType)) { foreach (Type t in _TMPAnimationTypeToComponent[_src.animationType]) { srcTarget = _src.GetComponent(t); if (srcTarget != null) { _src.target = srcTarget; _src.targetType = DOTweenAnimation.TypeToDOTargetType(t); return(true); } } } #endif // Then check for regular stuff if (_AnimationTypeToComponent.ContainsKey(_src.animationType)) { foreach (Type t in _AnimationTypeToComponent[_src.animationType]) { srcTarget = _src.GetComponent(t); if (srcTarget != null) { _src.target = srcTarget; _src.targetType = GalaxyDOTweenAnimation.TypeToDOTargetType(t); return(true); } } } return(false); }
void OnEnable() { _src = target as GalaxyDOTweenAnimation; _animTrigger = serializedObject.FindProperty("animTrigger"); _triggerStr = serializedObject.FindProperty("triggerStr"); onStartProperty = base.serializedObject.FindProperty("onStart"); onPlayProperty = base.serializedObject.FindProperty("onPlay"); onUpdateProperty = base.serializedObject.FindProperty("onUpdate"); onStepCompleteProperty = base.serializedObject.FindProperty("onStepComplete"); onCompleteProperty = base.serializedObject.FindProperty("onComplete"); onRewindProperty = base.serializedObject.FindProperty("onRewind"); onTweenCreatedProperty = base.serializedObject.FindProperty("onTweenCreated"); // Convert _AnimationType to _animationTypeNoSlashes int len = _AnimationType.Length; _animationTypeNoSlashes = new string[len]; for (int i = 0; i < len; ++i) { string a = _AnimationType[i]; a = a.Replace("/", ""); _animationTypeNoSlashes[i] = a; } }