# Is it possible to create other List field than EventList?

**URL:** <https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886>\
**Category:** 🌵 Needle Engine\
**Tags:** question\
**Created:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886 "2023-01-19T00:00:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886/1 "2023-01-19T00:00:00Z")

</div>

Hello !

I would like to create a custom script to add Effects easily to my scene.  
For that I would like to use List of string (To choice an effect) but I found only EventList, and display dynamically the parameters fields on my component on Unity. (unstead of making one script by effect, which I can make too if it’s not possible)

Is it possible ?

[Original Post on Discord](https://discord.com/channels/717429793926283276/1065618243236147320)

_by user 224464722878005248_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886/2 "2023-01-19T00:00:00Z")

</div>

Sure.

```ts
@serializable()
myStrings?: string[];

@serializable(Object3D)
myObjects?: Object3D[];

```

for custom types:

```ts
class MyClass {
  @serializable()
  myField:string;
}

@serializable(MyClass)
myClasses?: MyClass[];

```

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886/3 "2023-01-19T00:00:00Z")

</div>

Note that custom classes that are not components will not be automatically generated

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886/4 "2023-01-19T00:00:00Z")

</div>

so they either already exist in Unity or you need them in a C# script manually:

```csharp
public class MyClass {
  public string myField;
}

```

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886/5 "2023-01-19T00:00:00Z")

</div>

Does that answer your question?

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886/6 "2023-01-19T00:00:00Z")

</div>

Not completely, but in part  
In fact I used the wrong word, it’s not a “list” but a drop down menu like it :

_by user 224464722878005248_

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886/7 "2023-01-19T00:00:00Z")

</div>

![image.png](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/7/791114ee4cb0754b1e5f5ffa8f4153c15712767a.png)

_by user 224464722878005248_

---

<div class="post-metadata">

**Author:** ![discord-import](https://forum.needle.tools/user_avatar/forum.needle.tools/discord-import/32/33_2.png) [@discord-import](https://forum.needle.tools/u/discord-import)\
**Post date:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886/8 "2023-01-19T00:00:00Z")

</div>

For example Effect type : GlitchEffect  
And the parameters of the glitchEffect appear

_by user 224464722878005248_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886/9 "2023-01-19T00:00:00Z")

</div>

That’s just an enum. Same with classes, you need to have the enum declared in C# but then you can use it like this:

```ts
public enum EffectEnum = { Powerup = 0 }

//@type Namespace.EffectEnun
@serializable()
myEffect : EffectEnum = 0;

```

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [January 19, 2023, 12:00am UTC](https://forum.needle.tools/t/is-it-possible-to-create-other-list-field-than-eventlist/886/10 "2023-01-19T00:00:00Z")

</div>

and in c# you just have the enum type

```csharp
public enum EffectEnum = { Powerup = 0 }

```
