Example #1
0
 static void InitializeRooms()
 {
     for (int i = 1; i <= 50; ++i)
     {
         Color           floorColor = new Color(Random.Range(128f, 255f), Random.Range(128f, 255f), Random.Range(128f, 255f));
         AddonParameters parameters = new AddonParameters
         {
             minArea          = GameVars.GetPlatformArea(i),
             primarySizeMin   = GameVars.GetSpacePlatformMinSize(i) + 2,
             primarySizeMax   = GameVars.GetSpacePlatformMaxSize(i) + 2,
             secondarySizeMin = GameVars.GetSpacePlatformMinSize(i),
             secondarySizeMax = GameVars.GetSpacePlatformMaxSize(i)
         };
         Bounds3Int[] bounds = AddonGen.GenerateAddon(parameters);
         SpacePlatform.Create(bounds, floorColor);
     }
 }
Example #2
0
    void BeginGoal(GoalInfo goalInfo)
    {
        if (efficiencyQuest != null)
        {
            efficiencyQuest.Delete();
        }

        for (int i = 0, len = goalInfo.machinesUnlockedAtStart.Length; i < len; ++i)
        {
            MachineUnlockSystem.instance.Unlock(goalInfo.machinesUnlockedAtStart[i]);
        }

        if (goalInfo.restrictLand)
        {
            foreach (LandParcel restrict in LandSystem.instance.landParcelSet)
            {
                if (restrict.flags == LandParcelFlags.Valid)
                {
                    restrict.flags = LandParcelFlags.Restricted;
                }
            }
        }

        if (goalInfo.createAddon)
        {
            Bounds3Int[]  spacePlatformBounds = AddonGen.Addon(goalInfo.addon);
            SpacePlatform spacePlatform       = new SpacePlatform();
            spacePlatform.save.bounds = spacePlatformBounds;
            spacePlatform.Initialize();
            OverviewCameraController.instance.MoveTo(spacePlatform.visual.floors[0].transform.position);
        }

        efficiencyQuest = new EfficiencyQuest
        {
            goalInfo = goalInfo
        };
        efficiencyQuest.Initialize();
    }