Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

How to add variable Type component to entity?

$
0
0
Hi i add same type component to few entities when entities are created.
in my work, add component with switch is fine but i guess its not good performance so i wanna make switch statement before use for statement


This is my origin code

Code (CSharp):
  1.                 for (int i = 0; i < Prefabs.lenght; i++)
  2.                 {
  3.                     Entity instance = CommandBuffer.Instantiate(index, prefabSpawner.Prefab);
  4.                     switch (prefabSpawner.unitType)...
How to add variable Type component to entity?

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>