Skip to content

Commit c3f79f3

Browse files
committed
refactor(UI): Split JCS_CanvasComp module
1 parent 9efce24 commit c3f79f3

File tree

3 files changed

+31
-25
lines changed

3 files changed

+31
-25
lines changed

Assets/JCSUnity/Scripts/UI/JCS_Canvas.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,6 @@
1111

1212
namespace JCSUnity
1313
{
14-
/// <summary>
15-
/// Component that requires the component `JCS_Canvas` without
16-
/// actually inherit the class `JCS_Canvas`.
17-
/// </summary>
18-
[RequireComponent(typeof(JCS_Canvas))]
19-
public class JCS_CanvasComp<T> : MonoBehaviour
20-
{
21-
/* Variables */
22-
23-
protected JCS_Canvas mCanvas = null;
24-
25-
/* Setter & Getter */
26-
27-
/* Functions */
28-
29-
protected virtual void Awake()
30-
{
31-
this.mCanvas = this.GetComponent<JCS_Canvas>();
32-
}
33-
34-
public void Show() => mCanvas.Show();
35-
public void Hide() => mCanvas.Hide();
36-
public void ToggleVisibility() => mCanvas.ToggleVisibility();
37-
}
38-
3914
/// <summary>
4015
/// Control of the canvas component.
4116
/// </summary>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using UnityEngine;
2+
3+
namespace JCSUnity
4+
{
5+
/// <summary>
6+
/// Component that requires the component `JCS_Canvas` without
7+
/// actually inherit the class `JCS_Canvas`.
8+
/// </summary>
9+
[RequireComponent(typeof(JCS_Canvas))]
10+
public class JCS_CanvasComp<T> : MonoBehaviour
11+
{
12+
/* Variables */
13+
14+
protected JCS_Canvas mCanvas = null;
15+
16+
/* Setter & Getter */
17+
18+
/* Functions */
19+
20+
protected virtual void Awake()
21+
{
22+
this.mCanvas = this.GetComponent<JCS_Canvas>();
23+
}
24+
25+
public void Show() => mCanvas.Show();
26+
public void Hide() => mCanvas.Hide();
27+
public void ToggleVisibility() => mCanvas.ToggleVisibility();
28+
}
29+
}

Assets/JCSUnity/Scripts/UI/JCS_CanvasComp.cs.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)