Example #1
0
    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);
                }
            }
        }
    }
Example #2
0
    new public void OnEnable()
    {
        base.OnEnable();

        group = script as AiBehaveGroup;
    }