-
Notifications
You must be signed in to change notification settings - Fork 0
IsoDropZone and DraggableIsoItem
IsoDropZone | DraggableIsoItem |
---|---|
An IsoDropZone has a prefab name field, a droppable names list, and an item price field.
The droppable name list is used to identify what DraggableIsoItem can be dropped on the IsoDropZone, only the DraggableIsoItems with matched names can be dropped on it.
The prefab name and item price field is used when the IsoDropZone is a factory that generates prefabs to be dragged off from the IsoDropZone. A factory would automatically generate a prefab based on the prefab name field value (if not empty) and notify the corresponding price change from a controller script (currently hardcoded to be the controller of each civil mini-game level, are going to refactor later to make it applicable to any sort of controller implementing an interface or abstract class).
To make the prefab auto-generation work, the prefab need to be stored under the Resources/Prefabs folder, and the name of the prefab (including the path from the Resources/Prefabs folder to it) and the value in the prefab name field in the IsoDropZone should match exactly.
A DraggableIsoItem has a name field, a direction field, four sprite fields for the four directions (NE, SE, SW, NW), a drop zone field, and a home position field.
The name field is used to identify this item and is used to check if this item can be dropped on a certain IsoDropZone.
The direction can be NE, SE, SW, or NW. When the game starts, the item will automatically be rendered to the corresponding sprite of the direction specified in the sprites fields.
The drop zone will be automatically set when the item is dropped onto an IsoDropZone, but it can also be given an IsoDropZone so that at the beginning of the game the item is registered as the item on this zone.
Also, the home position field can be set so that the item will automatically go back to the position specified when it is dragged but not dropped to a drop zone.
Copyright © 24/7 Solutions. 2018. All Rights Reserved.
- 24/7 Solutions
- Game Elements
- Unity
- Administration