New answers tagged gameobject
1
Based on Phillip and DMGregory's answer and comment, I found this solution works very well:
Create an Tag Component such as:
#if UNITY_EDITOR
using UnityEngine;
namespace AwSim.Tags
{
[AddComponentMenu("Tags/Decorative")]
[DisallowMultipleComponent]
public class Decorative : MonoBehaviour {}
}
#endif
Attach it to the Prefabs or ...
2
Use marker-components.
The penalty of having a marker-component with no fields and no methods on a lot of objects will in most cases be negligible. But when you are in a situation where every byte matters (and still don't want to use Entities), then you could make that marker component commit suicide on awake:
class Decorative : MonoBehaviour {
private ...
Top 50 recent answers are included
Related Tags
gameobject × 240unity × 175
c# × 83
c++ × 13
objects × 13
collision-detection × 11
architecture × 11
2d × 9
component-based × 8
transformation × 7
camera × 6
sprites × 6
gui × 6
scene × 6
javascript × 5
instancing × 5
opengl × 4
animation × 4
rotation × 4
movement × 4
vector × 4
software-engineering × 4
game-maker × 4
data-structure × 4
scripting × 4