コード例 #1
0
 /// <summary>
 /// モデルを追加する
 /// </summary>
 /// <param name="model"></param>
 private void AddModel(LiplisModel model)
 {
     //TODO CtrlModelController AddModel 登録キーチェックすべきか?
     TableModel.Add(model.ModelName, model);
     TableModelId.Add(model.AllocationId, model);
     ModelList.Add(model);
 }
コード例 #2
0
    /// <summary>
    /// キャラクターのパネルを生成する
    /// </summary>
    /// <param name="AllocationId"></param>
    /// <param name="rlBit"></param>
    /// <returns></returns>
    private GameObject CreateCharPanel(int AllocationId, bool rlBit)
    {
        //モデル取得
        LiplisModel model = modelController.TableModelId[AllocationId];

        //パネル
        GameObject panel;

        //
        if (rlBit)
        {
            panel = Instantiate(this.PrefabLogWindowL1) as GameObject;
        }
        else
        {
            panel = Instantiate(this.PrefabLogWindowR1) as GameObject;
        }

        //背景画像設定
        panel.transform.Find("ImgText").GetComponent <Image>().sprite = model.SpriteLogWindow;

        //キャラクターアイコン設定
        panel.transform.Find("ImgChar").GetComponent <Image>().sprite = model.SpriteCharIcon;

        return(panel);
    }
コード例 #3
0
        /// <summary>
        /// ウインドウ作成
        /// </summary>
        /// <param name="message"></param>
        /// <param name="AllocationId"></param>
        public void CreateWindow(string message, int AllocationId)
        {
            //キャラクターデータ取得
            LiplisModel charData = LiplisModels.Instance.GetCharacterModel(AllocationId);

            //おしゃべりウインドウ生成し、現在ウインドウ設置
            this.NowTalkWindow = charData.CreateWindowTalk(message, TextMainTalk);
        }
コード例 #4
0
ファイル: CtrlTalk.cs プロジェクト: kknet/LiplisMoonLight
    /// <summary>
    /// ウインドウ作成
    /// </summary>
    /// <param name="message"></param>
    /// <param name="AllocationId"></param>
    public void CreateWindow(string message, int AllocationId)
    {
        //キャラクターデータ取得
        LiplisModel charData = modelController.GetCharacterModel(AllocationId);

        //おしゃべりウインドウ生成し、現在ウインドウ設置
        this.NowTalkWindow = charData.CreateWindowTalk(message);
    }
コード例 #5
0
        /// <summary>
        /// 天気文章をセットする
        ///
        /// TODO CtrlTalk:SetWetherSentence アロケーションIDの付け方再考
        /// </summary>
        /// <param name="topic"></param>
        public void SetWetherSentence(MsgTopic topic)
        {
            //NULLチェック
            if (LiplisStatus.Instance.InfoWether.WetherDtlList == null)
            {
                return;
            }

            if (LiplisStatus.Instance.InfoWether.WetherDtlList.Count < 1)
            {
                return;
            }

            if (topic.TalkSentenceList.Count < 1)
            {
                return;
            }

            //最終センテンス取得
            MsgSentence lastSentence = topic.TalkSentenceList[topic.TalkSentenceList.Count - 1];

            //現在時刻取得
            DateTime dt = DateTime.Now;

            //天気コード取得
            MsgDayWether todayWether = LiplisStatus.Instance.InfoWether.GetWetherSentenceToday(dt);

            //0~12 今日 午前、午後、夜の天気
            if (dt.Hour >= 0 && dt.Hour <= 18)
            {
                //次モデル取得
                LiplisModel model = LiplisModels.Instance.GetCharacterModelNext(lastSentence.AllocationId);

                //センテンス生成
                LiplisWeather.CreateWetherMessage("今日の天気は", todayWether, topic.TalkSentenceList, model.Tone, model.AllocationId);
            }

            //19~23 明日の天気
            else if (dt.Hour >= 19 && dt.Hour <= 23)
            {
                //明日の天気も取得
                MsgDayWether tomorrowWether = LiplisStatus.Instance.InfoWether.GetWetherSentenceTommorow(dt);

                //次モデル取得
                LiplisModel model1 = LiplisModels.Instance.GetCharacterModelNext(lastSentence.AllocationId);

                //1文目追加
                LiplisWeather.CreateWetherMessage("", todayWether, topic.TalkSentenceList, model1.Tone, model1.AllocationId);

                //次モデル取得
                LiplisModel model2 = LiplisModels.Instance.GetCharacterModelNext(model1.AllocationId);

                //2文目追加
                LiplisWeather.CreateWetherMessage("明日の天気は", tomorrowWether, topic.TalkSentenceList, model2.Tone, model2.AllocationId);
            }
        }
コード例 #6
0
        /// <summary>
        /// アニバーサリーセンテンスをセットする。
        /// </summary>
        /// <param name="topic"></param>
        public void SetAnniversarySentence(MsgTopic topic)
        {
            //データ取得
            ResWhatDayIsToday DataList = LiplisStatus.Instance.InfoAnniversary.DataList;

            if (DataList == null)
            {
                return;
            }

            int sentenceIdx  = 0;
            int AllocationId = 0;

            foreach (var data in DataList.AnniversaryDaysList)
            {
                foreach (MsgSentence talkSentence in data.TalkSentenceList)
                {
                    MsgSentence sentence = talkSentence.Clone();

                    //キャラデータ取得
                    LiplisModel cahrData = LiplisModels.Instance.TableModelId[AllocationId];

                    if (sentenceIdx == 0)
                    {
                        sentence.BaseSentence = "今日は" + sentence.BaseSentence + "みたいです~♪";
                        sentence.ToneConvert();
                        //sentence.TalkSentence = sentence.BaseSentence;
                    }
                    else
                    {
                        sentence.ToneConvert();
                    }

                    //アロケーションID設定
                    sentence.AllocationId = AllocationId;

                    //インデックスインクリメント
                    sentenceIdx++;
                    AllocationId++;

                    //アロケーションIDコントロール
                    if (AllocationId > LiplisModels.Instance.GetMaxAllocationId())
                    {
                        AllocationId = 0;
                    }

                    //センテンスを追加
                    topic.TalkSentenceList.Add(sentence);
                }
            }
        }
コード例 #7
0
        /// <summary>
        /// 適当なニュースを取得する
        /// </summary>
        /// <returns></returns>
        public MsgTopic CreateTopicFromShortNews()
        {
            //一人のデータを取得する
            LiplisModel charData = GetCharacterRandam();

            //おしゃべりメッセージを取得
            MsgTalkMessage msg = ClalisShortNews.getShortNews("", "", "");

            //トピックを生成
            MsgTopic topic = new MsgTopic(charData.Tone, msg.sorce, msg.sorce, 0, 0, false, charData.AllocationId);

            //ショートニュースからトピックを生成する
            return(topic);
        }
コード例 #8
0
        //====================================================================
        //
        //                           イベントハンドラ
        //
        //====================================================================
        #region イベントハンドラ

        /// <summary>
        /// アイテム更新
        /// </summary>
        /// <returns></returns>
        private IEnumerator updateItem()
        {
            if (this.dataIndex == -1)
            {
                yield break;
            }

            //センテンス取得
            MsgSentence data = ScrollViewControllerTalk.sc.TalkSentenceList[this.dataIndex];

            //モデル取得
            LiplisModel charData = LiplisModels.Instance.TableModelId[data.AllocationId];

            if (this.dataIndex % 2 == 0)
            {
                iconLeft.gameObject.SetActive(true);
                iconRight.gameObject.SetActive(false);
                nameLeft.gameObject.SetActive(true);
                nameRight.gameObject.SetActive(false);
                imageBalloonLeft.gameObject.SetActive(true);
                imageBalloonRight.gameObject.SetActive(false);
                nameLeft.text   = charData.ModelName;
                iconLeft.sprite = charData.SpriteCharIcon;

                imageBalloonLeft.color = charData.GetColorFromSetting();

                messageLeft.text = data.TalkSentence;
            }
            else
            {
                iconLeft.gameObject.SetActive(false);
                iconRight.gameObject.SetActive(true);
                nameLeft.gameObject.SetActive(false);
                nameRight.gameObject.SetActive(true);
                imageBalloonLeft.gameObject.SetActive(false);
                imageBalloonRight.gameObject.SetActive(true);
                nameRight.text   = charData.ModelName;
                iconRight.sprite = charData.SpriteCharIcon;

                imageBalloonRight.color = charData.GetColorFromSetting();

                messageRight.text = data.TalkSentence;
            }
        }
コード例 #9
0
        /// <summary>
        /// キャラクター位置をシャッフルする
        /// </summary>
        public void ShuffleCharPosition(MsgTopic topic)
        {
            //位置リストを取得
            Dictionary <MST_CARACTER_POSITION, Vector3> locationList = SearchLocationList();

            //キャラクターロケーションYリスト
            Dictionary <MST_CARACTER_POSITION, float> CharLocationYList = SearchCharLocationYList();

            //前回キャラクター位置
            List <LiplisModel> PrvCharList = new List <LiplisModel>(ModelList);

            //先頭アロケーションID取得
            int allocationId = topic.TalkSentenceList[0].AllocationId;

            //範囲内なら選択
            if (allocationId >= 0 && allocationId <= 3)
            {
                //司会設定
                TableModelId[allocationId].Position = MST_CARACTER_POSITION.Moderator;
            }
            else
            {
                //ポジションの初期化
                initPosition();

                foreach (KeyValuePair <string, LiplisModel> kv in TableModel)
                {
                    kv.Value.MoveTarget();
                }

                return;
            }

            //司会キャラ
            LiplisModel moderator = TableModelId[allocationId];

            //その他位置キャラリスト
            List <LiplisModel> OtherCharList = SearchMember(allocationId);

            //もし司会がNULLなら、初期配置に戻す
            if (moderator == null)
            {
                //ポジションの初期化
                initPosition();

                foreach (KeyValuePair <string, LiplisModel> kv in TableModel)
                {
                    kv.Value.MoveTarget();
                }

                return;
            }

            //位置リスト
            List <MST_CARACTER_POSITION> PosList = CreatePosList();

            //選択されたもの以外の位置をほかのキャラクターにセットする
            foreach (LiplisModel charData in OtherCharList)
            {
                //ポジション設定
                charData.Position = PosList.Dequeue();
            }

            //Y座標の補正 身長差の分、位置がずれてしまうため補正
            int idx = 0;

            foreach (LiplisModel model in ModelList)
            {
                //身長差を算出
                float diff = model.LocationY - CharLocationYList[model.Position];

                //移動後Y座標
                float afterMovementY = locationList[model.Position].y + diff;

                //位置リストのY座標を更新
                locationList[model.Position] = new Vector3(locationList[model.Position].x, afterMovementY, locationList[model.Position].z);

                //インデックスインクリメント
                idx++;
            }

            //移動
            foreach (LiplisModel model in ModelList)
            {
                model.ModelLocation = locationList[model.Position];
                model.MoveTarget(locationList[model.Position]);
            }
        }