// Update is called once per frame void Update () { bool isUpdateArray = false; for (int i = 0; i < m_activeArray.Length; i++) { if (m_activeArray[i].WordsState == CharacterWords.EWordsState.VANISH) { CharacterWords words = m_activeList.Dequeue(); m_unactiveList.Enqueue(words); isUpdateArray = true; } } if (isUpdateArray) { m_activeArray = m_activeList.ToArray(); } OptimizePosition(); }
//せっけんくんのセリフを表示するにはここを一度呼び出して public void DrawSayTexture(ESayTexName eSayTexNo){ //表示カウント初期化 drawTimeCount = 0.0f; if (m_unactiveList.Count > 0) { for (int i = 0; i < m_activeArray.Length; i++) { if (m_activeArray[i].Words == eSayTexNo) { // 既に表示済みなら実行中止 return; } } CharacterWords words = m_unactiveList.Dequeue(); if (words) { //表示テクスチャの切り替え switch (sekkenNo) { case ESekkenNo.SekkenKun: words.SetWordsTexture(sekkenKunSpriteList[(int)eSayTexNo]); break; case ESekkenNo.SekkenChan: words.SetWordsTexture(sekkenChanSpriteList[(int)eSayTexNo]); break; case ESekkenNo.SekkenHero: words.SetWordsTexture(sekkenHeroSpriteList[(int)eSayTexNo]); break; } words.Words = (eSayTexNo); m_activeList.Enqueue(words); m_activeArray = m_activeList.ToArray(); words.gameObject.transform.parent = null; words.gameObject.transform.parent = transform; } } }