Esempio n. 1
0
        void DoPlayEffect()
        {
            if (effect.Value == null)
            {
                LogWarning("Missing a TextFx component reference!");
                return;
            }

            TextFxAnimationInterface textEffect = (effect.Value as GameObject).GetComponent(typeof(TextFxAnimationInterface)) as TextFxAnimationInterface;

            if (textEffect == null)
            {
                LogWarning("No TextFx component found!");
                return;
            }

            // Set the onFinishAction
            textEffect.AnimationManager.m_on_finish_action = onFinishAction;

            // Set which time-system to use
            textEffect.AnimationManager.m_time_type = timeUsed;

            // Play text animation
            textEffect.AnimationManager.PlayAnimation(delay.Value);
        }
        void DoPlayEffect()
        {
            if (effect.Value == null)
            {
                LogWarning("Missing a TextFx component reference!");
                return;
            }

            TextFxAnimationInterface textEffect = (effect.Value as GameObject).GetComponent(typeof(TextFxAnimationInterface)) as TextFxAnimationInterface;

            if (textEffect == null)
            {
                LogWarning("No TextFx component found!");
                return;
            }

            // Continue the animation
            textEffect.AnimationManager.ContinuePastLoop();
        }
Esempio n. 3
0
        void DoPlayEffect()
        {
            if (effect.Value == null)
            {
                LogWarning("Missing a TextFx component reference!");
                return;
            }

            TextFxAnimationInterface textEffect = (effect.Value as GameObject).GetComponent(typeof(TextFxAnimationInterface)) as TextFxAnimationInterface;

            if (textEffect == null)
            {
                LogWarning("No TextFx component found!");
                return;
            }

            // Set text animation to its end state
            textEffect.AnimationManager.SetEndState();
        }
        void DoPlayEffect()
        {
            if (effect.Value == null)
            {
                LogWarning("Missing a TextFx component reference!");
                return;
            }

            TextFxAnimationInterface textEffect = (effect.Value as GameObject).GetComponent(typeof(TextFxAnimationInterface)) as TextFxAnimationInterface;

            if (textEffect == null)
            {
                LogWarning("No TextFx component found!");
                return;
            }

            // Set the animations text
            textEffect.SetText(text.Value);
        }
		public void SetParentObjectReferences(GameObject gameObject, Transform transform, TextFxAnimationInterface anim_interface)
		{
			m_gameObect = gameObject;
			m_transform = transform;
			m_animation_interface_reference = anim_interface;
			m_monobehaviour = (MonoBehaviour) anim_interface;

			Init ();
		}
//		void InitAnimationManager(TextFxAnimationManager anim_manager)
//		{
//			anim_manager.m_selected_intro_animation_idx = EditorPrefs.GetInt("SelectedIntroTextFxAnim", 0);
//			anim_manager.m_selected_main_animation_idx = EditorPrefs.GetInt("SelectedMainTextFxAnim", 0);
//			anim_manager.m_selected_outro_animation_idx = EditorPrefs.GetInt("SelectedOutroTextFxAnim", 0);
//		}
	    
	    void OnGUI ()
		{
			// Check whether a EffectManager object is selected
			if(Selection.gameObjects.Length == 1)
			{
				TextFxAnimationInterface textfx_animation_interface = Selection.gameObjects[0].GetComponent(typeof(TextFxAnimationInterface)) as TextFxAnimationInterface;
				if(textfx_animation_interface != null)
				{
					m_textfx_animation_interface = textfx_animation_interface;
					m_animation_manager = textfx_animation_interface.AnimationManager;

					if(m_animation_manager.m_master_animations == null)
						m_animation_manager.m_master_animations = new List<LetterAnimation>();
				}
			}
			
			if(m_animation_manager == null || m_animation_manager.m_master_animations == null || m_textfx_animation_interface == null || m_textfx_animation_interface.AnimationManager == null || m_textfx_animation_interface.AnimationManager.GameObject == null)
			{
				return;
			}

			int edited_action = -1;
			bool start_of_action = true;
			ANIMATION_DATA_TYPE edited_data = ANIMATION_DATA_TYPE.ALL;

			DrawEffectEditorPanel();
			
			if(!ignore_gui_change)
			{
				start_of_action = editing_start_state;
				edited_action = edited_action_idx;
				edited_data = m_edited_data;
			}


			if (edited_action >= 0)
			{
				if(m_animation_manager.Playing && edited_data != ANIMATION_DATA_TYPE.NONE)
				{
					m_animation_manager.PrepareAnimationData(edited_data);
				}
				else
				{
					m_animation_manager.SetAnimationState(edited_action, start_of_action ? 0 : 1, update_action_values: true, edited_data: edited_data);
					
					m_textfx_animation_interface.UpdateTextFxMesh( m_animation_manager.MeshVerts, m_animation_manager.MeshColours);
				}
			}

			if(GUI.changed)
			{
				EditorUtility.SetDirty( m_textfx_animation_interface.GameObject );
			}
	    }