-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathUIFramework_ExampleManager.cs
93 lines (66 loc) · 2.66 KB
/
UIFramework_ExampleManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#region Header
/* ============================================
* Author : Strix
* Initial Creation Date : 2020-01-29
* Summary :
* Template : For Unity Editor V1
============================================ */
#endregion Header
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using System;
using System.Linq;
namespace UIFramework
{
/// <summary>
///
/// </summary>
public class UIFramework_ExampleManager : CanvasManager<UIFramework_ExampleManager, UIFramework_ExampleManager.ECanvas>
{
/* const & readonly declaration */
/* enum & struct declaration */
public enum ECanvas
{
Canvas_InventoryExample,
Canvas_PopupTextExample,
}
/* public - Field declaration */
public List<ECanvas> listShowCanvas = new List<ECanvas>();
/* protected & private - Field declaration */
Dictionary<ECanvas, UIFramework_ExampleCanvasBase> _mapExampleCanvas = new Dictionary<ECanvas, UIFramework_ExampleCanvasBase>();
Canvas _pCanvas;
// ========================================================================== //
/* public - [Do~Something] Function */
// ========================================================================== //
/* protected - [Override & Unity API] */
protected override void OnAwake()
{
base.OnAwake();
_pCanvas = GetComponent<Canvas>();
UIFramework_ExampleCanvasBase[] arrCanvas = GetComponentsInChildren<UIFramework_ExampleCanvasBase>();
_mapExampleCanvas = arrCanvas.ToDictionary(p => (ECanvas)System.Enum.Parse(typeof(ECanvas), p.name));
for (int i = 0; i < arrCanvas.Length; i++)
arrCanvas[i].gameObject.SetActive(false);
for (int i = 0; i < listShowCanvas.Count; i++)
DoShowOnly(listShowCanvas[i]);
}
protected override void OnInit_ManagerLogic(CanvasManagerLogicFactory pLogicFactory)
{
}
protected override IEnumerator OnCreate_Instance(ECanvas eName, bool bIsMultiple, Action<ICanvas> OnFinish)
{
OnFinish(_mapExampleCanvas[eName]);
yield break;
}
public override Canvas GetParentCanvas(ECanvas eName, ICanvas pCanvas)
{
return _pCanvas;
}
/* protected - [abstract & virtual] */
// ========================================================================== //
#region Private
#endregion Private
}
}