Beispiel #1
0
    public override MobBehaviour spawn(string name, ISpawnProperties <MobBehaviour> spawnProperties)
    {
        MobBehaviour mb = base.spawn(name, spawnProperties);

        if (mb != null)
        {
            MobsSeen.instance.seeMob(name);
        }
        return(mb);
    }
Beispiel #2
0
    //Spawn whatever this manager manages, activate them, and initialize them based on
    //the given spawn properties
    public virtual T spawn(string name, ISpawnProperties <T> spawnProperties)
    {
        T          t;
        GameObject g;

        if (this.pools.tryGetComponent <T>(name, out t, out g))
        {
            if (t != null)
            {
                g.transform.SetParent(this.roomTransform);
                spawnProperties.spawn(t);
                g.SetActive(true);
            }
        }
        return(t);
    }