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; }
//$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; }
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; }
//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; }
//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; }
// public Msg_EffectGeneration( string _path, string _fileName, eLinkType _linkType, // string _dummy, eEffLoopType _loopType, float _loopDuration) // { // m_MessageType = eMessageType.EFFECT_GENERATION; // // fileName_ = _fileName; // linkType_ = _linkType; // dummy_ = _dummy; // loopType_ = _loopType; // loopDuration_ = _loopDuration; // // string[] strings = _fileName.Split( new char[]{'@'}); // foreach( string str in strings) // { // Debug.Log( str); // } // // string __class = strings[0]; // string skill = strings[1]; // // __class = __class.Replace( "Fx_", ""); // // // if( __class == "Common") // __class = "COMMON"; // // path_ = _path + __class + "/" + skill; // // path_ = _path + _fileName; // } public Msg_EffectGeneration( string _path, float _loopDuration, float _speed, Transform _owner, Transform _target, HitResultFunc _func) { m_MessageType = eMessageType.EFFECT_GENERATION; path_ = _path; loopDuration_ = _loopDuration; speed_ = _speed; owner_ = _owner; target_ = _target; func_ = _func; }