/// <summary> /// Changes the Type of the tween's target. Don't worry about performance, this method /// is only called inside the Editor. /// </summary> private void SetNewTarget() { if (tweenData is RectTween && !(target is UniTweenTarget <RectTransform>)) { target = new UniTweenTarget <RectTransform>(); } else if (tweenData is CanvasGroupTween && !(target is UniTweenTarget <CanvasGroup>)) { target = new UniTweenTarget <CanvasGroup>(); } else if (tweenData is TransformTween && !(target is UniTweenTarget <Transform>)) { target = new UniTweenTarget <Transform>(); } else if (tweenData is ImageTween && !(target is UniTweenTarget <Image>)) { target = new UniTweenTarget <Image>(); } else if (tweenData is TextTween && !(target is UniTweenTarget <Text>)) { target = new UniTweenTarget <Text>(); } else if (tweenData is SpriteRendererTween && !(target is UniTweenTarget <SpriteRenderer>)) { target = new UniTweenTarget <SpriteRenderer>(); } else if (tweenData is RigidbodyTween && !(target is UniTweenTarget <Rigidbody>)) { target = new UniTweenTarget <Rigidbody>(); } else if (tweenData is Rigidbody2DTween && !(target is UniTweenTarget <Rigidbody2D>)) { target = new UniTweenTarget <Rigidbody2D>(); } else if (tweenData is LightTween && !(target is UniTweenTarget <Light>)) { target = new UniTweenTarget <Light>(); } else if (tweenData is MaterialTween && !(target is UniTweenTarget <Material>)) { target = new UniTweenTarget <MeshRenderer>(); } else if (tweenData is AudioMixerTween && !(target is UniTweenTarget <AudioMixer>)) { target = new UniTweenTarget <AudioMixer>(); } else if (tweenData is AudioSourceTween && !(target is UniTweenTarget <AudioSource>)) { target = new UniTweenTarget <AudioSource>(); } else if (tweenData is CameraTween && !(target is UniTweenTarget <Camera>)) { target = new UniTweenTarget <Camera>(); } else if (tweenData is OutlineTween && !(target is UniTweenTarget <Outline>)) { target = new UniTweenTarget <Outline>(); } else if (tweenData is LineRendererTween && !(target is UniTweenTarget <LineRenderer>)) { target = new UniTweenTarget <LineRenderer>(); } else if (tweenData is TrailRendererTween && !(target is UniTweenTarget <TrailRenderer>)) { target = new UniTweenTarget <TrailRenderer>(); } else if (tweenData is GraphicTween && !(target is UniTweenTarget <Graphic>)) { target = new UniTweenTarget <Graphic>(); } else if (tweenData is SliderTween && !(target is UniTweenTarget <Slider>)) { target = new UniTweenTarget <Slider>(); } else if (tweenData is ScrollRectTween && !(target is UniTweenTarget <ScrollRect>)) { target = new UniTweenTarget <ScrollRect>(); } else if (tweenData is LayoutElementTween && !(target is UniTweenTarget <LayoutElement>)) { target = new UniTweenTarget <LayoutElement>(); } else if (tweenData is ParticleSystemTween && !(target is UniTweenTarget <ParticleSystem>)) { target = new UniTweenTarget <ParticleSystem>(); } #if UNITWEEN_TEXTMESH else if (tweenData is TextMeshProUGUITween && !(target is UniTweenTarget <TMPro.TextMeshProUGUI>)) { target = new UniTweenTarget <TMPro.TextMeshProUGUI>(); } else if (tweenData is TextMeshProTween && !(target is UniTweenTarget <TMPro.TextMeshPro>)) { target = new UniTweenTarget <TMPro.TextMeshPro>(); } #endif #if UNITY_POST_PROCESSING_STACK_V2 else if (tweenData is PostProcessVolumeTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } else if (tweenData is PPVignetteTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } else if (tweenData is PPChromaticAberrationTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } else if (tweenData is PPBloomTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } else if (tweenData is PPGrainTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } else if (tweenData is PPDepthOfFieldTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } else if (tweenData is PPLensDistortionTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } else if (tweenData is PPMotionBlurTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } else if (tweenData is PPScreenSpaceReflectionsTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } else if (tweenData is PPAmbientOcclusionTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } else if (tweenData is PPColorGradingTween && !(target is UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>)) { target = new UniTweenTarget <UnityEngine.Rendering.PostProcessing.PostProcessVolume>(); } #endif }
private void SetNewTarget() { if (tweenData is RectTween && !(target is UniTweenTarget <RectTransform>)) { target = new UniTweenTarget <RectTransform>(); } else if (tweenData is CanvasGroupTween && !(target is UniTweenTarget <CanvasGroup>)) { target = new UniTweenTarget <CanvasGroup>(); } else if (tweenData is TransformTween && !(target is UniTweenTarget <Transform>)) { target = new UniTweenTarget <Transform>(); } else if (tweenData is ImageTween && !(target is UniTweenTarget <Image>)) { target = new UniTweenTarget <Image>(); } else if (tweenData is TextTween && !(target is UniTweenTarget <Text>)) { target = new UniTweenTarget <Text>(); } else if (tweenData is SpriteRendererTween && !(target is UniTweenTarget <SpriteRenderer>)) { target = new UniTweenTarget <SpriteRenderer>(); } else if (tweenData is RigidbodyTween && !(target is UniTweenTarget <Rigidbody>)) { target = new UniTweenTarget <Rigidbody>(); } else if (tweenData is Rigidbody2DTween && !(target is UniTweenTarget <Rigidbody2D>)) { target = new UniTweenTarget <Rigidbody2D>(); } else if (tweenData is LightTween && !(target is UniTweenTarget <Light>)) { target = new UniTweenTarget <Light>(); } else if (tweenData is MaterialTween && !(target is UniTweenTarget <MaterialTween>)) { target = new UniTweenTarget <MeshRenderer>(); } else if (tweenData is AudioMixerTween && !(target is UniTweenTarget <AudioMixerTween>)) { target = new UniTweenTarget <AudioMixer>(); } else if (tweenData is AudioSourceTween && !(target is UniTweenTarget <AudioSourceTween>)) { target = new UniTweenTarget <AudioSource>(); } else if (tweenData is CameraTween && !(target is UniTweenTarget <CameraTween>)) { target = new UniTweenTarget <Camera>(); } else if (tweenData is OutlineTween && !(target is UniTweenTarget <OutlineTween>)) { target = new UniTweenTarget <Outline>(); } else if (tweenData is LineRendererTween && !(target is UniTweenTarget <LineRendererTween>)) { target = new UniTweenTarget <LineRenderer>(); } }