示例#1
0
    void Start()
    {
        mController = gameObject.GetComponent <SeparateEntityController>();
        if (mController == null)
        {
            mController = gameObject.AddComponent <SeparateEntityController>();
        }
        mController.Init(bounds.center,
                         bounds.size,
                         attribute.asyn,
                         attribute.maxCreateCount,
                         attribute.minCreateCount,
                         attribute.refreshTime,
                         attribute.destroyTime,
                         attribute.treeType,
                         attribute.treeDepth);

        for (int i = 0; i < transform.childCount; ++i)
        {
            var entity = transform.GetChild(i).GetComponent <STSceneEntity>();
            if (entity)
            {
                mController.AddSceneEntity(entity);
            }
        }
    }
示例#2
0
 void OnEnable()
 {
     mTarget = (SeparateEntityController)target;
 }