public override void Play(ISkillAttacker attacker, SkillEffect se) { m_ef = se; SoundNodeProp prop = m_NodeProp as SoundNodeProp; if (prop == null) { return; } m_NodeProp.only_main_role = true; if (prop.snd_name == "") { return; } bLoop = prop.bloop; m_fAudioEndTime = prop.endTime; Engine.IAudio audio = Engine.RareEngine.Instance().GetAudio(); if (audio == null) { return; } if (attacker == null) { Log.LogGroup("ZDY", "attacker is null"); return; } if (attacker.GetGameObject() == null) { Log.LogGroup("ZDY", "entity is null"); return; } if (attacker.GetGameObject().GetNode() == null) { Log.LogGroup("ZDY", "entity GetNode is null"); return; } Transform trans = attacker.GetGameObject().GetTransForm(); if (trans == null) { Log.LogGroup("ZDY", "entity GetNode GetTransForm is null"); return; } m_audioID = audio.PlayEffect(trans.gameObject, prop.snd_name, bLoop); uint stopTime = (uint)(m_fAudioEndTime * 1000); if (bLoop) { TimerAxis.Instance().SetTimer(m_uAuidoStopTimerID, stopTime, this, 1); } }
public override void Play(ISkillAttacker attacker, SkillEffect se) { AttachFxNodeProp prop = m_NodeProp as AttachFxNodeProp; if (prop == null) { return; } int level = 0; if (attacker != null) { if (attacker.GetSkillPart() != null) { level = attacker.GetSkillPart().FxLevel; } } skillMaster = attacker.GetGameObject(); AddLinkEffect node = new AddLinkEffect(); node.nFollowType = (int)0; node.rotate = Vector3.zero; node.vOffset = prop.offset_pos; node.nLevel = level; // string effectName = prop.fx_name.Replace( "prefab" , "fx" ); // node.strEffectName = SkillEffectHelper.FxDir + effectName; node.strEffectName = prop.fx_name; node.strLinkName = prop.attach_name; if (skillMaster != null) { effectID = (uint)(int)skillMaster.SendMessage(EntityMessage.EntityCommand_AddLinkEffect, node); } }
public override void Play(ISkillAttacker attacker, SkillEffect se) { if (attacker == null) { return; } IEntity en = attacker.GetGameObject(); if (en == null) { return; } if (!SkillSystem.GetClientGlobal().IsMainPlayer(en)) {//不是主角不震屏 return; } ShakeCameraNodeProp prop = m_NodeProp as ShakeCameraNodeProp; if (prop == null) { return; } IRenderSystem renderSys = RareEngine.Instance().GetRenderSystem(); if (renderSys == null) { Log.Error("RenderSystem is null!"); return; } string camName = "MainCamera"; ICamera cam = renderSys.GetCamera(ref camName); if (cam != null) { ICameraCtrl cc = cam.GetCameraCtrl(); if (cc != null) { // public float duration = 0.2f;//持续时间 // public float strength = 0.5f;//振幅 // public int vibrato = 10;//频率 //@brief 开始振动 //@param fAmplitude 振幅 //@param fFrequency 频率 //@param fCycle 周期 //@param fTime 持续时间 cc.StartShake(prop.strength, prop.vibrato, 1, prop.duration); } } else { //编辑器代码实现 Camera.main.DOShakePosition(prop.duration, prop.strength, prop.vibrato, 0); } }