| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Thursday, March 15, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using TableConfig; |
| | | using System; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class FairyTreasureCollectPanel : MonoBehaviour |
| | | { |
| | | |
| | | [SerializeField] TreasureContainer[] m_TreasureContainers; |
| | | |
| | | public void Display(int _treasureId, bool _tween = false) |
| | | { |
| | | for (int i = 0; i < m_TreasureContainers.Length; i++) |
| | | { |
| | | var treasureContainer = m_TreasureContainers[i]; |
| | | treasureContainer.container.gameObject.SetActive(false); |
| | | for (int j = 0; j < treasureContainer.treasures.Length; j++) |
| | | { |
| | | var treasure = treasureContainer.treasures[j]; |
| | | if (treasure == _treasureId) |
| | | { |
| | | treasureContainer.container.gameObject.SetActive(true); |
| | | treasureContainer.container.Display(_treasureId, _tween); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | public void Dispose() |
| | | { |
| | | for (int i = 0; i < m_TreasureContainers.Length; i++) |
| | | { |
| | | var treasureContainer = m_TreasureContainers[i]; |
| | | treasureContainer.container.gameObject.SetActive(false); |
| | | treasureContainer.container.Dispose(); |
| | | } |
| | | } |
| | | |
| | | [System.Serializable] |
| | | public struct TreasureContainer |
| | | { |
| | | public int[] treasures; |
| | | public FairyTreasureCollect container; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Thursday, March 15, 2018
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | using System;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FairyTreasureCollectPanel : MonoBehaviour
|
| | | {
|
| | |
|
| | | [SerializeField] TreasureContainer[] m_TreasureContainers;
|
| | |
|
| | | public void Display(int _treasureId, bool _tween = false)
|
| | | {
|
| | | for (int i = 0; i < m_TreasureContainers.Length; i++)
|
| | | {
|
| | | var treasureContainer = m_TreasureContainers[i];
|
| | | treasureContainer.container.gameObject.SetActive(false);
|
| | | for (int j = 0; j < treasureContainer.treasures.Length; j++)
|
| | | {
|
| | | var treasure = treasureContainer.treasures[j];
|
| | | if (treasure == _treasureId)
|
| | | {
|
| | | treasureContainer.container.gameObject.SetActive(true);
|
| | | treasureContainer.container.Display(_treasureId, _tween);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public void Dispose()
|
| | | {
|
| | | for (int i = 0; i < m_TreasureContainers.Length; i++)
|
| | | {
|
| | | var treasureContainer = m_TreasureContainers[i];
|
| | | treasureContainer.container.gameObject.SetActive(false);
|
| | | treasureContainer.container.Dispose();
|
| | | }
|
| | | }
|
| | |
|
| | | [System.Serializable]
|
| | | public struct TreasureContainer
|
| | | {
|
| | | public int[] treasures;
|
| | | public FairyTreasureCollect container;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|