Exemplo n.º 1
0
	public void AddSound( Tbl_Action_Animation _action, float _animSpeed)
	{
		if( m_Owner.ModelObject != null)
		{
			if( m_Owner.ModelObjectAnimation == null)
				return;
			
			AnimationState state = m_Owner.ModelObjectAnimation[_action.FileName];
			if( state == null)
				Debug.LogWarning( "SoundProcessor::AddSound: no animation state is found[" + _action.FileName + "].");
			
			foreach( Tbl_Action_Sound sound in _action.listSound)
			{
				m_listSound.Add( new SoundElement( state, sound, m_Owner.ModelObject.transform, Vector3.zero, _animSpeed));
			}
		}
	}
Exemplo n.º 2
0
	public Tbl_Action_Record(XmlElement _element, eType _type)// : base(_element)
	{
		try{
			XmlNode node = (XmlElement)_element;
			
			SetValue(ref m_Index, node, "Index");
			SetValue(ref m_ActionName, node, "ActionName");
			if(_type == eType.User)
			{
				SetValue<eCLASS>(ref m_Class, node, "Class");
				SetValue<eGENDER>(ref m_Gender, node, "Gender");
			}
			else
			{
				SetValue(ref m_ClassName, node, "Class");
			}
				
			SetValue(ref m_LinkActionIndex, node, "LinkActionIndex");
			SetValue(ref m_AniBlendingDuration, node, "AniBlendingDuration");
			SetValue<eNextIdleIndex>(ref m_NextIdleIndex, node, "NextIdleIndex");
//			SetValue(ref m_ActionSpeed, node, "ActionSpeed");
			
			XmlNode ready = node.SelectSingleNode("Ready");
			XmlNode hit = node.SelectSingleNode("Hit");
			XmlNode finish = node.SelectSingleNode("Finish");
			
			#region - ready & hit & finish -
			if(ready != null)
			{
				int[] counts = new int[4];
				m_ReadyAnimation = CreateActionReadyAnimation(ref ready, ref counts);
				
				List<Tbl_Action_Effect> listEffect = GetEffectElements(ref ready, counts[(int)eElementSequence.Effect], _type);
				List<Tbl_Action_Sound> listSound = GetSoundElements(ref ready, counts[(int)eElementSequence.Sound]);
				List<Tbl_Action_Trail> listTrail = GetTrailElements(ref ready, counts[(int)eElementSequence.Trail]);
				List<Tbl_Action_Cancel> listCancel = GetCancelElements(ref ready, counts[(int)eElementSequence.Cancel]);
				
				m_ReadyAnimation.SetEffect(listEffect);
				m_ReadyAnimation.SetSound(listSound);
				m_ReadyAnimation.SetTrail(listTrail);
				m_ReadyAnimation.SetCancel(listCancel);
			}
			
			if(hit != null)
			{
				int[] counts = new int[4];
				m_HitAnimation = CreateActionHitAnimation(ref hit, ref counts);
				
//				m_HitAnimation.SetMoveInfo(
				
				List<Tbl_Action_Effect> listEffect = GetEffectElements(ref hit, counts[(int)eElementSequence.Effect], _type);
				List<Tbl_Action_Sound> listSound = GetSoundElements(ref hit, counts[(int)eElementSequence.Sound]);
				List<Tbl_Action_Trail> listTrail = GetTrailElements(ref hit, counts[(int)eElementSequence.Trail]);
				List<Tbl_Action_Cancel> listCancel = GetCancelElements(ref hit, counts[(int)eElementSequence.Cancel]);
				
				m_HitAnimation.SetEffect(listEffect);
				m_HitAnimation.SetSound(listSound);
				m_HitAnimation.SetTrail(listTrail);
				m_HitAnimation.SetCancel(listCancel);
				
				if(hit.NextSibling != null)
					m_HitAnimation.SetHitInfo(new Tbl_Action_HitInfo(hit.NextSibling));
			}
			
			if(finish != null)
			{
				int[] counts = new int[4];
				m_FinishAnimation = CreateActionAnimation(ref finish, ref counts);
				
				List<Tbl_Action_Effect> listEffect = GetEffectElements(ref finish, counts[(int)eElementSequence.Effect], _type);
				List<Tbl_Action_Sound> listSound = GetSoundElements(ref finish, counts[(int)eElementSequence.Sound]);
				List<Tbl_Action_Trail> listTrail = GetTrailElements(ref finish, counts[(int)eElementSequence.Trail]);
				List<Tbl_Action_Cancel> listCancel = GetCancelElements(ref finish, counts[(int)eElementSequence.Cancel]);
				
				m_FinishAnimation.SetEffect(listEffect);
				m_FinishAnimation.SetSound(listSound);
				m_FinishAnimation.SetTrail(listTrail);
				m_FinishAnimation.SetCancel(listCancel);
			}
			#endregion
			
			DecideBlendingStep();
		}
		catch(System.Exception e)
		{
			Debug.LogError(e);
		}
	}
Exemplo n.º 3
0
	public void SetActionAnimation( Tbl_Action_Animation _actionAnimation)
	{
		actionAnimation_ = _actionAnimation;
	}