Beispiel #1
0
    public void ReplaceGamePlaySystem(GamePlaySystem newGamePlaySystem)
    {
        var index     = GameComponentsLookup.GamePlaySystem;
        var component = (GamePlaySystemComponent)CreateComponent(index, typeof(GamePlaySystemComponent));

        component.GamePlaySystem = newGamePlaySystem;
        ReplaceComponent(index, component);
    }
Beispiel #2
0
    public GameEntity SetGamePlaySystem(GamePlaySystem newGamePlaySystem)
    {
        if (hasGamePlaySystem)
        {
            throw new Entitas.EntitasException("Could not set GamePlaySystem!\n" + this + " already has an entity with GamePlaySystemComponent!",
                                               "You should check if the context already has a gamePlaySystemEntity before setting it or use context.ReplaceGamePlaySystem().");
        }
        var entity = CreateEntity();

        entity.AddGamePlaySystem(newGamePlaySystem);
        return(entity);
    }
Beispiel #3
0
    public void ReplaceGamePlaySystem(GamePlaySystem newGamePlaySystem)
    {
        var entity = gamePlaySystemEntity;

        if (entity == null)
        {
            entity = SetGamePlaySystem(newGamePlaySystem);
        }
        else
        {
            entity.ReplaceGamePlaySystem(newGamePlaySystem);
        }
    }
Beispiel #4
0
    public void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        spawner = gameObject.GetComponent <CustomerSpawner>();
    }