コード例 #1
0
    //public Int32 OnNotifySkillModelBuf(GSToGC.BuffEffect pMsg)
    //{
    //    StartCoroutine(OnNetMsg_NotifySkillModelBufCoroutine(pMsg));
    //    return (Int32)EErrorCode.eNormal;
    //}

    //public IEnumerator OnNetMsg_NotifySkillModelBufCoroutine(GSToGC.BuffEffect pMsg)
    //{
    //    //解析消息
    //    yield return 1;

    //    //创建特效
    //    UInt64 skillowner;
    //    skillowner = pMsg.guid;
    //    UInt64 skilltarget;
    //    skilltarget = pMsg.targuid;
    //    float rTime = pMsg.time / 1000.0f;
    //    Ientity target = null;
    //    EntityManager.AllEntitys.TryGetValue(skilltarget, out target);
    //    if (0 == pMsg.state)
    //    {
    //        HolyTech.Skill.BuffManager.Instance.AddBuff(pMsg.uniqueid, pMsg.effectid, rTime, target);
    //        Ientity entity = null;
    //        EntityManager.AllEntitys.TryGetValue(skilltarget, out entity);
    //        HolyTech.Effect.EffectManager.Instance.CreateBuffEffect(entity, pMsg.effectid, pMsg.uniqueid);    //ToReview uniqueid是否就是instid
    //    }
    //    else if (1 == pMsg.state)
    //    {
    //        HolyTech.Skill.BuffManager.Instance.RemoveBuff(pMsg.uniqueid);
    //        HolyTech.Effect.EffectManager.Instance.DestroyEffect(pMsg.uniqueid);
    //    }
    //}

    /*==========================================================================*/


    public int OnNotifyGameObjectReleaseSkillState(ReleasingSkillState pMsg)
    {
        Vector3 pos = this.ConvertPosToVector3(pMsg.pos);
        Vector3 dir = this.ConvertDirToVector3(pMsg.dir);

        dir.y = 0.0f;
        UInt64 targetID = pMsg.targuid; //目标id;
        UInt64 sGUID = pMsg.objguid;    //主动方id
        Player target, entity;

        PlayersManager.Instance.PlayerDic.TryGetValue(targetID, out target);
        PlayersManager.Instance.PlayerDic.TryGetValue(sGUID, out entity);
        if (!target)
        {
            return((int)ErrorCodeEnum.Normal);
        }
        if (entity != null)
        {
            pos.y = entity.RealEntity.transform.position.y;
            //数据改变 位置 方向 技能id 目标
            entity.EntityChangeDataOnPrepareSkill(pos, dir, pMsg.skillid, target);
            //释放技能
            entity.OnEntityReleaseSkill();
        }

        return((int)ErrorCodeEnum.Normal);
    }
コード例 #2
0
ファイル: GamePlay.cs プロジェクト: aowchina/HolyTech
 void OnNotifyGameObjectReleaseSkillState(ReleasingSkillState pMsg)
 {
     Debug.Log("OnNotifyGameObjectReleaseSkillState");
 }