Added a new moving window type
This commit is contained in:
10
Assets/Scripts/Windows/BasicWindow.cs
Normal file
10
Assets/Scripts/Windows/BasicWindow.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace InterfaceOff
|
||||
{
|
||||
public class BasicWindow : WindowBase
|
||||
{
|
||||
public override void OnWindowClicked()
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Windows/BasicWindow.cs.meta
Normal file
3
Assets/Scripts/Windows/BasicWindow.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eac7797c414842e59b3acc1c0d6a542d
|
||||
timeCreated: 1768298931
|
||||
25
Assets/Scripts/Windows/MovingWindow.cs
Normal file
25
Assets/Scripts/Windows/MovingWindow.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace InterfaceOff
|
||||
{
|
||||
public class MovingWindow : WindowBase
|
||||
{
|
||||
private int m_Health = 5;
|
||||
|
||||
public override void OnWindowInstantiation()
|
||||
{
|
||||
Components.WindowImage.color = Color.red;
|
||||
Velocity = new Vector3(100, 100, 0);
|
||||
}
|
||||
|
||||
public override void OnWindowClicked()
|
||||
{
|
||||
/* Decreases health and destroys if at 0 */
|
||||
m_Health--;
|
||||
if (m_Health <= 0)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Windows/MovingWindow.cs.meta
Normal file
3
Assets/Scripts/Windows/MovingWindow.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7ad1aa722804bbba796feea129247f1
|
||||
timeCreated: 1768302389
|
||||
Reference in New Issue
Block a user