Example #1
0
    void CreatePlayer()
    {
        IPlayer player = ClientGlobal.Instance().MainPlayer;

        if (player != null)
        {
            int job   = player.GetProp((int)PlayerProp.Job);
            int sex   = player.GetProp((int)PlayerProp.Sex);
            int index = 0;
            EntityViewProp[] propList = new EntityViewProp[(int)Client.EquipPos.EquipPos_Max];
            propList[index++] = new EntityViewProp((int)Client.EquipPos.EquipPos_Body, 0);
            propList[index++] = new EntityViewProp((int)Client.EquipPos.EquipPos_Weapon, (int)0);
            //propList[index++] = new EntityViewProp((int)Client.EquipPos.EquipPos_Wing, (int)0);

            mainPlayer = HomeScene.Instance.AddPuppet(player.GetName(), job, sex, propList, true);
            if (mainPlayer != null && HomePlayerPos.Count == 2)
            {
                mainPlayer.SendMessage(EntityMessage.EntityCommand_SetPos, new Vector3(HomePlayerPos[0], 0f, -HomePlayerPos[1]));
            }
        }
    }