コード例 #1
0
ファイル: AsEffectManager.cs プロジェクト: ftcaicai/ArkClient
	public int Tool_ShootingEffect( string sourcePath, Vector3 _startPos, Transform _targetTran,  HitResultFunc _HitResult, float _speed, float acce, eProjectilePath ePath , float fStartSize = 1f)
	{
		AsEffectEntity entity = LoadEntity( sourcePath);
		if( entity != null)
		{
			AsEffectData effectData = entity.GetComponentInChildren<AsEffectData>();
			entity.CreateEffect( effectData, _startPos, _targetTran, _HitResult, _speed, acce, ePath, fStartSize);
			return entity.Id;
		}
		
		return -1;
	}
コード例 #2
0
ファイル: AsEffectManager.cs プロジェクト: ftcaicai/ArkClient
	//$yde
	public int ShootingEffect( string sourcePath, Transform _startTran, Transform _targetTran,  HitResultFunc _HitResult, float _speed, float acce, eProjectilePath ePath , float fStartSize = 1f, string projectileHitSoundName = null, bool bHold = false)
	{
		AsEffectEntity entity = LoadEntity( sourcePath);
		if( entity != null)
		{
			AsEffectData effectData = entity.GetComponentInChildren<AsEffectData>();
			entity.CreateEffect( effectData, _startTran, _targetTran, _HitResult, _speed, acce, ePath, fStartSize, projectileHitSoundName, bHold);
			return entity.Id;
		}
		
		return -1;
	}
コード例 #3
0
ファイル: AsEffectEntity.cs プロジェクト: ftcaicai/ArkClient
	//tool
	public bool CreateEffect (AsEffectData effectData, Vector3 _startPos, Transform _targetTran,  HitResultFunc _HitResult , float _speed, float _acce, eProjectilePath ePath, float fStartSize = 1f)
	{
		m_pastTime = 0f;
		
		if( null == effectData)
		{
			Debug.Log ("CreateEffect(Shooting) Not found Resource :");
			return false;
		}
		
		if(ePath == eProjectilePath.NONE)return false;
		
		m_EffectType = eEffect_Type.ShootingEffect;
		m_startPos   = transform.position  = _startPos;
		if (_targetTran != null) 	
		{
			m_targetTran = ResourceLoad.SearchHierarchyTransform (_targetTran, "DummyCharacterCenter");
			//m_fDistance = Vector3.Distance (m_targetTran.position, transform.position);
			if(m_targetTran == null)
			{
				m_targetTran = _targetTran;
			}
		}
		
		
	
		
		m_EffectPrefab = effectData;
		m_IsShootDelete =  false;
		m_IsHit         =  false;
	
		m_fHeight = Vector3.Distance (m_startPos, m_targetTran.position ) * 0.25f;	
		
		m_EffectPrefab.ParentObject = this.GetComponent<AsEffectEntity> ();
		m_EffectPrefab.Enable (false,fStartSize);
	
	    m_HitResult = _HitResult;
		if(_speed != 0f)	m_fSpeed = _speed;
		m_acce = _acce; 
			
		m_eProjectlie_Path = ePath;
		return true;
	}
コード例 #4
0
ファイル: AsEffectEntity.cs プロジェクト: ftcaicai/ArkClient
	//shooting TargetPostion
	public bool CreateEffect (AsEffectData effectData, Transform _startTran, Vector3 _targetPos,  HitResultFunc _HitResult , float _speed, float _acce, eProjectilePath ePath, float fStartSize = 1f, string projectileHitSoundName = null )
	{
		m_pastTime = 0f;
		
		if( null == effectData)
		{
			Debug.Log ("CreateEffect(Shooting) Not found Resource :");
			return false;
		}
		
		if(ePath == eProjectilePath.NONE)return false;
		
		m_EffectType = eEffect_Type.ShootingEffect;
		
		m_ProjectileHitSoundName = projectileHitSoundName;
//		m_startPos   = transform.position  = _startPos;
		
		
		m_targetTran    =  null;
		m_IsHold        =  true;			
		
		m_EffectPrefab = effectData;
		m_IsShootDelete =  false;
		m_IsHit         =  false;
	
		if(m_IsHold) m_target_position = _targetPos;	
		m_EffectPrefab.ParentObject = this.GetComponent<AsEffectEntity> ();
		Transform trn = null;
		foreach(AsEffectInfo info in m_EffectPrefab.m_effectLayer)
		{
			trn = ResourceLoad.SearchHierarchyTransform(_startTran, info.m_dummyType.ToString() );
			Debug.Log(info.m_dummyType.ToString());
		}
		
		if(trn != null)
		{
			m_startPos   = transform.position  = trn.position;
		}
		else
			Debug.LogError("AsEffectEntity::CreateEffect: no transform is found");
	
		m_fHeight = Vector3.Distance (m_startPos, m_target_position ) * 0.25f;	
			
		m_EffectPrefab.Enable(false,fStartSize);
	
	    m_HitResult = _HitResult;
		if(_speed != 0f)	m_fSpeed = _speed;
		m_acce = _acce; 
	
		m_eProjectlie_Path = ePath;
		return true;
	}
コード例 #5
0
ファイル: Tbl_ActionList.cs プロジェクト: ftcaicai/ArkClient
	public Tbl_Action_HitInfo(XmlNode _node)
	{
		try{
			m_HitType = (eHitType)Enum.Parse(typeof(eHitType), _node.Attributes["HitType"].Value, true);
			m_HitMultiTargetCount = int.Parse(_node.Attributes["MultiTargetCount"].Value);
			m_HitTiming = float.Parse(_node.Attributes["Timing"].Value);
			m_HitProjectileName = _node.Attributes["ProjectileFilePath"].Value;
			m_HitProjectileHitFileName = _node.Attributes["ProjectileHitFilePath"].Value;
			
			m_HitProjectileSpeed = float.Parse(_node.Attributes["ProjectileSpeed"].Value);		
			m_HitProjectileAccel = float.Parse(_node.Attributes["ProjectileAcceleration"].Value);
			m_HitProjectilePath = (eProjectilePath)Enum.Parse(typeof(eProjectilePath), _node.Attributes["ProjectilePath"].Value, true);
			m_HitValuePercent = float.Parse(_node.Attributes["ValuePercent"].Value);
			m_HitValueLookType = (eValueLookType)Enum.Parse(typeof(eValueLookType), _node.Attributes["ValueLookType"].Value, true);
			
			m_HitValueLookDuration = float.Parse(_node.Attributes["ValueLookDuration"].Value);
			m_HitValueLookCount = int.Parse(_node.Attributes["ValueLookCount"].Value);
			m_HitProjectileHitSoundPath = _node.Attributes["ProjectileHitSoundPath"].Value;
			
			XmlNode nodeArea = _node.NextSibling;
			while(true)
			{
				if(nodeArea == null)
					break;
				
				Tbl_Action_AreaInfo areaInfo = new Tbl_Action_AreaInfo(nodeArea);
				m_AreaInfo.Add(areaInfo);
				
				nodeArea = nodeArea.NextSibling;
			}
		}
		catch(Exception e){
			Debug.LogError(e);
		}
	}
コード例 #6
0
ファイル: Tbl_ActionList.cs プロジェクト: ftcaicai/ArkClient
	public Tbl_Action_HitInfo_(XmlNode _node)
	{
		try{
			m_HitType = (eHitType)Enum.Parse(typeof(eHitType), _node.Attributes["HitType"].Value, true);
			m_HitTiming = float.Parse(_node.Attributes["Timing"].Value);
			m_HitProjectileName = _node.Attributes["ProjectileFilePath"].Value;
			m_HitProjectileHitFileName = _node.Attributes["ProjectileHitFilePath"].Value;
			m_HitProjectileSpeed = float.Parse(_node.Attributes["ProjectileSpeed"].Value);
			m_HitProjectileAccel = float.Parse(_node.Attributes["ProjectileAcceleration"].Value);
			m_HitProjectilePath = (eProjectilePath)Enum.Parse(typeof(eProjectilePath), _node.Attributes["ProjectilePath"].Value, true);
			m_HitAreaShape = (eHitAreaShape)Enum.Parse(typeof(eHitAreaShape), _node.Attributes["AreaShape"].Value, true);
			m_HitAngle = float.Parse(_node.Attributes["Angle"].Value);
			m_HitCenterDirectionAngle = float.Parse(_node.Attributes["CenterDirectionAngle"].Value);
			m_HitMinDistance = float.Parse(_node.Attributes["MinDistance"].Value);
			m_HitMaxDistance = float.Parse(_node.Attributes["MaxDistance"].Value);
			m_HitWidth = float.Parse(_node.Attributes["Width"].Value);
			m_HitHeight = float.Parse(_node.Attributes["Height"].Value);
			m_HitOffsetX = float.Parse(_node.Attributes["OffsetX"].Value);
			m_HitOffsetY = float.Parse(_node.Attributes["OffsetY"].Value);
			m_HitValuePercent = float.Parse(_node.Attributes["ValuePercent"].Value);
			m_HitValueLookType = (eValueLookType)Enum.Parse(typeof(eValueLookType), _node.Attributes["ValueLookType"].Value, true);
			m_HitValueLookDuration = float.Parse(_node.Attributes["ValueLookDuration"].Value);
			m_HitValueLookCount = int.Parse(_node.Attributes["ValueLookCount"].Value);
			m_HitProjectileHitSoundPath = _node.Attributes["ProjectileHitSoundPath"].Value;
		}
		catch(Exception e){
			Debug.LogError(e);
		}
	}