示例#1
0
        /// <summary>
        /// Creates a footprint.
        /// </summary>
        /// <param name="boundsMin">The bottom left corner of the footprint on the grid map.</param>
        /// <param name="boundsMax">The top right corner of the footprint on the grid map.</param>
        /// <param name="mapElement">The main map element that the footprint belongs to.</param>
        /// <param name="subCreate">The delegate method used to create footprint sub elements.</param>
        /// <returns>A footprint.</returns>
        public static IFootprint <T> Create(Vector2Int boundsMin, Vector2Int boundsMax, T mapElement, SubCreate subCreate)
        {
            Footprint <T> footprint = new Footprint <T>
            {
                mapElement = mapElement,
                subCreate  = subCreate
            };

            footprint.Init(boundsMin, boundsMax);

            return(footprint);
        }
示例#2
0
        /// <summary>
        /// Creates a footprint.
        /// </summary>
        /// <param name="spriteRenderer">The sprite renderer used to determine the footprint bounds.</param>
        /// <param name="mapElement">The main map element that the footprint belongs to.</param>
        /// <param name="subCreate">The delegate method used to create footprint sub elements.</param>
        /// <returns>A footprint.</returns>
        public static IFootprint <T> Create(SpriteRenderer spriteRenderer, T mapElement, SubCreate subCreate)
        {
            Footprint <T> footprint = new Footprint <T>
            {
                mapElement = mapElement,
                subCreate  = subCreate
            };

            footprint.Init(spriteRenderer);

            return(footprint);
        }