コード例 #1
0
ファイル: Heart.cs プロジェクト: benblo/GGJ-PlanetHeart
    public void SetupLevel1()
    {
        ressourceConsumer = new RessourceConsumer();
        ressourceConsumer.createTypes = RessourceType.None;
        ressourceConsumer.consumTypes = RessourceType.Heart;
        ressourceConsumer.OnRessourceConsumed += new RessourceConsumer.RessourceEvent(ressourceConsumer_OnRessourceConsumed);
        Cell consumerCell = worldGrid.getCell(21, 33);

        consumerCell.ressourceConsumer = ressourceConsumer;

        Cell cell;
        cell = worldGrid.getCell(20, 35);
        cell.flow = CellFlowDirection.Down;
        cell.isArtere = true;

        cell = worldGrid.getCell(20, 34);
        cell.flow = CellFlowDirection.Down;
        cell.isArtere = true;

        cell = worldGrid.getCell(20, 33);
        cell.flow = CellFlowDirection.Down;
        cell.isArtere = true;

        cell = worldGrid.getCell(20, 32);
        cell.flow = CellFlowDirection.Right;
        cell.isArtere = true;

        cell = worldGrid.getCell(21, 32);
        cell.flow = CellFlowDirection.Right;
        cell.isArtere = true;

        cell = worldGrid.getCell(22, 32);
        cell.flow = CellFlowDirection.Up;
        cell.isArtere = true;

        cell = worldGrid.getCell(22, 33);
        cell.flow = CellFlowDirection.Up;
        cell.isArtere = true;

        cell = worldGrid.getCell(22, 34);
        cell.flow = CellFlowDirection.Up;
        cell.isArtere = true;

        worldGrid.artereLayer.Reset();
        worldGrid.musicControl.SetupLevel1();
    }
コード例 #2
0
ファイル: Tree.cs プロジェクト: benblo/GGJ-PlanetHeart
    public Tree(WorldGrid _world, Cell _cell, Vector2 _position)
    {
        position = _position;
        worldGrid = _world;
        cell = _cell;

        ressourceConsumer = new RessourceConsumer();
        ressourceConsumer.createTypes = RessourceType.None;
        ressourceConsumer.consumTypes = RessourceType.Blue | RessourceType.Green;
        ressourceConsumer.OnRessourceConsumed += new RessourceConsumer.RessourceEvent(ressourceConsumer_OnRessourceConsumed);
        ressourceConsumer.OnRessourceCreated += new RessourceConsumer.RessourceEvent(ressourceConsumer_OnRessourceCreated);

        cell.ressourceConsumer = ressourceConsumer;

        type = _world.lifeLayer.treeTypes[ Random.Range(0, _world.lifeLayer.treeTypes.Length) ];
        maxLevel = type.growthCount - 1;
        animOffset = Random.value;

        worldGrid.trees.Add(this);
    }