input/output + refactoring

This commit is contained in:
klemek
2020-12-16 19:00:40 +01:00
parent eeaf611158
commit 1a70942e8e
23 changed files with 1272 additions and 52 deletions
+61
View File
@@ -0,0 +1,61 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace UntitledLogicGame.Workspace
{
public class InputGate : Gate
{
#region Unity Properties
#endregion
#region Public Properties
public bool State { get; set; }
#endregion
#region Private Properties
private Anchor OutputAnchor {
get
{
if (_outputAnchor == null)
_outputAnchor = Anchors.First(g => g.Name == "Q");
return _outputAnchor;
}
}
private Anchor _outputAnchor;
#endregion
#region Unity Methods
private void Start()
{
Utils.RandomName("Input", gameObject);
}
private void FixedUpdate()
{
if ((Sprite.Hovering || OutputAnchor.Hovering) && PointerManager.Instance.DoubleClick())
{
State = !State;
OutputAnchor.Activated = State;
}
}
#endregion
#region Public Methods
#endregion
#region Private Methods
#endregion
}
}