Beispiel #1
0
    public StaticObject PlaceStaticObject(string objectType, Tile t)
    {
        //TODO: 1 BY 1 TIles assumed change this later with no rotation;
        if (staticObjectsPrototypes.ContainsKey(objectType) == false)
        {
            Debug.LogError(" no such object prototype " + objectType);
            return(null);
        }

        StaticObject staticObject = StaticObject.PlaceInstance(staticObjectsPrototypes [objectType], t);

        if (staticObject == null)
        {
            //failed to place obj
            return(null);
        }
        staticObjects.Add(staticObject);

        if (cb_StaticObjectCreated != null)
        {
            cb_StaticObjectCreated(staticObject);
            InvalidatePathfindingGraph();
        }

        return(staticObject);
    }