示例#1
0
    public void WormHole(LevelMoment moment)
    {
        Vector2Int i = moment.GetIndex();

        if (moments.Count < (i.x + 2))
        {
            List <LevelMoment> timeline     = new List <LevelMoment>();
            List <LevelMoment> prevTimeline = moments[i.x];

            LevelMoment prevStart = LevelData.Instance.startingMoment;
            LevelMoment newStart  = prevStart.DeepCopyLevelMoment();

            newStart.phase = i.x + 1;

            newStart.PhaseInLemmings();

            for (int l = 0; l < newStart.y; l++)
            {
                for (int k = 0; k < newStart.z; k++)
                {
                    for (int m = 0; m < newStart.x; m++)
                    {
                        char key = newStart.level[m, l, k];
                        if (key == GameBoardCubeDictionary.WORMHOLE_IN)
                        {
                            newStart.Remove(new Vector3Int(m, l, k), key);
                        }
                    }
                }
            }

            newStart.RecieveTimeTraveler();
            timeline.Add(newStart);

            moments.Add(timeline);

            Vector2Int j = new Vector2Int(i.x + 1, 0);
            if (TimeLineCreatedEvent != null)
            {
                TimeLineCreatedEvent(j);
            }
            else
            {
                AddToEvent(j);
            }
        }
    }
示例#2
0
    public void UpdateTimeline(LevelMoment moment)
    {
        //Get display coordinates.
        Vector2Int momentIndex = moment.GetIndex();

        Vector2Int i = MomentIToVectorI(momentIndex);

        //If the row changed is in the current display
        int phase = moment.phase;

        while (true)
        {
            if (!InDisplayColumn(i))
            {
                return;
            }

            RebuildRow(i.x, phase);
            i.x++;
            phase++;
        }
    }