From d208236adc2b13d5ba8feadaa8081ab6f829be09 Mon Sep 17 00:00:00 2001 From: klemek Date: Tue, 22 Dec 2020 15:48:34 +0100 Subject: [PATCH] found a name --- Assets/Scenes/Workspace.unity | 6 +++--- Assets/Scripts/CameraManager.cs | 2 +- Assets/Scripts/DefaultScript.cs | 2 +- Assets/Scripts/GameManager.cs | 4 ++-- Assets/Scripts/PointerManager.cs | 4 ++-- Assets/Scripts/UI/UIDelete.cs | 2 +- Assets/Scripts/UI/UIFolder.cs | 2 +- Assets/Scripts/UI/UIGate.cs | 9 +++++---- Assets/Scripts/UI/UIManager.cs | 4 ++-- Assets/Scripts/UI/UIToolbarButton.cs | 2 +- Assets/Scripts/Utils.cs | 2 +- Assets/Scripts/Workspace/Anchor.cs | 2 +- Assets/Scripts/Workspace/Cable.cs | 2 +- Assets/Scripts/Workspace/Gate.cs | 4 ++-- Assets/Scripts/Workspace/GatePrefabFactory.cs | 6 +++--- Assets/Scripts/Workspace/GateSprite.cs | 4 ++-- Assets/Scripts/Workspace/Gates/GateDefinition.cs | 2 +- Assets/Scripts/Workspace/Gates/GateDefinitionList.cs | 2 +- Assets/Scripts/Workspace/Gates/GateType.cs | 2 +- Assets/Scripts/Workspace/Gates/State.cs | 2 +- Assets/Scripts/Workspace/InputGate.cs | 2 +- Assets/Scripts/Workspace/OutputGate.cs | 2 +- ProjectSettings/ProjectSettings.asset | 2 +- TODO.txt | 6 +++--- 24 files changed, 39 insertions(+), 38 deletions(-) diff --git a/Assets/Scenes/Workspace.unity b/Assets/Scenes/Workspace.unity index 16dec54..ab1efcd 100755 --- a/Assets/Scenes/Workspace.unity +++ b/Assets/Scenes/Workspace.unity @@ -440,7 +440,7 @@ Camera: m_GameObject: {fileID: 519420028} m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 1 + m_ClearFlags: 4 m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} m_projectionMatrixMode: 1 m_GateFitMode: 2 @@ -458,7 +458,7 @@ Camera: far clip plane: 1000 field of view: 60 orthographic: 1 - orthographic size: 20 + orthographic size: 15 m_Depth: -1 m_CullingMask: serializedVersion: 2 @@ -482,7 +482,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 519420028} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -20} + m_LocalPosition: {x: 0, y: 0, z: -15} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1835199860} diff --git a/Assets/Scripts/CameraManager.cs b/Assets/Scripts/CameraManager.cs index 12b1ed7..9cb55ec 100755 --- a/Assets/Scripts/CameraManager.cs +++ b/Assets/Scripts/CameraManager.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using UnityEngine; -namespace UntitledLogicGame +namespace CompuLogic { public class CameraManager : MonoBehaviour { diff --git a/Assets/Scripts/DefaultScript.cs b/Assets/Scripts/DefaultScript.cs index 5cd63bc..75dc01f 100755 --- a/Assets/Scripts/DefaultScript.cs +++ b/Assets/Scripts/DefaultScript.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -namespace UntitledLogicGame +namespace CompuLogic { //public class TODO : MonoBehaviour //{ diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 08eb2c8..872824e 100755 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -2,9 +2,9 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -using UntitledLogicGame.Workspace; +using CompuLogic.Workspace; -namespace UntitledLogicGame +namespace CompuLogic { public class GameManager : MonoBehaviour { diff --git a/Assets/Scripts/PointerManager.cs b/Assets/Scripts/PointerManager.cs index 7c7be0b..024de7a 100755 --- a/Assets/Scripts/PointerManager.cs +++ b/Assets/Scripts/PointerManager.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -using UntitledLogicGame.Workspace; +using CompuLogic.Workspace; -namespace UntitledLogicGame +namespace CompuLogic { public class PointerManager : MonoBehaviour { diff --git a/Assets/Scripts/UI/UIDelete.cs b/Assets/Scripts/UI/UIDelete.cs index 986aa82..af1ff80 100755 --- a/Assets/Scripts/UI/UIDelete.cs +++ b/Assets/Scripts/UI/UIDelete.cs @@ -4,7 +4,7 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; -namespace UntitledLogicGame.UI +namespace CompuLogic.UI { public class UIDelete : UIToolbarButton, IPointerEnterHandler, IPointerExitHandler { diff --git a/Assets/Scripts/UI/UIFolder.cs b/Assets/Scripts/UI/UIFolder.cs index 63441b1..c392496 100755 --- a/Assets/Scripts/UI/UIFolder.cs +++ b/Assets/Scripts/UI/UIFolder.cs @@ -6,7 +6,7 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; -namespace UntitledLogicGame.UI +namespace CompuLogic.UI { public class UIFolder : UIToolbarButton { diff --git a/Assets/Scripts/UI/UIGate.cs b/Assets/Scripts/UI/UIGate.cs index 27ec573..e7295f4 100755 --- a/Assets/Scripts/UI/UIGate.cs +++ b/Assets/Scripts/UI/UIGate.cs @@ -6,9 +6,9 @@ using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; -using UntitledLogicGame.Workspace; +using CompuLogic.Workspace; -namespace UntitledLogicGame.UI +namespace CompuLogic.UI { public class UIGate : UIToolbarButton { @@ -18,11 +18,12 @@ namespace UntitledLogicGame.UI get { if(_maxSize == null) - _maxSize = GameManager.Instance.GateSprites.Select(s => s.rect.width).Max(); + _maxSize = GameManager.Instance.GateSprites.Select(s => Math.Max(s.rect.width, s.rect.height)).Max(); return _maxSize.Value; } } private float? _maxSize; + #endregion #region Unity Properties @@ -37,7 +38,7 @@ namespace UntitledLogicGame.UI { var sprite = value.GetComponentInChildren().sprite; Image.sprite = sprite; - Image.GetComponent().sizeDelta = new Vector2(100f, 100 * sprite.rect.width / MaxSize); + Image.GetComponent().sizeDelta = new Vector2(100f, 100 * Math.Max(sprite.rect.width, sprite.rect.height) / MaxSize); gameObject.name = "UI_" + value.GateType.ToString(); Text.text = value.UIName; } diff --git a/Assets/Scripts/UI/UIManager.cs b/Assets/Scripts/UI/UIManager.cs index 225e0e0..16a378a 100755 --- a/Assets/Scripts/UI/UIManager.cs +++ b/Assets/Scripts/UI/UIManager.cs @@ -3,9 +3,9 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; -using UntitledLogicGame.Workspace.Gates; +using CompuLogic.Workspace.Gates; -namespace UntitledLogicGame.UI +namespace CompuLogic.UI { public class UIManager : MonoBehaviour { diff --git a/Assets/Scripts/UI/UIToolbarButton.cs b/Assets/Scripts/UI/UIToolbarButton.cs index eb2ba2c..e2999e9 100755 --- a/Assets/Scripts/UI/UIToolbarButton.cs +++ b/Assets/Scripts/UI/UIToolbarButton.cs @@ -6,7 +6,7 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; -namespace UntitledLogicGame.UI +namespace CompuLogic.UI { public class UIToolbarButton : MonoBehaviour, IPointerDownHandler { diff --git a/Assets/Scripts/Utils.cs b/Assets/Scripts/Utils.cs index 95650ac..c0c5c0e 100755 --- a/Assets/Scripts/Utils.cs +++ b/Assets/Scripts/Utils.cs @@ -4,7 +4,7 @@ using System.Linq; using UnityEngine; using Random = UnityEngine.Random; -namespace UntitledLogicGame +namespace CompuLogic { public static class Utils { diff --git a/Assets/Scripts/Workspace/Anchor.cs b/Assets/Scripts/Workspace/Anchor.cs index 4f84b74..2d41b51 100755 --- a/Assets/Scripts/Workspace/Anchor.cs +++ b/Assets/Scripts/Workspace/Anchor.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -namespace UntitledLogicGame.Workspace +namespace CompuLogic.Workspace { public class Anchor : MonoBehaviour { diff --git a/Assets/Scripts/Workspace/Cable.cs b/Assets/Scripts/Workspace/Cable.cs index 8974534..ac37f2f 100755 --- a/Assets/Scripts/Workspace/Cable.cs +++ b/Assets/Scripts/Workspace/Cable.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -namespace UntitledLogicGame.Workspace +namespace CompuLogic.Workspace { public class Cable : MonoBehaviour { diff --git a/Assets/Scripts/Workspace/Gate.cs b/Assets/Scripts/Workspace/Gate.cs index 86d9444..1bbcab7 100755 --- a/Assets/Scripts/Workspace/Gate.cs +++ b/Assets/Scripts/Workspace/Gate.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -using UntitledLogicGame.Workspace.Gates; +using CompuLogic.Workspace.Gates; -namespace UntitledLogicGame.Workspace +namespace CompuLogic.Workspace { public class Gate : MonoBehaviour { diff --git a/Assets/Scripts/Workspace/GatePrefabFactory.cs b/Assets/Scripts/Workspace/GatePrefabFactory.cs index 7122a19..448d387 100755 --- a/Assets/Scripts/Workspace/GatePrefabFactory.cs +++ b/Assets/Scripts/Workspace/GatePrefabFactory.cs @@ -4,12 +4,12 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using UnityEngine; -using UntitledLogicGame.Workspace; -using UntitledLogicGame.Workspace.Gates; +using CompuLogic.Workspace; +using CompuLogic.Workspace.Gates; using YamlDotNet.Serialization; using YamlDotNet.Serialization.NamingConventions; -namespace UntitledLogicGame.Workspace +namespace CompuLogic.Workspace { public class GatePrefabFactory : MonoBehaviour { diff --git a/Assets/Scripts/Workspace/GateSprite.cs b/Assets/Scripts/Workspace/GateSprite.cs index 522e2f1..7105a0b 100755 --- a/Assets/Scripts/Workspace/GateSprite.cs +++ b/Assets/Scripts/Workspace/GateSprite.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -using UntitledLogicGame.Workspace.Gates; +using CompuLogic.Workspace.Gates; -namespace UntitledLogicGame.Workspace +namespace CompuLogic.Workspace { public class GateSprite : MonoBehaviour { diff --git a/Assets/Scripts/Workspace/Gates/GateDefinition.cs b/Assets/Scripts/Workspace/Gates/GateDefinition.cs index aaf8de5..7bb45b3 100755 --- a/Assets/Scripts/Workspace/Gates/GateDefinition.cs +++ b/Assets/Scripts/Workspace/Gates/GateDefinition.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace UntitledLogicGame.Workspace.Gates +namespace CompuLogic.Workspace.Gates { public abstract class GateDefinition { diff --git a/Assets/Scripts/Workspace/Gates/GateDefinitionList.cs b/Assets/Scripts/Workspace/Gates/GateDefinitionList.cs index afa1462..c48bdac 100755 --- a/Assets/Scripts/Workspace/Gates/GateDefinitionList.cs +++ b/Assets/Scripts/Workspace/Gates/GateDefinitionList.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace UntitledLogicGame.Workspace.Gates +namespace CompuLogic.Workspace.Gates { #region 000 - Technical diff --git a/Assets/Scripts/Workspace/Gates/GateType.cs b/Assets/Scripts/Workspace/Gates/GateType.cs index da0ff34..f64ff2c 100755 --- a/Assets/Scripts/Workspace/Gates/GateType.cs +++ b/Assets/Scripts/Workspace/Gates/GateType.cs @@ -1,4 +1,4 @@ -namespace UntitledLogicGame.Workspace.Gates +namespace CompuLogic.Workspace.Gates { public enum GateType { diff --git a/Assets/Scripts/Workspace/Gates/State.cs b/Assets/Scripts/Workspace/Gates/State.cs index fa831d4..5b1996f 100755 --- a/Assets/Scripts/Workspace/Gates/State.cs +++ b/Assets/Scripts/Workspace/Gates/State.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace UntitledLogicGame.Workspace.Gates +namespace CompuLogic.Workspace.Gates { public class InputState : State { diff --git a/Assets/Scripts/Workspace/InputGate.cs b/Assets/Scripts/Workspace/InputGate.cs index 8d2c126..2fde47e 100755 --- a/Assets/Scripts/Workspace/InputGate.cs +++ b/Assets/Scripts/Workspace/InputGate.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -namespace UntitledLogicGame.Workspace +namespace CompuLogic.Workspace { public class InputGate : Gate { diff --git a/Assets/Scripts/Workspace/OutputGate.cs b/Assets/Scripts/Workspace/OutputGate.cs index 92914e4..61b28fd 100755 --- a/Assets/Scripts/Workspace/OutputGate.cs +++ b/Assets/Scripts/Workspace/OutputGate.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; -namespace UntitledLogicGame.Workspace +namespace CompuLogic.Workspace { public class OutputGate : Gate { diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 3d17aaa..e1227fe 100755 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -13,7 +13,7 @@ PlayerSettings: useOnDemandResources: 0 accelerometerFrequency: 60 companyName: DefaultCompany - productName: Untitled Logic Game + productName: CompuLogic defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} diff --git a/TODO.txt b/TODO.txt index ca40739..bcb7524 100755 --- a/TODO.txt +++ b/TODO.txt @@ -1,10 +1,10 @@ TODO +-(1) finish gate book +-(1) mux/demux svg +-(1) change fonts -(2) named anchors (dezoom hide ?) -(3) clocks (1Hz, 5Hz, 10Hz, etc.) --(3) generic rect gates --(3) state gates (automatic prefab ?) -(3) cable overlap (same/diff circuit) -(5) cable management -(5) buses --(?) find a name