Ejemplo n.º 1
0
    void GenerateInteractible(Tile tile)
    {
        var interactibleTemplateKey = tpd.RollMap(env.interactibleChances);
        var interactibleTemplate = JSONResource.Get<InteractionTemplate>(interactibleTemplateKey);
        var interactibleGenerator = new InteractionGenerator(interactibleTemplate);
        var interactible = interactibleGenerator.Generate();
        var randomTile = room.RandomOpenTile();
        interactible.position = randomTile.position;

        InteractibleStore.Save(interactible);
        randomTile.Occupy(Constants.interactibleContentKey, interactible.id);
    }
Ejemplo n.º 2
0
    void GenerateInteractible(Tile tile)
    {
        var interactibleTemplateKey = tpd.RollMap(env.interactibleChances);
        var interactibleTemplate    = JSONResource.Get <InteractionTemplate>(interactibleTemplateKey);
        var interactibleGenerator   = new InteractionGenerator(interactibleTemplate);
        var interactible            = interactibleGenerator.Generate();
        var randomTile = room.RandomOpenTile();

        interactible.position = randomTile.position;

        InteractibleStore.Save(interactible);
        randomTile.Occupy(Constants.interactibleContentKey, interactible.id);
    }
Ejemplo n.º 3
0
    public void Enter()
    {
        var interactionTemplateKey = sim.currentEnvironment.enterInteractionTemplateKey;
        var interactionTemplate    = JSONResource.Get <InteractionTemplate>(interactionTemplateKey);

        if (interactionTemplate == null)
        {
            return;
        }

        var interaction = InteractionGenerator.Generate(interactionTemplate);

        sim.SetInteraction(interaction);
        var interactionProcessor = new InteractionProcessor(sim);

        interactionProcessor.Start();
    }