コード例 #1
0
 public void OnClickStartBtnHandle()
 {
     qy.PlayerData.RoleState state = GameMainManager.Instance.playerData.GetRoleState(selectedRoleID);
     if (state == qy.PlayerData.RoleState.Dide)
     {
         GameMainManager.Instance.uiManager.OpenWindow(qy.ui.UISettings.UIWindowID.UICallBackWindow, selectedRoleID);
     }
     else
     {
         GameMainManager.Instance.playerModel.StartGameWithRole(selectedRoleID);
         GameMainManager.Instance.uiManager.OpenWindow(qy.ui.UISettings.UIWindowID.UIMainSceneWindow);
         OnClickClose();
     }
 }
コード例 #2
0
    public OfflineData(qy.PlayerData playerData)
    {
        storyid   = playerData.questId;
        heartTime = (playerData.hertTimestamp * 1000).ToString();
        gold      = playerData.coinNum;
        heart     = playerData.heartNum;
        star      = playerData.starNum;
        name      = playerData.nickName;
        uid       = playerData.userId;
        level     = playerData.eliminateLevel;
        roleId    = playerData.role != null? playerData.role.id:"";
        items     = new List <PlayerDataMessage.PropItem>();
        foreach (qy.config.PropItem item in playerData.propsDic.Values)
        {
            PlayerDataMessage.PropItem prop = new PlayerDataMessage.PropItem();
            prop.itemId     = item.id;
            prop.count      = item.count;
            prop.uuid       = item.uuid;
            prop.vanishTime = item.vanishTime;
            items.Add(prop);
        }

        discipline = playerData.ability.discipline;
        loyalty    = playerData.ability.loyalty;
        wisdom     = playerData.ability.wisdom;
        storyExp   = playerData.totalExp.ToString();
        lvExp      = playerData.currExp.ToString();
        storyLv    = playerData.level;
        roles      = new List <PlayerDataMessage.RoleData>();
        foreach (string id in playerData.rolesState.Keys)
        {
            qy.PlayerData.RoleState    state = playerData.rolesState[id];
            PlayerDataMessage.RoleData role  = new PlayerDataMessage.RoleData();
            role.roleId = id;
            role.status = (int)state;
            roles.Add(role);
        }
        stories = new List <PlayerDataMessage.StoryData>();
        foreach (string id in playerData.complatedQuests.Keys)
        {
            PlayerDataMessage.StoryData storyData = new PlayerDataMessage.StoryData();
            storyData.storyId = id;
            stories.Add(storyData);
        }
        timestamp = GameUtils.DateTimeToTimestamp(System.DateTime.Now).ToString();
    }
コード例 #3
0
    private void SetPanel(RoleItem item)
    {
        var sp =
            March.Core.ResourceManager.ResourceManager.instance.Load <Sprite>(Configure.StoryPerson,
                                                                              item.headIcon);

        head.sprite = sp;
        head.type   = Image.Type.Simple;
        GameUtils.Scaling(head.transform as RectTransform, new Vector2(sp.texture.width, sp.texture.height));

        //string headUrl = FilePathTools.GetPersonHeadPath(item.headIcon);
        //AssetsManager.Instance.LoadAssetAsync<Sprite>(headUrl, (sp) =>
        //{
        //    head.sprite = sp;
        //    head.type = Image.Type.Simple;
        //    GameUtils.Scaling(head.transform as RectTransform,new Vector2(sp.texture.width,sp.texture.height));
        //});

        loyaltySlider.value = item.ability.loyalty / 100f;
        wisdomSlider.value  = item.ability.wisdom / 100f;
        discipline.value    = item.ability.discipline / 100f;
        roleName.text       = item.name;
        introduction.text   = item.introduction;

        qy.PlayerData.RoleState state = GameMainManager.Instance.playerData.GetRoleState(item.id);
        switch (state)
        {
        case qy.PlayerData.RoleState.Dide:
            stateGO.SetActive(true);
            stateText.text = "已死亡";
            break;

        case qy.PlayerData.RoleState.Pass:
            stateGO.SetActive(true);
            stateText.text = "已通关";
            break;

        default:
            stateGO.SetActive(false);
            break;
        }
    }
コード例 #4
0
    public override void SetData(object data)
    {
        this.data = data as RoleItem;

        var sp =
            March.Core.ResourceManager.ResourceManager.instance.Load <Sprite>(Configure.StoryPerson,
                                                                              this.data.headIcon);

        head.sprite = sp;
        GameUtils.Scaling(head.transform as RectTransform, new Vector2(sp.texture.width, sp.texture.height));

        //string headUrl = FilePathTools.GetPersonHeadPath(this.data.headIcon);
        //AssetsManager.Instance.LoadAssetAsync<Sprite>(headUrl, (sp) =>
        //{
        //    head.sprite = sp;
        //    GameUtils.Scaling(head.transform as RectTransform, new Vector2(sp.texture.width, sp.texture.height));
        //});

        qy.PlayerData.RoleState state = qy.GameMainManager.Instance.playerData.GetRoleState(this.data.id);
        switch (state)
        {
        case qy.PlayerData.RoleState.Dide:
            stateGO.SetActive(true);
            stateText.text = "已死亡";
            break;

        case qy.PlayerData.RoleState.Pass:
            stateGO.SetActive(true);
            stateText.text = "已通关";
            break;

        default:
            stateGO.SetActive(false);
            break;
        }
    }