An open API service indexing awesome lists of open source software.

https://github.com/kuritaro1122/functionexecuter

[Unity] GameObjectに簡単に命令を付与するプログラム
https://github.com/kuritaro1122/functionexecuter

csharp unity unity-scripts

Last synced: about 2 months ago
JSON representation

[Unity] GameObjectに簡単に命令を付与するプログラム

Awesome Lists containing this project

README

          

[FunctionExecutor_Nodeはこちら](/README_node.md)

# FunctionExecutor

GameObjectに命令を付与し、非同期的に逐次実行する。\
[EntityActionCon](https://github.com/kuritaro1122/EntityActionCon)の基底プログラムです。

# Requirement

* UnityEngine
* System
* System.Collections

# Usage

```
GameObject target;
FunctionExecutor executor = target.ComponentFunctionExecutor(); //Add or GetComponent
executor.Set(
// Write the function you want to execute.
// new FE_Function1(),
// new FE_Function2(),
// ...
).BeginAction();
```
## FE_Functions
```
F_WaitForSeconds(float time)
F_WaitUntil(System.Func condition)
F_Destroy(GameObject gameObject = null)
F_DebugLog(string message)
F_Action(System.Action action)
F_Action(System.Action action)
F_Coroutine(bool asyn, System.Func enumerator)
F_Coroutine(bool asyn, System.Func enumerator)

F_ChainFunction(bool asyn, params FE_IFunction[] functions)
F_LoopFunction(bool asyn, Func condition, params FE_IFunction[] functions)
F_LoopFunction(bool asyn, int count, params FE_IFunction[] functions)
F_LoopFunction(bool asyn, Func condition, int count, bool and, params FE_IFunction[] functions)
```
## FE_IFunction (Interface)
```
IEnumerator IGetFunction(IFunctionExecutor executor)
bool IGetAsyn()
```

# Contains

## Public Variable
```
bool Running { get; }
```
## Public Function
```
FunctionExecutor Set(params FE_IFunction[] functions)
FunctionExecutor ResetAll()
Coroutine BeginAction()
```

# Note

* bool asynをtrueにすると、前の命令の終了を待たずに実行されます。
* 新たな命令を追加したい場合には、F_ActionやF_Coroutineを使うか、FE_IFunctionを継承したクラスを作ってください。

# License

"FunctionExecutor" is under [MIT license](https://en.wikipedia.org/wiki/MIT_License).