-
Notifications
You must be signed in to change notification settings - Fork 0
/
IMvcView.cs
76 lines (64 loc) · 2.21 KB
/
IMvcView.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
#if NGUI
using System;
using System.Collections.Generic;
using UnityEngine;
using Renko.Utility;
namespace Renko.MVCFramework
{
/// <summary>
/// The interface to all MVC views.
/// You can implement this interface to create your custom base class for MVC views.
/// </summary>
public interface IMvcView {
/// <summary>
/// Returns the gameObject component of this view.
/// </summary>
GameObject ViewObject { get; }
/// <summary>
/// The unique id received from UIController upon creation.
/// </summary>
int ViewId { get; }
/// <summary>
/// Returns whether this view is active.
/// If you're using Recycle method, MVC will check for this flag whether this view can be reused.
/// </summary>
bool IsActive { get; }
/// <summary>
/// For integration with auto generated code with MVC base views.
/// You should use OnInitialize for the actual initialization process.
/// </summary>
void Awake();
/// <summary>
/// Use this method to resize UIPanel and handle view anchoring.
/// Called ONLY once after Awake() and before OnInitialize().
/// </summary>
void OnAdaptView(ScreenAdaptor viewSize, MvcRescaleType type);
/// <summary>
/// Use this method to handle initialization of fields, resources, etc.
/// Called ONLY once after Awake() and OnAdaptView().
/// </summary>
void OnInitialize(int viewId, MvcParameter param);
/// <summary>
/// Use this method to handle re-initialization of fields, resources, etc.
/// Will invoke OnViewShow() afterwards.
/// Called everytime this view is being recycled.
/// </summary>
void OnRecycle(int viewId, MvcParameter param);
/// <summary>
/// Use this method to handle view setup. Ideal place for a show animation, if any.
/// </summary>
void OnViewShow();
/// <summary>
/// Use this method to handle view hiding. Ideal place for a hide animation, if any.
/// You should return a MvcParameter value that represents a return data from this view.
/// If none, just return null.
/// </summary>
MvcParameter OnViewHide();
/// <summary>
/// Use this method to dispose unused resources.
/// Called right before destruction/deactivation of the view for cleanup.
/// </summary>
void OnDisposeView();
}
}
#endif