Browse Source

MAde for loops editable again

master
JoshuaReason 5 years ago
parent
commit
1cc1c8fe2c
19 changed files with 121 additions and 49 deletions
  1. +1
    -1
      Assets/Data/Inventory/BaseInventory.asset
  2. +2
    -2
      Assets/Data/Inventory/PlayerInventory.asset
  3. +3
    -0
      Assets/Data/Logic Blocks/For x2.asset
  4. +1
    -1
      Assets/Data/Logic Blocks/For x2.asset.meta
  5. +0
    -3
      Assets/Data/Logic Blocks/ForLoop.asset
  6. +2
    -2
      Assets/Data/Networking/Client/Realtime/ClientInventory.asset
  7. +8
    -0
      Assets/Models.meta
  8. +8
    -0
      Assets/Plugins/IngameDebugConsole/Android.meta
  9. +8
    -0
      Assets/Plugins/IngameDebugConsole/Prefabs.meta
  10. +8
    -0
      Assets/Plugins/IngameDebugConsole/Scripts.meta
  11. +8
    -0
      Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta
  12. +2
    -2
      Assets/Scenes/Client Scenes/ClientScene.unity
  13. +3
    -3
      Assets/Scenes/ColourCollide_Smaller.unity
  14. +7
    -27
      Assets/Scripts/Logic/Blocks/CombinedBlock.cs
  15. +30
    -0
      Assets/Scripts/Logic/Blocks/EditableBlock.cs
  16. +11
    -0
      Assets/Scripts/Logic/Blocks/EditableBlock.cs.meta
  17. +8
    -0
      Assets/Scripts/LogicBlocks.meta
  18. +6
    -1
      Assets/Scripts/UI/Lobby/LobbyUIController.cs
  19. +5
    -7
      Assets/Scripts/UI/LogicTrayUI.cs

+ 1
- 1
Assets/Data/Inventory/BaseInventory.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6e4c66a6bd49ce2a4272d7a654c5f672cace8afca5f31e4902f701fd892b2651
oid sha256:9310fa0d8f14f0a8df3edf310504907081a4a345138aaa3ce16831b6f0a5c70a
size 1090

+ 2
- 2
Assets/Data/Inventory/PlayerInventory.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b461219fe61fa8068804d40407fb1e13919f1586959b20af63ed803c87d8ce40
size 972
oid sha256:1e015a0da38e87891400b0cad46b1694e7d1399516e89a36259b3b10d215c932
size 981

+ 3
- 0
Assets/Data/Logic Blocks/For x2.asset View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:393d8fb1306335f183f74173908fb0c1e76fe2bf1979a837f371a508947102a1
size 550

Assets/Data/Logic Blocks/ForLoop.asset.meta → Assets/Data/Logic Blocks/For x2.asset.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 194f051bd7d3e7d4fb5b96a8e1d5b162
guid: e11629d4fbb1e8246b7d4f003800bfa0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

+ 0
- 3
Assets/Data/Logic Blocks/ForLoop.asset View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f6712f10315d70ca4180ef96202f61cc5350369d0f8ca8a441e9401d88dd531c
size 572

+ 2
- 2
Assets/Data/Networking/Client/Realtime/ClientInventory.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7fa1e723385e9f306464c0178b5b65a91e021048f897888eb6f62fbd9cb6e178
size 420
oid sha256:0cac147b3e2a80da6d6842107c757978b02be0bbc606a1bd80ec5bc588ef56fc
size 756

+ 8
- 0
Assets/Models.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 296bd90e667df1f4697823a0aa45acf0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Plugins/IngameDebugConsole/Android.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3d7d7a61a5341904eb3c65af025b1d86
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Plugins/IngameDebugConsole/Prefabs.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7dbc36665bc0d684db9a4447e27a7a4b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Plugins/IngameDebugConsole/Scripts.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 860c08388401a6d4e858fe4910ea9337
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f6caae32d463529478f2186f47c2e3fe
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 2
- 2
Assets/Scenes/Client Scenes/ClientScene.unity View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641222, b: 0.57481694, a: 1}
m_IndirectSpecularColor: {r: 0.44657868, g: 0.49641263, b: 0.57481706, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -685,7 +685,7 @@ PrefabInstance:
- target: {fileID: 5195354181806561359, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0.0000076293945
value: 0.00004012345
objectReference: {fileID: 0}
- target: {fileID: 5195354181806561359, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}

+ 3
- 3
Assets/Scenes/ColourCollide_Smaller.unity View File

@ -38,13 +38,13 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641222, b: 0.57481694, a: 1}
m_IndirectSpecularColor: {r: 0.44657868, g: 0.49641263, b: 0.57481706, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
@ -2342,7 +2342,7 @@ MonoBehaviour:
- element: {fileID: 11400000, guid: 0086f005a63e8404aaee25e4ae4734d7, type: 2}
Count: 1
isInfinit: 0
- element: {fileID: 11400000, guid: 194f051bd7d3e7d4fb5b96a8e1d5b162, type: 2}
- element: {fileID: 11400000, guid: e11629d4fbb1e8246b7d4f003800bfa0, type: 2}
Count: 1
isInfinit: 0
ConnectedClients: []

+ 7
- 27
Assets/Scripts/Logic/Blocks/CombinedBlock.cs View File

@ -7,9 +7,9 @@ using UnityEngine;
public class CombinedBlock : LogicBlock
{
#region Inspector Variables
[SerializeField]
[Tooltip("Is this block editable")]
public bool isEditable = false;
//[SerializeField]
//[Tooltip("Is this block editable")]
//public bool isEditable = false;
[SerializeField]
[Tooltip("Blocks this will run through")]
@ -17,17 +17,7 @@ public class CombinedBlock : LogicBlock
#endregion Inspector Variables
#region Private Variables
public override int Size()
{
if (!isEditable)
return 1;
int retVal = 1;
foreach(LogicBlock block in blockReader.LogicChain)
retVal += block.Size();
return retVal;
}
#endregion Private Variables
@ -70,19 +60,7 @@ public class CombinedBlock : LogicBlock
blockReader.Reset();
}
public override LogicBlock[] GetAllBlocks()
{
if (!isEditable)
return new LogicBlock[] { this };
List<LogicBlock> retVal = new List<LogicBlock>();
retVal.Add(this);
foreach (LogicBlock block in blockReader.LogicChain)
retVal.AddRange(block.GetAllBlocks());
return retVal.ToArray();
}
public override LogicBlock Clone()
{
@ -95,6 +73,8 @@ public class CombinedBlock : LogicBlock
return retVal;
}
#region Serialisation Functions
public override void CopyToken(BlockToken token)
{

+ 30
- 0
Assets/Scripts/Logic/Blocks/EditableBlock.cs View File

@ -0,0 +1,30 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "Major Project/Editable Block")]
public class EditableBlock : CombinedBlock
{
public override LogicBlock[] GetAllBlocks()
{
List<LogicBlock> retVal = new List<LogicBlock>();
retVal.Add(this);
foreach (LogicBlock block in blockReader.LogicChain)
retVal.AddRange(block.GetAllBlocks());
return retVal.ToArray();
}
public override int Size()
{
int retVal = 1;
foreach (LogicBlock block in blockReader.LogicChain)
retVal += block.Size();
return retVal;
}
}

+ 11
- 0
Assets/Scripts/Logic/Blocks/EditableBlock.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5a430f6f9e9cf724bb79454bc4f60bb7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/Scripts/LogicBlocks.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8936b441d7647f74884c94f97bfb8931
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 6
- 1
Assets/Scripts/UI/Lobby/LobbyUIController.cs View File

@ -61,8 +61,13 @@ public class LobbyUIController : MonoBehaviour
public void OnClick_StartGame()
{
if(Clients.ConnectedClients.Count >= 2 && Clients.ConnectedClients.Count <= 4){
#if UNITY_EDITOR
UnityEngine.SceneManagement.SceneManager.LoadScene(SceneToStart);
#else
if (Clients.ConnectedClients.Count >= 2 && Clients.ConnectedClients.Count <= 4){
UnityEngine.SceneManagement.SceneManager.LoadScene(SceneToStart);
}
#endif
}
}

+ 5
- 7
Assets/Scripts/UI/LogicTrayUI.cs View File

@ -36,7 +36,7 @@ public class LogicTrayUI : LogicElementHolder
public void Start()
{
readerQueue.Add(new QueueData(null, reader, border.color));
readerQueue.Add(new QueueData(reader, border.color));
UpdateDisplay();
@ -206,11 +206,11 @@ public class LogicTrayUI : LogicElementHolder
/// <param name="element">element which was double clicked</param>
public override void OnDoubleClick(LogicElementUI element)
{
CombinedBlock block = element.logicElement as CombinedBlock;
if (block == null || !block.isEditable)
EditableBlock block = element.logicElement as EditableBlock;
if (block == null)
return;
readerQueue.Add(new QueueData(block,block.blockReader,block.Color));
readerQueue.Add(new QueueData(block.blockReader,block.Color));
border.color = block.Color;
SetBlockReader(block.blockReader);
@ -265,13 +265,11 @@ public class LogicTrayUI : LogicElementHolder
{
public Color color;
public BlockReader reader;
public CombinedBlock block;
public QueueData(CombinedBlock block, BlockReader reader, Color color)
public QueueData(BlockReader reader, Color color)
{
this.color = color;
this.reader = reader;
this.block = block;
}
}

Loading…
Cancel
Save