C# === ## List 1. [absract class](#AC) 2. [IEnumrator](#IE) 3. [out](#out) 4. [Invoke](#invoke) ## Contents ### abstract class<a id="AC"/> <i>**abstract class**</i> is inheritable class. Like java's Interface. 1. virtual / override - Overide function must be declared `virtual`. ```csharp= [abstract] public virtual void func(); [inheritance] public override void func(); ``` 2. abstract function - `Abstract function` only have name. Inheritance class must declare this function, if not, occuer *<b>Error</b>* ```csharp= abstract void function(); ``` ### IEnumerator<a id="IE"/> Like JS's generator, yield values sequentially. It is called **<i>Coroutine</i>** in C#. ```csharp= IEnumerator func() { yield return 1; yield return 2; yield return 3; } func(); //=> 1 func(); //=> 2 func(); //=> 3; ``` It use for subroutine no relation with `Update()`.<br>Update is called every frame. But frame don't work correct time duration.<br>So we use `Coroutine` for smooth moving, etc... ### out<a id="out"/> `out` is like reference value in C, C++. If you want change outside scope value change in scope, use this modifier with parameter. ```csharp= void func(out int a); int a; func(out a); ``` **※** Smillar modifier `ref`. It must initiate first. ### Invoke<a id="Invoke"/> `Invoke()` is multi threading work function.<br>In unity, function for delay. It smillar `setTimeOut()` in JS, but It work correct after delay time, unlike `setTimeOut()`.