public void RegisterIReactor(GameObject argReactor)
    {
        ISpawnReactor reactor = argReactor.GetComponent <ISpawnReactor>();

        if (null == reactor)
        {
            return;
        }

        m_levelReactors.Add(reactor);
    }
Beispiel #2
0
    private void ActivateSpawnReactors(ESpawnReactorType argReactorType, SpawnObject argSpawnObjectData, GameObject argSpawnedObject = null)
    {
        switch (argReactorType)
        {
        case ESpawnReactorType.eOnBeginSpawning:
            foreach (GameObject reactorObject in argSpawnObjectData.spawnReactors)
            {
                ISpawnReactor reactor = reactorObject.GetComponent <ISpawnReactor>();

                if (null != reactor)
                {
                    reactor.ReactorOnBeginSpawning();
                }
            }

            break;

        case ESpawnReactorType.eOnSpawn:
            foreach (GameObject reactorObject in argSpawnObjectData.spawnReactors)
            {
                ISpawnReactor reactor = reactorObject.GetComponent <ISpawnReactor>();

                if (null != reactor && null != argSpawnedObject)
                {
                    reactor.ReactorOnSpawn(argSpawnedObject);
                }
            }
            break;

        case ESpawnReactorType.eOnEndSpawning:
            foreach (GameObject reactorObject in argSpawnObjectData.spawnReactors)
            {
                ISpawnReactor reactor = reactorObject.GetComponent <ISpawnReactor>();

                if (null != reactor)
                {
                    reactor.ReactorOnEndSpawning();
                }
            }
            break;

        default:
            Debug.LogError("Cannot activate spawner area reactor because case does not exist, case=" + argReactorType);
            break;
        }
    }