Пример #1
0
    public static ConstructionPlan CreateConstructionPlan(string constructionName, Vector2Int position)
    {
        if (!_isInitialized)
        {
            Initialize();
        }

        ConstructionPlan plan = new ConstructionPlan();

        plan.SetData(_constructionPlanData[constructionName], position);
        plan.SetGameObject(GameObject.Instantiate(_constructionPlanData[constructionName].planPrefab, GetParent <ConstructionPlan>()));
        return(plan);
    }
Пример #2
0
    private void CreateJobs()
    {
        Dictionary <Tile, GameObject> temp = new Dictionary <Tile, GameObject>(_tiles);

        foreach (KeyValuePair <Tile, GameObject> pair in temp)
        {
            if (pair.Key.Contents.ConstructionPlan != null)
            {
                continue;
            }
            ConstructionPlan plan = new ConstructionPlan();
            plan.SetData(_constructionData, pair.Key.Position);
            plan.SetGameObject(pair.Value);
            _tiles.Remove(pair.Key);
        }
    }