|
|
|
// This code is part of the Fungus library (https://github.com/snozbot/fungus)
|
|
|
|
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
|
|
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace Fungus
|
|
|
|
{
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
/// <summary>
|
|
|
|
/// Base for all Conditional based Commands, Ifs, Loops, and so on.
|
|
|
|
/// </summary>
|
|
|
|
[AddComponentMenu("")]
|
|
|
|
public abstract class Condition : Command
|
|
|
|
{
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
protected End endCommand;
|
|
|
|
|
|
|
|
public override void OnEnter()
|
|
|
|
{
|
|
|
|
if (ParentBlock == null)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
//if looping we need the end command in order to work
|
|
|
|
if(IsLooping && !EnsureRequiredEnd())
|
|
|
|
{
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
Debug.LogError(GetLocationIdentifier() + " is looping but has no matching End command");
|
|
|
|
Continue();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
if ( !HasNeededProperties() )
|
|
|
|
{
|
|
|
|
Debug.LogError(GetLocationIdentifier() + " cannot run due to missing required properties");
|
|
|
|
Continue();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Ensuring we arrived at this elif honestly, not incorrectly due to fall through from a previous command
|
|
|
|
if (this.IsElseIf && !DoesPassElifSanityCheck())
|
|
|
|
{
|
|
|
|
//elif is being asked to run but didn't come from a previously failing if or elif, this isn't allowed
|
|
|
|
MoveToEnd();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
EvaluateAndContinue();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override bool OpenBlock()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override Color GetButtonColor()
|
|
|
|
{
|
|
|
|
return new Color32(253, 253, 150, 255);
|
|
|
|
}
|
|
|
|
|
|
|
|
public virtual bool IsLooping { get { return false; } }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Moves execution to the closing End of the current command, attempts to locate end if not
|
|
|
|
/// already known and if no closing End exists.
|
|
|
|
/// </summary>
|
|
|
|
public virtual void MoveToEnd()
|
|
|
|
{
|
|
|
|
if(endCommand == null)
|
|
|
|
{
|
|
|
|
endCommand = FindOurEndCommand();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (endCommand != null)
|
|
|
|
{
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
// Continue at next command after End
|
|
|
|
// and make the end non looping incase it gets run via index etc.
|
|
|
|
endCommand.Loop = false;
|
|
|
|
Continue(endCommand.CommandIndex + 1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
//nowhere to go, so we assume the block wants to stop but is missing and end, this
|
|
|
|
// is also ensures back compat
|
|
|
|
Debug.LogWarning("Condition wants to move to end but no End command found, stopping block. " + GetLocationIdentifier());
|
|
|
|
StopParentBlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
|
|
|
|
protected End FindOurEndCommand()
|
|
|
|
{
|
|
|
|
return FindMatchingEndCommand(this);
|
|
|
|
}
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
/// <summary>
|
|
|
|
/// Helper to find the paired End Command for the given command.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="startCommand"></param>
|
|
|
|
/// <returns>Mathcing End Command or null if not found</returns>
|
|
|
|
public static End FindMatchingEndCommand(Command startCommand)
|
|
|
|
{
|
|
|
|
if (startCommand.ParentBlock == null)
|
|
|
|
return null;
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
int indent = startCommand.IndentLevel;
|
|
|
|
for (int i = startCommand.CommandIndex + 1; i < startCommand.ParentBlock.CommandList.Count; ++i)
|
|
|
|
{
|
|
|
|
var command = startCommand.ParentBlock.CommandList[i];
|
|
|
|
|
|
|
|
if (command.IndentLevel == indent)
|
|
|
|
{
|
|
|
|
if (command is End)
|
|
|
|
{
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
return command as End;
|
|
|
|
}
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
}
|
|
|
|
else if (command.IndentLevel < indent)
|
|
|
|
{
|
|
|
|
//managed to be less indent than the inner but not find and end, this shouldn't occur
|
|
|
|
// but may be user error or bad data, makes sense for completeness here
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
/// <summary>
|
|
|
|
/// Helper for child classes that require an End command to function. For IsLooping commands
|
|
|
|
/// this also configures the loopback within the End command.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
protected virtual bool EnsureRequiredEnd()
|
|
|
|
{
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
if (endCommand == null)
|
|
|
|
{
|
|
|
|
endCommand = FindOurEndCommand();
|
|
|
|
|
|
|
|
if (endCommand == null)
|
|
|
|
{
|
|
|
|
Debug.LogError( GetLocationIdentifier() + "', could not find closing End command and thus cannot loop.");
|
|
|
|
//StopParentBlock();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IsLooping)
|
|
|
|
{
|
|
|
|
// Tell the following end command to loop back
|
|
|
|
endCommand.Loop = true;
|
|
|
|
endCommand.LoopBackIndex = CommandIndex;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
/// <summary>
|
|
|
|
/// Called by OnEnter when the condition is needed to evaluate and continue execution.
|
|
|
|
/// Means child classes do not have to deal with erronuous execution conditions, like fall through.
|
|
|
|
/// </summary>
|
|
|
|
protected virtual void EvaluateAndContinue()
|
|
|
|
{
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
PreEvaluate();
|
|
|
|
|
|
|
|
if (EvaluateCondition())
|
|
|
|
{
|
|
|
|
OnTrue();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
OnFalse();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
/// <summary>
|
|
|
|
/// Called when the condition is run and EvaluateCondition returns true
|
|
|
|
/// </summary>
|
|
|
|
protected virtual void OnTrue()
|
|
|
|
{
|
|
|
|
Continue();
|
|
|
|
}
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
/// <summary>
|
|
|
|
/// Called when the condition is run and EvaluateCondition returns false
|
|
|
|
/// </summary>
|
|
|
|
protected virtual void OnFalse()
|
|
|
|
{
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
//looping constructs only care about the end
|
|
|
|
if(IsLooping)
|
|
|
|
{
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
MoveToEnd();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Find the next Else, ElseIf or End command at the same indent level as this If command
|
|
|
|
for (int i = CommandIndex + 1; i < ParentBlock.CommandList.Count; ++i)
|
|
|
|
{
|
|
|
|
Command nextCommand = ParentBlock.CommandList[i];
|
|
|
|
|
|
|
|
if (nextCommand == null)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Find next command at same indent level as this If command
|
|
|
|
// Skip disabled commands, comments & labels
|
|
|
|
if (!((Command)nextCommand).enabled ||
|
|
|
|
nextCommand.GetType() == typeof(Comment) ||
|
|
|
|
nextCommand.GetType() == typeof(Label) ||
|
|
|
|
nextCommand.IndentLevel != indentLevel)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
System.Type type = nextCommand.GetType();
|
|
|
|
if (type == typeof(Else) ||
|
|
|
|
type == typeof(End))
|
|
|
|
{
|
|
|
|
if (i >= ParentBlock.CommandList.Count - 1)
|
|
|
|
{
|
|
|
|
// Last command in Block, so stop
|
|
|
|
StopParentBlock();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Execute command immediately after the Else or End command
|
|
|
|
Continue(nextCommand.CommandIndex + 1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (type.IsSubclassOf(typeof(Condition)) && (nextCommand as Condition).IsElseIf)
|
|
|
|
{
|
|
|
|
// Execute the Else If command
|
|
|
|
Continue(i);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// No matching End command found, so just stop the block
|
|
|
|
StopParentBlock();
|
|
|
|
}
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
/// <summary>
|
|
|
|
/// Sits in the if within EvaluateAndContinue, if returns true, OnTrue will run, if false, OnFalse will run.
|
|
|
|
/// </summary>
|
|
|
|
protected abstract bool EvaluateCondition();
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
/// <summary>
|
|
|
|
/// Child classes are required to report if it is possible for them to be evaulated.
|
|
|
|
/// </summary>
|
|
|
|
protected virtual bool HasNeededProperties() { return true; }
|
|
|
|
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
/// <summary>
|
|
|
|
/// Declare if the child class is implementing an 'else if' command, which requires some special handling
|
|
|
|
/// </summary>
|
|
|
|
protected virtual bool IsElseIf { get { return false; } }
|
Collection (#787)
Add concept of Collection to Fungus.
Add Collection Demo, Physics Cast Demo.
They are their own type, that are addressed in a generic way. Internally using object boxing and type comparisons.
A number of refactorings and additions along with this to make it work more seamlessly.
Variable operators defined by Variable itself
Conditional and Looping commands refactored, to avoid more duplication in the new looping commands, such as ForEach
AnyVariableData removes duplication from SetVariable and Condition logic, provides a clearer method of adding additional variable types that result in immediate support in those commands
PlayMode Tests and Utils added
Additional Variable Types, such as Quaternion, Matrix4x4
Physics casts Commands that use collections
* Initial Fungus Collection work with support for int and IntegerVariable
* While and Condition related changes to allow for new command Loop Range
* Collection Get changes and ForEach rough
* Added Collection Commands
Reordered Elif logic in Condition
* More collection types and commands
* Variable reorg to allow for new types to be added more simply and centrally
* Added more Fungus Vars for Common Unity types
VariableList Adapter can delegate to the variable itself for custom drawing
Variable IsArthithemticSupported queries for each op rather than all, more fine grain support for types like color and quaterion
Event handlers, such as physics related, now have optional fungus variable to store the data they are given by unity in fungus variable for use in the block
VariableInfo consolidates more info into the typeActionLookup table, updates to support new fungus var types
* Many basic collection operations added
Common Collection types
Physics Overlap command
* Custom variable drawing moved to VariableInfo.cs rather than child variable itself
Added Physics cast and overlap commands
* Move all Editor scripts into Editor AsmDef folder
* LoopRange also registers as command name For
* Condition base class commenting improved and refactored repeated looping style child class elements into base
* More descriptive CollectionBase Command class names
* Fungus Collection interface and comments refined
* Rename ICollection to IFungusCollection
Cleanup formatting
* Collection example scene
* Added Collection Tests
* Format collection and test files
Added CopyFrom to IFungusCollection
* Added FungusCollection initial summaries
* Added CollectionRandom commands
-added simple use to CollectionLoop demo scene
* Added Unique to FungusCollection
-Updated tests to include unique
Added Collection Physics demo, shows use of returned array of all cast intersecting GameObjects
* CollectionPhysics tracks mousepos with visual
Added Fungus Command to get mouse position
* Variable custom draw moved to its own editor class, no longer part of typeinfo
Variable generation run
* Add playmode test for variable type sets
Add playmode test for flow control
* Update doco and formatting for Collection classes
Refactor parts of Conditional classes and AnyVariable
Move Property commands into Category 'Property'
* Update Collection comments, formatting and Update internal to public
* Add License header to added variable types
5 years ago
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Called before EvaluateCondition, allowing for child classes to gather required data
|
|
|
|
/// </summary>
|
|
|
|
protected virtual void PreEvaluate() { }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Ensure that this condition didn't come from a non matching if/elif.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns></returns>
|
|
|
|
protected virtual bool DoesPassElifSanityCheck()
|
|
|
|
{
|
|
|
|
System.Type previousCommandType = ParentBlock.GetPreviousActiveCommandType();
|
|
|
|
var prevCmdIndent = ParentBlock.GetPreviousActiveCommandIndent();
|
|
|
|
var prevCmd = ParentBlock.GetPreviousActiveCommand();
|
|
|
|
|
|
|
|
//handle our matching if or else if in the chain failing and moving to us,
|
|
|
|
// need to make sure it is the same indent level
|
|
|
|
if (prevCmd == null ||
|
|
|
|
prevCmdIndent != IndentLevel ||
|
|
|
|
!previousCommandType.IsSubclassOf(typeof(Condition)) ||
|
|
|
|
(prevCmd as Condition).IsLooping)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|