|
|
@ -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) |
|
|
|
{ |
|
|
|