void SpawnAiPrefab() { if (aiPrefab != null) { GameObject aiObject = Instantiate(aiPrefab, transform.position, transform.rotation) as GameObject; if (aiObject != null) { aiObject.transform.parent = transform; mBehaveGroup = aiObject.GetComponent <AiBehaveGroup>(); if (mBehaveGroup != null) { mBehaveGroup.RegisterSPGroup(this); } } } }
new public void OnEnable() { base.OnEnable(); group = script as AiBehaveGroup; }