Esempio n. 1
0
    public void Exit()
    {
        SetStage(0);

        if (mSkillEnd != null)
        {
            mSkillEnd(SkillID);
        }

        if (mSkillContext.IsSkillContextFlag(SkillContextFlag.SyncPosOnSkillEnd))
        {
            if (Owner != null)
            {
                NotifySetPos notify = new NotifySetPos();
                notify.uid       = Owner.gid;
                notify.position  = Vector3Packat.FromVector3(Owner.Position);
                notify.direction = Vector3Packat.FromVector3(Owner.Direction);
                Scene scn = Owner.mScene;
                for (int i = 0; i < scn.GetPlayerCount(); ++i)
                {
                    Player p = scn.GetPlayerByIndex(i);

                    NetWork.NotifyMessage <NotifySetPos>(p.UserID, STC.STC_SetPos, notify);
                }
            }
        }
    }
Esempio n. 2
0
    static void OnSetPos(byte[] data)
    {
        Scene scn = SceneSystem.Instance.mCurrentScene;

        if (scn == null)
        {
            return;
        }
        NotifySetPos msg = ProtoBufUtils.Deserialize <NotifySetPos>(data);
        Character    cha = scn.GetCharacter(msg.uid);

        if (cha == null)
        {
            return;
        }
        cha.Position  = msg.position.ToVector3();
        cha.Direction = msg.direction.ToVector3();
    }