Ejemplo n.º 1
0
    public void AddMaterial(ListItemModel material)
    {
        material.Appear();
        material.SkipAppearing(); // TODO : 演出を入れるなら消す

        m_materials.Add(material);
    }
Ejemplo n.º 2
0
    protected override void Start()
    {
        base.Start();

        episodeQuestSelect.SetPosition(new Vector2(0, -44), new Vector2(0, -251));

//        episodeQuestSelect.BackGroundImage = BGSprite;
        episodeQuestSelect.EpisodeTitle = "エピソード名";
        episodeQuestSelect.AreaTitle    = "エリア名";

        Sprite select1 = ResourceManager.Instance.Load("icon_circle_1");
        Sprite select2 = ResourceManager.Instance.Load("icon_circle_2");

        for (int i = 0; i < AreaCount; i++)
        {
            uint index = (uint)i;
            var  model = new EpisodeDataListItemModel(index);
            model.OnClicked += () =>
            {
            };

            EpisodeDataContext newEpisode = new EpisodeDataContext(model);
            if (i == 0)
            {
                newEpisode.SelectImage = select2;
                newEpisode.IsSelected  = true;
            }
            else
            {
                newEpisode.SelectImage = select1;
                newEpisode.IsSelected  = false;
            }
            newEpisode.m_EpisodeId = index;
            episodeQuestSelect.EpisodeList.Add(newEpisode);
        }

        for (int i = 0; i < QuestCount; i++)
        {
            uint index = (uint)i;
            var  model = new ListItemModel(index);
            model.OnClicked += () =>
            {
            };

            QuestDataContext newQuest = new QuestDataContext(model);
            //cnewQuest.BackGroundTexture = BGSprite.texture;
            newQuest.Title       = "クエスト" + index.ToString();
            newQuest.Index       = index;
            newQuest.Point       = ((uint)(index * 5) + 5).ToString();
            newQuest.SelectImage = select2;
            newQuest.IconLabel   = "BOSS";
            newQuest.m_QuestId   = index;
            episodeQuestSelect.QuestList.Add(newQuest);

            // TODO : 演出を入れるならその場所に移動
            model.Appear();
            model.SkipAppearing();
        }
    }
Ejemplo n.º 3
0
    public void SetDetail(PacketStructHero heroData, Action <HeroStoryListItemContext> _OnClickStoryItem)
    {
        ClearView();
        if (heroData == null || heroData.hero_id == 0)
        {
            return;
        }
        MasterDataHero heroMaster = MasterFinder <MasterDataHero> .Instance.Find((int)heroData.hero_id);

        if (heroMaster == null)
        {
            return;
        }

        SetUpHeroName(heroData.hero_id); // 名前
        MessageText = heroMaster.detail; // 詳細テキスト

        AssetBundler.Create().Set("hero_" + heroData.hero_id.ToString("0000"), "hero_" + heroData.hero_id.ToString("0000"), (o) =>
        {
            Sprite[] sprite = o.AssetBundle.LoadAssetWithSubAssets <Sprite>("hero_" + heroData.hero_id.ToString("0000"));
            HeroImage       = sprite[4];
        }).Load();
        //------------------------------------------------------------------
        // グレードの設定
        //------------------------------------------------------------------
        m_GradeNum = heroData.level;

        MasterDataHeroLevel nextHeroLevelMaster = MasterFinder <MasterDataHeroLevel> .Instance.Find((int)heroData.level + 1);

        if (nextHeroLevelMaster != null)
        {
            m_NextGradeNum = nextHeroLevelMaster.exp_next_total - heroData.exp;
        }
        else
        {
            m_NextGradeNum = 0;
        }

        //------------------------------------------------------------------
        // イラストレーター名
        //------------------------------------------------------------------
        MasterDataIllustrator illustratorMaster = MasterFinder <MasterDataIllustrator> .Instance.Find((int)heroMaster.illustrator_id);

        if (illustratorMaster != null)
        {
            IllustratorText = illustratorMaster.name;
        }

        //------------------------------------------------------------------
        // スキルの設定
        //------------------------------------------------------------------
        List <UnitSkillContext> skillList = new List <UnitSkillContext>();
        UnitSkillContext        skill     = new UnitSkillContext();

        skill.setupHeroSkill((uint)heroMaster.default_skill_id, heroData.hero_id, m_GradeNum, true);
        skillList.Add(skill);
        Skills = skillList;

        //------------------------------------------------------------------
        // ストーリの設定
        //------------------------------------------------------------------
        List <HeroStoryListItemContext> storyList = new List <HeroStoryListItemContext>();

        for (int i = 0; i < 4; ++i)
        {
            var model = new ListItemModel((uint)i);
            HeroStoryListItemContext story = new HeroStoryListItemContext(model);
            story.StoryTitle = "";
            storyList.Add(story);

            model.OnClicked += () =>
            {
                _OnClickStoryItem(story);
            };

            // TODO : 演出を入れるならそこに移動
            model.Appear();
            model.SkipAppearing();
        }

        SetStory(storyList[0], (uint)heroData.hero_id);
        storyList[1].ContentText = "";
        storyList[2].ContentText = "";
        storyList[3].ContentText = "";

        storyList[0].IsOpenStory = true;

        Stories = storyList;
    }