public void Tick() { if (null == SkillItemDataModel) { return; } if (SkillItemDataModel.CoolDownTime > 0) { RadialCover.fillAmount = SkillItemDataModel.CoolDownTime / SkillItemDataModel.CoolDownTimeTotal; CdLabel.text = ((int)SkillItemDataModel.CoolDownTime + 1).ToString(); ChargeRadialCover.fillAmount = RadialCover.fillAmount; effectState = eEffectState.Cd; } if (PlayerDataManager.Instance.PlayerDataModel.SkillData.CommonCoolDown > 0) { if (SkillItemDataModel.CoolDownTime < PlayerDataManager.Instance.PlayerDataModel.SkillData.CommonCoolDown) { RadialCover.fillAmount = PlayerDataManager.Instance.PlayerDataModel.SkillData.CommonCoolDown / PlayerDataManager.Instance.PlayerDataModel.SkillData.CommonCoolDownTotal; } } UpdateCoolDown(); }
public void Copy(EA_EffectBaseInfo ib) { m_GDEffectId = ib.m_GDEffectId; m_AttachObjectId = ib.m_AttachObjectId; m_AttachBoneName = ib.m_AttachBoneName; m_eLifeType = ib.m_eLifeType; m_eAttachType = ib.m_eAttachType; m_eEffectState = ib.m_eEffectState; m_fStartTime = ib.m_fStartTime; m_fLifeTime = ib.m_fLifeTime; m_EffectTableIndex = ib.m_EffectTableIndex; m_EmitPos[0] = ib.m_EmitPos[0]; m_EmitPos[1] = ib.m_EmitPos[1]; m_EmitPos[2] = ib.m_EmitPos[2]; m_EmitAngle[0] = ib.m_EmitAngle[0]; m_EmitAngle[1] = ib.m_EmitAngle[1]; m_EmitAngle[2] = ib.m_EmitAngle[2]; m_EffectResourceType = ib.m_EffectResourceType; m_bForceAxis = ib.m_bForceAxis; m_fForceYpos = ib.m_fForceYpos; m_strObjectId = ib.m_strObjectId; }
public float[] m_EmitAngle = new float[] { CObjGlobal.fInvalidAngle, CObjGlobal.fInvalidAngle, CObjGlobal.fInvalidAngle }; // If it's not 0,0,0, look in that direction public EA_EffectBaseInfo() { m_GDEffectId = CObjGlobal.InvalidEffectID; m_AttachObjectId = CObjGlobal.InvalidObjID; m_AttachBoneName = ""; m_eLifeType = eEffectLifeType.eLoop; m_eAttachType = eEffectAttachType.eWorld; m_eEffectState = eEffectState.ES_UnLoad; m_fStartTime = 0; m_fLifeTime = 0; m_EffectTableIndex = ""; m_EffectResourceType = eEffectResourceType.eParticle; m_bForceAxis = false; m_fForceYpos = 0.0f; m_strObjectId = ""; }
private void OnEnable() { #if !UNITY_EDITOR try { #endif effectState = eEffectState.Init; if (EffectObj.activeSelf) { EffectObj.SetActive(false); } #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
void BeforePlay() { if(m_Owner.GetAnimationTime() > m_Timing || (m_Owner.GetAnimationTime() == 0f && (Time.time - m_SetTime) * m_AnimSpeed > m_Timing)) { m_State = eEffectState.After_Play; bool loop; switch(m_LoopType) { case eLoopType.Once: case eLoopType.Cut: loop = false; break; case eLoopType.Loop: case eLoopType.TimeLoop: loop = true; break; default: Debug.LogWarning("EffectElement:: Update: loop type is NONE. check action table."); loop = false; break; } switch(m_LinkType) { case eLinkType.AttachDummy: if( m_Owner.ModelObject != null) m_EffectIdx = AsEffectManager.Instance.PlayEffect(m_EffectName, m_Owner.ModelObject.transform, loop, m_LoopDuration * 0.001f, m_Owner.transform.localScale.y * m_Effect.StartSize); break; case eLinkType.HitPosition: if(m_Pos != Vector3.zero) { m_EffectIdx = AsEffectManager.Instance.PlayEffect(m_EffectName, m_Pos, loop, m_LoopDuration * 0.001f, m_Owner.transform.localScale.y * m_Effect.StartSize); AsEffectManager.Instance.SetAngleY(m_EffectIdx, m_Owner.transform.rotation.eulerAngles.y); } else if(m_TargetTrn != null) m_EffectIdx = AsEffectManager.Instance.PlayEffect(m_EffectName, m_TargetTrn, loop, m_LoopDuration * 0.001f, m_Owner.transform.localScale.y * m_Effect.StartSize); else Debug.LogWarning("EffectProcessor::BeforePlay: [eLinkType.HitPosition] position is (0,0,0) and target transform is null"); break; case eLinkType.HoldPosition: m_EffectIdx = AsEffectManager.Instance.PlayEffect(m_EffectName, m_Owner.transform.position, loop, m_LoopDuration * 0.001f, m_Owner.transform.localScale.y * m_Effect.StartSize); AsEffectManager.Instance.SetAngleY(m_EffectIdx, m_Owner.transform.rotation.eulerAngles.y); break; case eLinkType.HitHoldPosition: Vector3 pos = Vector3.zero; if( m_PositionFix == false) { if( m_TargetTrn != null) pos = m_TargetTrn.position; else if(m_Pos != Vector3.zero) pos = m_Pos; } else { if( m_PositionCached != Vector3.zero) pos = m_PositionCached; } if( pos == Vector3.zero) { Debug.LogError("EffectProcessor::BeforePlay: [eLinkType.HitPosition] position is (0,0,0) and target transform is null"); break; } m_EffectIdx = AsEffectManager.Instance.PlayEffect(m_EffectName, pos, loop, m_LoopDuration * 0.001f, m_Owner.transform.localScale.y * m_Effect.StartSize); AsEffectManager.Instance.SetAngleY(m_EffectIdx, m_Owner.transform.rotation.eulerAngles.y); break; case eLinkType.TargetChain: if( m_Owner.ModelObject != null && m_TargetTrn != null) { m_EffectIdx = AsEffectManager.Instance.PlayEffect(m_EffectName, m_Owner.ModelObject.transform, m_TargetTrn, loop, m_LoopDuration * 0.001f, m_Owner.transform.localScale.y * m_Effect.StartSize); AsEffectManager.Instance.SetAngleY(m_EffectIdx, m_Owner.ModelObject.transform.rotation.eulerAngles.y); } else Debug.LogWarning("Effectprocessor::BeforePlay: target transform is null. 'TargetChain' effect cannot be played"); break; case eLinkType.Shooting: if( m_Owner.ModelObject != null && m_TargetTrn != null && m_Effect.Action.HitAnimation != null) { AsEffectManager.Instance.ShootingEffect( m_Effect.FileName, m_Owner.ModelObject.transform, m_TargetTrn, null, m_Effect.Action.HitAnimation.hitInfo.HitProjectileSpeed, m_Effect.Action.HitAnimation.hitInfo.HitProjectileAccel, m_Effect.Action.HitAnimation.hitInfo.HitProjectilePath, m_Owner.ModelObject.transform.localScale.y); } else Debug.LogWarning("Effectprocessor::BeforePlay: target transform is null. 'Shooting' effect cannot be played"); break; case eLinkType.ShootingPosition: if( m_Owner.ModelObject != null && m_Effect.Action.HitAnimation != null) { AsEffectManager.Instance.ShootingEffect( m_Effect.FileName, m_Owner.ModelObject.transform, m_Pos, null, m_Effect.Action.HitAnimation.hitInfo.HitProjectileSpeed, m_Effect.Action.HitAnimation.hitInfo.HitProjectileAccel, m_Effect.Action.HitAnimation.hitInfo.HitProjectilePath, m_Owner.ModelObject.transform.localScale.y); } else Debug.LogWarning("Effectprocessor::BeforePlay: m_Effect.Action.HitAnimation == null. 'ShootingPosition' effect cannot be played"); break; } AsEffectManager.Instance.SetSpeed(m_EffectIdx, m_AnimSpeed); m_BeganTime = Time.time; } }
void AfterPlay() { if(m_LoopType == eLoopType.TimeLoop) { if(Time.time > m_BeganTime + m_LoopDuration) { m_State = eEffectState.Finish_Play; AsEffectManager.Instance.RemoveEffectEntity(m_EffectIdx); } } }
public virtual bool ResetInfo(eEffectState eChangeState) { m_EffectBaseInfo.m_eEffectState = eChangeState; SetObjInfo(m_EffectBaseInfo); return(true); }
private void UpdateCoolDown() { if (PlayerDataManager.Instance.PlayerDataModel.SkillData.CommonCoolDown == 0 && (SkillItemDataModel.CoolDownTime) == 0) { isShowRadial = false; // ChargeRadialCover.gameObject.SetActive(false); ChargeRadialCover.enabled = false; isShowCover = false; if (effectState == eEffectState.Cd) { effectState = eEffectState.Show; } } if (PlayerDataManager.Instance.PlayerDataModel.SkillData.CommonCoolDown > 0 && SkillItemDataModel.SkillType != 3) // xp技能 { isShowRadial = true; isShowCover = true; } else { if (SkillItemDataModel.CoolDownTime > 0) { isShowCover = true; if (SkillItemDataModel.ChargeLayerTotal > 1) { isShowRadial = false; // ChargeRadialCover.gameObject.SetActive(true); ChargeRadialCover.enabled = true; if (SkillItemDataModel.ChargeLayer > 0) { isShowCover = false; } } else { isShowRadial = true; } } else { isShowCover = false; } } if (SkillItemDataModel.CoolDownTime > 0) { //CdLabel.gameObject.SetActive(true); CdLabel.enabled = true; } else { //CdLabel.gameObject.SetActive(false); CdLabel.enabled = false; } if (Cover.enabled != isShowCover) { //Cover.gameObject.SetActive(isShowCover); Cover.enabled = isShowCover; } if (SkillItemDataModel.IsXpSkill) { var showEffect = !isShowCover; if (XpSkillEffect.activeSelf != showEffect) { XpSkillEffect.SetActive(showEffect); } } else { if (XpSkillEffect.activeSelf) { XpSkillEffect.SetActive(false); } } if (RadialCover.enabled != isShowRadial) { // RadialCover.gameObject.SetActive(isShowRadial); RadialCover.enabled = isShowRadial; } if (effectState == eEffectState.Show && gameObject.activeInHierarchy) { if (effectCoroutine != null) { StopCoroutine(effectCoroutine); } effectCoroutine = StartCoroutine(EffectCoroutineFun(0.9f)); effectState = eEffectState.Init; } }
private void UpdateCoolDown() { if (PlayerDataManager.Instance.PlayerDataModel.SkillData.CommonCoolDown == 0 && (SkillItemDataModel.CoolDownTime) == 0) { isShowRadial = false; ChargeRadialCover.gameObject.SetActive(false); isShowCover = false; if (effectState == eEffectState.Cd) { effectState = eEffectState.Show; } } if (PlayerDataManager.Instance.PlayerDataModel.SkillData.CommonCoolDown > 0) { isShowRadial = true; isShowCover = true; } else { if (SkillItemDataModel.CoolDownTime > 0) { isShowCover = true; if (SkillItemDataModel.ChargeLayerTotal > 1) { isShowRadial = false; ChargeRadialCover.gameObject.SetActive(true); if (SkillItemDataModel.ChargeLayer > 0) { isShowCover = false; } } else { isShowRadial = true; } } else { isShowCover = false; } } if (SkillItemDataModel.CoolDownTime > 0) { CdLabel.gameObject.SetActive(true); } else { CdLabel.gameObject.SetActive(false); } if (Cover.gameObject.activeSelf != isShowCover) { Cover.gameObject.SetActive(isShowCover); } if (RadialCover.gameObject.activeSelf != isShowRadial) { RadialCover.gameObject.SetActive(isShowRadial); } if (effectState == eEffectState.Show && gameObject.activeInHierarchy) { if (effectCoroutine != null) { StopCoroutine(effectCoroutine); } effectCoroutine = StartCoroutine(EffectCoroutineFun(0.9f)); effectState = eEffectState.Init; } }