I want to create a dynamic conditional statement.
class Condition
{
targetObject; //Class or Struct or anythings..
targetMemberVariable; //the Member in targetObject
conditionFilter;
//It depends on the type of targetMemberVariable.
//targetMemberVariable is Float type,
//then conditionFilter automatically becomes a Float type.
//No need to change it in "Inspector"
comparisonValue;
//This is based on the type of conditionFilter.
//If it is a float type, the "Inspector" takes a float as its value.
Public bool CheckCondition(object targetObject)
{
//It checks with the above information and returns a true value.
return true or false;
}
}
I want to get the Unity Editor or C # library keywords.
The intention is to create something like the above.
- Interactive elements in the game are likely to change.
- In-game elements can be expanded or added.
- I do not want to modify conditional statements for each change or extension.
example
ex1 ex2 I remember seeing the library used in dynamic compilation in C # or after adding classes during execution.
Of course I know that dynamic is not universal. I want to do something like the validation of StarCraft Galaxy Editor.
Here is a game example
[Bleeding shot]
Give 10 damage to enemies.
If the enemy's Health is below 20, it adds 10 damage.
unit,health,amount,<=(below)
true-> adds 10 damage.
false -> none.
[Hooking]
If the enemy is enemy, it gives 5 damage and pulls to the front.
If the target is ally, pull to the front and reduce cooldown to 5 seconds.
unit,Tag,Enemy(enum),==
true-> 5 damage and pulls to the front.
false-> pull to the front and reduce cooldown to 5 seconds.
[Healing the Moon]
Heal the target by 10.
If the current time is night, heal 10 more.
GameTimer,DayNight(Enum),Night,==
true->heal 10 more.