Пример #1
0
	//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;
	}
Пример #2
0
	 public bool CreateEffect (AsEffectData effectData, Vector3 _startPos, Transform _targetTran,  HitResultFunc _HitResult , float _speed)
	{
		m_pastTime = 0f;
		
		if( null == effectData)
		{
			Debug.Log ("CreateEffect(Shooting) Not found Resource :");
			return false;
		}
		
		m_EffectType = eEffect_Type.ShootingEffect;
		transform.position  = _startPos;
	
		if (_targetTran != null) 	
		{
			m_targetTran = ResourceLoad.SearchHierarchyTransform (_targetTran, "DummyCharacterCenter");
			//m_fDistance = Vector3.Distance (m_targetTran.position, transform.position);
		}
	
		
		m_EffectPrefab = effectData;
		
		m_EffectPrefab.AutoDel = true;
		m_EffectPrefab.ParentObject = this.GetComponent<AsEffectEntity> ();
		m_EffectPrefab.Enable (false);
	
	    m_HitResult = _HitResult;
		if(_speed != 0f)	m_fSpeed = _speed;		
		return true;
	}
Пример #3
0
	//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;
	}