Ejemplo n.º 1
0
        /// <summary>
        /// Creates the new GridZone object.
        /// </summary>
        /// <param name="position">The world position where the GridZone object will be positioned.</param>
        /// <param name="parent">Object which the GridZone object will be parented to. This variable is only applicable when the 'CreateGameObjects' flag is enabled.</param>
        /// <returns>Reference to the created GridZone object.</returns>
        private GridZone CreateNewZone(Vector3 position, Transform parent)
        {
            GridZone newZoneGrid = new GridZone();

            if (CreateGameObjects == true && Application.isEditor == true)
            {
                newZoneGrid.SetGameObject(new GameObject(), parent);
            }

            newZoneGrid.SetPosition(position);
            newZoneGrid.CreateCollisionBox(Size);
            return(newZoneGrid);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates the new GridZone object.
        /// </summary>
        /// <param name="position">The world position where the GridZone object will be positioned.</param>
        /// <param name="parent">Object which the GridZone object will be parented to. This variable is only applicable when the 'CreateGameObjects' flag is enabled.</param>
        /// <returns>Reference to the created GridZone object.</returns>
        private GridZone CreateNewZone(Vector3 position, Transform parent)
        {
            GridZone newZoneGrid = new GridZone();
            if(CreateGameObjects == true && Application.isEditor == true)
                newZoneGrid.SetGameObject(new GameObject(), parent);

            newZoneGrid.SetPosition(position);
            newZoneGrid.CreateCollisionBox(Size);
            return newZoneGrid;
        }