Exemplo n.º 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);
                }
            }
        }
    }
Exemplo n.º 2
0
    new public void OnEnable()
    {
        base.OnEnable();

        group = script as AiBehaveGroup;
    }