Esempio n. 1
0
        public void UpdateView(App.Model.MCharacter[] mCharacters)
        {
            List <App.Model.MCharacter> characterList = new List <App.Model.MCharacter>();

            while (characterList.Count < 6)
            {
                foreach (App.Model.MCharacter mCharacter in mCharacters)
                {
                    if (mCharacter.IsUserCharacter)
                    {
                        continue;
                    }
                    characterList.Add(mCharacter);
                }
                if (characterList.Count == 0)
                {
                    foreach (App.View.Character.VFaceSpriteRenderer character in characters)
                    {
                        character.gameObject.SetActive(false);
                    }
                    return;
                }
            }
            characterList.Sort((a, b) => b.Master.qualification - a.Master.qualification);
            for (int i = 0; i < characterList.Count && i < 6; i++)
            {
                App.Model.MCharacter mCharacter = characterList[i];
                App.View.Character.VFaceSpriteRenderer character = characters[i];
                character.CharacterId = mCharacter.CharacterId;
            }
        }
Esempio n. 2
0
 public void UpdatePlayer()
 {
     App.Model.MCharacter mCharacter = System.Array.Find(Global.SUser.self.characters, c => c.CharacterId >= App.Util.Global.Constant.user_characters[0]);
     LSharpVarlable.SetVarlable("player_character_id", mCharacter.CharacterId.ToString());
     LSharpVarlable.SetVarlable("player_id", Global.SUser.self.id.ToString());
     LSharpVarlable.SetVarlable("player_name", Global.SUser.self.name);
     LSharpVarlable.SetVarlable("player_nickname", Global.SUser.self.Nickname);
     LSharpVarlable.SetVarlable("player_claim", Language.Get(string.Format("player_claim_{0}", mCharacter.Gender.ToString())));
     LSharpVarlable.SetVarlable("player_claim_called", Language.Get(string.Format("player_claim_called_{0}", mCharacter.Gender.ToString())));
 }
Esempio n. 3
0
        public void Setplayer(string[] arguments)
        {
            int userId = int.Parse(arguments[0]);
            //int faceType = int.Parse(arguments[1]); //TODO:表情扩展用
            string   message  = arguments[2];
            bool     isLeft   = arguments[3] == "true";
            CBaseMap cBaseMap = App.Util.SceneManager.CurrentScene as CBaseMap;

            if (cBaseMap != null)
            {
                App.Model.MCharacter mCharacter = System.Array.Find(Global.SUser.self.characters, c => c.CharacterId >= App.Util.Global.Constant.user_characters[0]);
                cBaseMap.CharacterFocus(mCharacter.CharacterId);
            }
            CTalkDialog.ToShowPlayer(userId, message, isLeft, LSharpScript.Instance.Analysis);
        }
Esempio n. 4
0
        public override IEnumerator OnLoad(Request request)
        {
            yield return(StartCoroutine(base.OnLoad(request)));

            List <int> characterIds = request.Get <List <int> >("characterIds");
            List <int> dieIds       = request.Get <List <int> >("dieIds");
            int        star         = request.Get <int>("star");

            for (int i = 0; i < stars.Length; i++)
            {
                Image starImg = stars[i];
                starImg.color = i < star ? Color.yellow : Color.white;
            }
            List <App.Model.MBase> expCharacters = new List <App.Model.MBase>();

            foreach (int characterId in characterIds)
            {
                App.Model.MCharacter mCharacter   = System.Array.Find(Global.SUser.self.characters, c => c.CharacterId == characterId);
                MExpCharacter        expCharacter = new MExpCharacter();
                expCharacter.id        = characterId;
                expCharacter.fromExp   = mCharacter.Exp;
                expCharacter.fromLevel = mCharacter.Level;
                expCharacters.Add(expCharacter);
            }
            yield return(this.StartCoroutine(Global.SBattlefield.RequestBattleEnd(characterIds, dieIds, star)));

            App.Model.MContent[] battleRewards = Global.SBattlefield.battleRewards;
            ScrollViewSets(content, childItem, battleRewards);

            foreach (MExpCharacter expCharacter in expCharacters)
            {
                App.Model.MCharacter mCharacter = System.Array.Find(Global.SUser.self.characters, c => c.CharacterId == expCharacter.id);
                expCharacter.toExp   = mCharacter.Exp;
                expCharacter.toLevel = mCharacter.Level;
            }
            ScrollViewSets(expContent, expChildItem, expCharacters);
        }
Esempio n. 5
0
        public App.Model.MCharacter GetFromBattleNpc(App.Model.Master.MBattleNpc mBattleNpc)
        {
            Debug.LogError("mBattleNpc.npc_id =" + mBattleNpc.npc_id);
            App.Model.Master.MNpc npc        = Get(mBattleNpc.npc_id);
            App.Model.MCharacter  mCharacter = GetFromNpc(npc);
            if (mBattleNpc.horse > 0)
            {
                mCharacter.Horse = mBattleNpc.horse;
            }
            if (mBattleNpc.weapon > 0)
            {
                mCharacter.Weapon = mBattleNpc.weapon;
            }
            if (mBattleNpc.clothes > 0)
            {
                mCharacter.Clothes = mBattleNpc.clothes;
            }
            if (mBattleNpc.star > 0)
            {
                mCharacter.Star = mBattleNpc.star;
            }

            /*if (mBattleNpc.move_type > 0)
             * {
             *  mCharacter.MoveType = mBattleNpc.move_type;
             * }
             * if (mBattleNpc.weapon_type > 0)
             * {
             *  mCharacter.WeaponType = mBattleNpc.weapon_type;
             * }*/
            mCharacter.Skills      = App.Service.HttpClient.Deserialize <App.Model.MSkill[]>(mBattleNpc.skills);
            mCharacter.CoordinateX = mBattleNpc.x;
            mCharacter.CoordinateY = mBattleNpc.y;

            return(mCharacter);
        }