Exemple #1
0
 private void OnSelect(Button button)
 {
     if (Object.op_Equality((Object)button, (Object)null))
     {
         DebugUtility.LogError("Buttonが存在しません");
     }
     else
     {
         PlayBackUnitVoiceItem componentInChildren = (PlayBackUnitVoiceItem)((Component)button).get_gameObject().GetComponentInChildren <PlayBackUnitVoiceItem>();
         if (Object.op_Equality((Object)componentInChildren, (Object)null))
         {
             DebugUtility.LogError("PlayBackUnitVoiceItemが存在しません");
         }
         else if (componentInChildren.IsLocked)
         {
             this.mScrollRect.StopMovement();
             this.ShowUnlockConditionsTooltip(componentInChildren);
         }
         else
         {
             if (Object.op_Inequality((Object)this.mLastSelectItem, (Object)null) && this.mLastSelectItem.CueName != componentInChildren.CueName)
             {
                 this.mLastSelectItem.SetPlayingBadge(false);
             }
             componentInChildren.SetPlayingBadge(true);
             this.mLastSelectItem = componentInChildren;
             this.PlayVoice(componentInChildren.CueName);
         }
     }
 }
Exemple #2
0
        private void ShowUnlockConditionsTooltip(PlayBackUnitVoiceItem voice_item)
        {
            if (Object.op_Equality((Object)this.Preafab_UnlockConditionsTooltip, (Object)null))
            {
                return;
            }
            if (Object.op_Equality((Object)this.mUnlockConditionsTooltip, (Object)null))
            {
                this.mUnlockConditionsTooltip = (Tooltip)Object.Instantiate <Tooltip>((M0)this.Preafab_UnlockConditionsTooltip);
            }
            else
            {
                this.mUnlockConditionsTooltip.ResetPosition();
            }
            RectTransform component = (RectTransform)((Component)voice_item).GetComponent <RectTransform>();
            Vector2       localPos  = (Vector2)null;

            localPos.x = (__Null)0.0;
            localPos.y = (__Null)(component.get_sizeDelta().y / 2.0 + (double)this.TOOLTIP_POSITION_OFFSET_Y);
            Tooltip.SetTooltipPosition(component, localPos);
            if (!Object.op_Inequality((Object)this.mUnlockConditionsTooltip.TooltipText, (Object)null))
            {
                return;
            }
            this.mUnlockConditionsTooltip.TooltipText.set_text(voice_item.GetUnlockConditionsText());
        }
Exemple #3
0
        private void Refresh()
        {
            if (Object.op_Inequality((Object)this.mScrollRect, (Object)null) && Object.op_Inequality((Object)this.mScrollRect.get_verticalScrollbar(), (Object)null))
            {
                this.mScrollRect.get_verticalScrollbar().set_value(1f);
            }
            UnitData dataOfClass = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);

            if (dataOfClass == null)
            {
                DebugUtility.LogError("UnitDataがBindされていません");
            }
            else
            {
                this.mCurrentUnit = dataOfClass;
                if (this.mUnitVoiceData != null && this.mLastUnitUniqueID != -1L && this.mLastUnitUniqueID != this.mCurrentUnit.UniqueID)
                {
                    this.mUnitVoiceData.Cleanup();
                    this.mUnitVoiceData = (UnitData.UnitPlaybackVoiceData)null;
                }
                this.mLastUnitUniqueID = this.mCurrentUnit.UniqueID;
                if (this.mUnitVoiceData != null)
                {
                    this.mUnitVoiceData.Cleanup();
                }
                this.mUnitVoiceData = this.mCurrentUnit.GetUnitPlaybackVoiceData();
                if (this.mItems != null)
                {
                    for (int index = 0; index < this.mItems.Count; ++index)
                    {
                        if (!Object.op_Equality((Object)this.mItems[index], (Object)null))
                        {
                            this.mItems[index].SetActive(false);
                        }
                    }
                }
                if (Object.op_Equality((Object)this.ItemParent, (Object)null) || Object.op_Equality((Object)this.ItemTemplate, (Object)null))
                {
                    DebugUtility.LogError("リストテンプレートが存在しません");
                }
                else
                {
                    if (this.mUnitVoiceData.VoiceCueList.Count > this.mItems.Count)
                    {
                        int num = this.mUnitVoiceData.VoiceCueList.Count - this.mItems.Count;
                        for (int index = 0; index < num; ++index)
                        {
                            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                            if (!Object.op_Equality((Object)gameObject, (Object)null))
                            {
                                gameObject.get_transform().SetParent((Transform)this.ItemParent, false);
                                this.mItems.Add(gameObject);
                                SRPG_Button componentInChildren = (SRPG_Button)gameObject.GetComponentInChildren <SRPG_Button>();
                                if (Object.op_Equality((Object)componentInChildren, (Object)null))
                                {
                                    DebugUtility.LogError("Buttonが存在しません");
                                }
                                else
                                {
                                    componentInChildren.AddListener(new SRPG_Button.ButtonClickEvent(this.OnSelect));
                                }
                            }
                        }
                    }
                    for (int index = 0; index < this.mUnitVoiceData.VoiceCueList.Count; ++index)
                    {
                        GameObject            mItem = this.mItems[index];
                        PlayBackUnitVoiceItem componentInChildren = (PlayBackUnitVoiceItem)mItem.GetComponentInChildren <PlayBackUnitVoiceItem>();
                        if (Object.op_Equality((Object)componentInChildren, (Object)null))
                        {
                            DebugUtility.LogError("PlayBackUnitVoiceItemが取得できません");
                            break;
                        }
                        componentInChildren.SetUp(this.mUnitVoiceData.VoiceCueList[index]);
                        componentInChildren.Refresh();
                        componentInChildren.Unlock();
                        if (this.mUnitVoiceData.VoiceCueList[index].is_locked)
                        {
                            componentInChildren.Lock();
                        }
                        ((Object)mItem).set_name((string)this.mUnitVoiceData.VoiceCueList[index].cueInfo.name);
                        mItem.SetActive(true);
                    }
                }
            }
        }