Skip to content
This repository was archived by the owner on Mar 25, 2020. It is now read-only.

ComponentBase

pointcache edited this page Jan 15, 2017 · 2 revisions

Self registers in ComponentPool

publicclassComponentBase:MonoBehaviour{[NotEditableString]publicstringID;publicvirtualvoidOnEnable(){ComponentPoolSystem.Register(this);}publicvirtualvoidOnDisable(){ComponentPoolSystem.Unregister(this);_entity=null;}Entity_entity;publicEntityEntity{get{if((object)_entity==null)_entity=getEntityRecursive(transform);return_entity;}}EntitygetEntityRecursive(Transformtr){if((object)tr==null){returnnull;}Entityec=tr.gameObject.GetComponent<Entity>();if((object)ec!=null){returnec;}elsereturngetEntityRecursive(tr.parent);}}publicclassSerializedData{}

Clone this wiki locally