Added WindowComponents class
This commit is contained in:
@@ -4,6 +4,8 @@ namespace InterfaceOff
|
||||
{
|
||||
public abstract class WindowBase : MonoBehaviour
|
||||
{
|
||||
public WindowComponents Components { get; set; }
|
||||
|
||||
public void InstantiateWindowBase()
|
||||
{
|
||||
}
|
||||
|
||||
10
Assets/Scripts/WindowComponents.cs
Normal file
10
Assets/Scripts/WindowComponents.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace InterfaceOff
|
||||
{
|
||||
public class WindowComponents : MonoBehaviour
|
||||
{
|
||||
[field: SerializeField] public Image WindowImage { get; private set; }
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/WindowComponents.cs.meta
Normal file
3
Assets/Scripts/WindowComponents.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a14e8386dd24e3793287ff572cb78f8
|
||||
timeCreated: 1768300161
|
||||
@@ -36,15 +36,18 @@ namespace InterfaceOff
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
GameObject go = Instantiate(SampleChild, GameCanvas.transform);
|
||||
Type type = WindowTypes.GetRandom();
|
||||
go.SetActive(true);
|
||||
|
||||
Type type = WindowTypes.GetRandom();
|
||||
WindowBase windowBase = go.AddComponent(type) as WindowBase;
|
||||
|
||||
if (DebugUtils.IsNull(windowBase))
|
||||
{
|
||||
Debug.LogError("How did this happen");
|
||||
return;
|
||||
}
|
||||
|
||||
windowBase.Components = go.GetComponent<WindowComponents>();
|
||||
windowBase.InstantiateWindowBase();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user