Initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
@startuml
|
||||
abstract class Block {
|
||||
- blockData : BlockData
|
||||
- blockId : string
|
||||
+ {abstract} setupBlock() : void
|
||||
+ {abstract} simulate() : void
|
||||
+ getBlockData() : BlockData
|
||||
+ SetBlockData(BD:BlockData) : void
|
||||
+ setBlockId(id:string) : void
|
||||
+ getBlockId() : string
|
||||
}
|
||||
MonoBehaviour <|-- Block
|
||||
@enduml
|
||||
@@ -0,0 +1,9 @@
|
||||
@startuml
|
||||
class BlockData {
|
||||
+ blockName : string
|
||||
+ blockPrefab : GameObject
|
||||
+ associatedCategory : CategoryData
|
||||
+ icon : Texture2D
|
||||
}
|
||||
ScriptableObject <|-- BlockData
|
||||
@enduml
|
||||
@@ -0,0 +1,13 @@
|
||||
@startuml
|
||||
class BlockFactory {
|
||||
- {static} Instance : BlockFactory
|
||||
- environment : Environment
|
||||
- blockDataList : List<BlockData>
|
||||
- blocksData : Dictionary<string, BlockData>
|
||||
+ {static} getInstance() : BlockFactory
|
||||
- Awake() : void
|
||||
- Start() : void
|
||||
+ createblock(prefabId:string, position:Vector3, rotation:Quaternion, id:string, layerDiff:bool) : GameObject
|
||||
}
|
||||
MonoBehaviour <|-- BlockFactory
|
||||
@enduml
|
||||
@@ -0,0 +1,8 @@
|
||||
@startuml
|
||||
class CategoryData {
|
||||
+ ID : string
|
||||
+ blocks : List<BlockData>
|
||||
+ icon : Sprite
|
||||
}
|
||||
ScriptableObject <|-- CategoryData
|
||||
@enduml
|
||||
@@ -0,0 +1,7 @@
|
||||
@startuml
|
||||
class CodingBlock {
|
||||
+ <<override>> setupBlock() : void
|
||||
+ <<override>> simulate() : void
|
||||
}
|
||||
Block <|-- CodingBlock
|
||||
@enduml
|
||||
@@ -0,0 +1,7 @@
|
||||
@startuml
|
||||
class ElectricalBlock {
|
||||
+ <<override>> setupBlock() : void
|
||||
+ <<override>> simulate() : void
|
||||
}
|
||||
Block <|-- ElectricalBlock
|
||||
@enduml
|
||||
@@ -0,0 +1,19 @@
|
||||
@startuml
|
||||
class Environment {
|
||||
- {static} instance : Environment
|
||||
- blockRegistry : Dictionary<string, Block>
|
||||
+ onBlockAddedEvent : UnityEvent<Block>
|
||||
+ onBlockRemovedEvent : UnityEvent<Block>
|
||||
+ onChangeEvent : UnityEvent
|
||||
+ {static} getInstance() : Environment
|
||||
+ getBlockRegistry() : Dictionary<String, Block>
|
||||
- Awake() : void
|
||||
+ addBlock(block:Block, existingUUID:string) : void
|
||||
+ removeBlock(uuid:string) : void
|
||||
+ applyChanges() : void
|
||||
+ completeDestroyBlock(block:Block) : void
|
||||
+ getBlock(uuid:string) : Block
|
||||
+ clearEnvironment() : void
|
||||
}
|
||||
MonoBehaviour <|-- Environment
|
||||
@enduml
|
||||
@@ -0,0 +1,7 @@
|
||||
@startuml
|
||||
class MechanicalBlock {
|
||||
+ <<override>> setupBlock() : void
|
||||
+ <<override>> simulate() : void
|
||||
}
|
||||
Block <|-- MechanicalBlock
|
||||
@enduml
|
||||
@@ -0,0 +1,7 @@
|
||||
@startuml
|
||||
class MechanicalJoint {
|
||||
+ <<override>> setupBlock() : void
|
||||
+ <<override>> simulate() : void
|
||||
}
|
||||
Block <|-- MechanicalJoint
|
||||
@enduml
|
||||
@@ -0,0 +1,39 @@
|
||||
@startuml
|
||||
class CameraControl {
|
||||
- inputProvider : BaseInputProvider
|
||||
+ pivotPoint : Transform
|
||||
+ obstacleLayer : LayerMask
|
||||
+ panSpeed : float = 0.5f
|
||||
+ rotateSpeed : float = 5.0f
|
||||
+ zoomSpeed : float = 5.0f
|
||||
+ minZoom : float = 2.0f
|
||||
+ maxZoom : float = 50.0f
|
||||
+ enableSmoothing : bool = true
|
||||
+ smoothTime : float = 0.1f
|
||||
- _targetPosition : Vector3
|
||||
- _targetRotation : Quaternion
|
||||
- _targetZoom : float
|
||||
- _currentVelocity : Vector3
|
||||
- _isPanning : bool
|
||||
- _isOrbiting : bool
|
||||
- _cursorScreenPos : Vector2
|
||||
- _cam : Camera
|
||||
+ isInputLocked : bool = false
|
||||
- isInitialized : bool = false
|
||||
- Start() : void
|
||||
- OnEnable() : void
|
||||
- OnDisable() : void
|
||||
- LateUpdate() : void
|
||||
- OnCursorMoved(screenPos:Vector2) : void
|
||||
- OnPanStart(cursorScreenPos:Vector2) : void
|
||||
- OnPanEnd() : void
|
||||
- OnRotateStart() : void
|
||||
- OnRotateEnd() : void
|
||||
- OnCursorDelta(delta:Vector2) : void
|
||||
- OnZoom(scrollValue:float) : void
|
||||
- ApplyMovement() : void
|
||||
+ SnapToDirection(direction:Vector3) : void
|
||||
- OnDrawGizmos() : void
|
||||
}
|
||||
MonoBehaviour <|-- CameraControl
|
||||
@enduml
|
||||
@@ -0,0 +1,21 @@
|
||||
@startuml
|
||||
class ViewCubeController {
|
||||
+ mainCam : Camera
|
||||
+ viewCubeCam : Camera
|
||||
- CameraController : CameraControl
|
||||
+ viewCubeImage : RawImage
|
||||
- eventTrigger : EventTrigger
|
||||
- isPointerInViewCube : bool = false
|
||||
- cubeContainer : Transform
|
||||
+ viewCubeLayer : LayerMask
|
||||
- rawImageRect : RectTransform
|
||||
- debugRay : Ray
|
||||
- Start() : void
|
||||
- Update() : void
|
||||
- RotateCube() : void
|
||||
- CalculateCurrentRay() : void
|
||||
- DetectClick() : void
|
||||
- OnDrawGizmos() : void
|
||||
}
|
||||
MonoBehaviour <|-- ViewCubeController
|
||||
@enduml
|
||||
@@ -0,0 +1,17 @@
|
||||
@startuml
|
||||
class CommandDTO {
|
||||
- commandName : string
|
||||
- parameters : Dictionary<string, object>
|
||||
+ CommandName : string <<get>>
|
||||
+ Parameters : Dictionary<string, object> <<get>>
|
||||
+ converToCommand() : ICommand
|
||||
}
|
||||
class CommandDTOBuilder {
|
||||
- commandName : string
|
||||
- parameters : Dictionary<string, object>
|
||||
+ SetCommandName(name:string) : CommandDTOBuilder
|
||||
+ AddParameter(key:string, value:object) : CommandDTOBuilder
|
||||
+ Build() : CommandDTO
|
||||
}
|
||||
CommandDTO +-- CommandDTOBuilder
|
||||
@enduml
|
||||
@@ -0,0 +1,20 @@
|
||||
@startuml
|
||||
class CommandHandler {
|
||||
- {static} instance : CommandHandler
|
||||
- commandManager : CommandManager
|
||||
- environment : Environment
|
||||
+ {static} getInstance() : CommandHandler
|
||||
- Awake() : void
|
||||
- Start() : void
|
||||
- Update() : void
|
||||
+ createBlock(prefabId:string, position:Vector3, rotation:Quaternion) : void
|
||||
+ moveBlock(blockId:string, prePosition:Vector3, newPosition:Vector3, preRotation:Quaternion, newRotation:Quaternion) : void
|
||||
+ removeBlock(blockId:string) : void
|
||||
+ removeGroup(blockIds:List<string>) : void
|
||||
+ rotateBlock(blockId:string, newRotation:Quaternion) : void
|
||||
+ undoAction() : void
|
||||
+ redoAction() : void
|
||||
+ clearHistory() : void
|
||||
}
|
||||
MonoBehaviour <|-- CommandHandler
|
||||
@enduml
|
||||
@@ -0,0 +1,15 @@
|
||||
@startuml
|
||||
class CommandManager {
|
||||
- {static} instance : CommandManager
|
||||
- commandStack : LinkedList<ICommand>
|
||||
- redoStack : LinkedList<ICommand>
|
||||
- maxCapacity : int = 100
|
||||
- CommandManager()
|
||||
+ {static} getInstance() : CommandManager
|
||||
+ setMaxCapacity(capacity:int) : void
|
||||
+ executeCommand(command:ICommand) : void
|
||||
+ undo() : void
|
||||
+ redo() : ICommand
|
||||
+ clearHistory() : void
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,18 @@
|
||||
@startuml
|
||||
class CreateBlockCommand {
|
||||
- prefabId : string
|
||||
- position : Vector3
|
||||
- rotation : Quaternion
|
||||
- objectCreated : GameObject
|
||||
- blockId : string
|
||||
- layerDiff : bool
|
||||
- factory : BlockFactory
|
||||
- environment : Environment
|
||||
+ CreateBlockCommand(prefabId:string, position:Vector3, rotation:Quaternion, LayerDiff:bool)
|
||||
+ CreateBlockCommand(commandDTO:CommandDTO)
|
||||
+ execute() : void
|
||||
+ undo() : void
|
||||
+ toDTO() : CommandDTO
|
||||
}
|
||||
ICommand <|-- CreateBlockCommand
|
||||
@enduml
|
||||
@@ -0,0 +1,16 @@
|
||||
@startuml
|
||||
class DeleteBlockCommand {
|
||||
- blockId : string
|
||||
- prefabDeletedId : string
|
||||
- blockInitialPosition : Vector3
|
||||
- blockInitialRotation : Quaternion
|
||||
- factory : BlockFactory
|
||||
- environment : Environment
|
||||
+ DeleteBlockCommand(blockId:string)
|
||||
+ DeleteBlockCommand(commandDTO:CommandDTO)
|
||||
+ execute() : void
|
||||
+ undo() : void
|
||||
+ toDTO() : CommandDTO
|
||||
}
|
||||
ICommand <|-- DeleteBlockCommand
|
||||
@enduml
|
||||
@@ -0,0 +1,12 @@
|
||||
@startuml
|
||||
class DeleteGroupCommand {
|
||||
- blocksId : List<string>
|
||||
- deleteBlockCommands : List<DeleteBlockCommand>
|
||||
+ DeleteGroupCommand(blocksId:List<string>)
|
||||
+ DeleteGroupCommand(commandDTO:CommandDTO)
|
||||
+ execute() : void
|
||||
+ undo() : void
|
||||
+ toDTO() : CommandDTO
|
||||
}
|
||||
ICommand <|-- DeleteGroupCommand
|
||||
@enduml
|
||||
@@ -0,0 +1,7 @@
|
||||
@startuml
|
||||
interface ICommand {
|
||||
execute() : void
|
||||
undo() : void
|
||||
toDTO() : CommandDTO
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,17 @@
|
||||
@startuml
|
||||
class MoveBlockCommand {
|
||||
- blockId : string
|
||||
- previousPosition : Vector3
|
||||
- previousRotation : Quaternion
|
||||
- newPosition : Vector3
|
||||
- newRotation : Quaternion
|
||||
- environment : Environment
|
||||
- blockTransform : Transform
|
||||
+ MoveBlockCommand(blockId:string, previousPosition:Vector3, newPosition:Vector3, previousRotation:Quaternion, newRotation:Quaternion)
|
||||
+ MoveBlockCommand(commandDTO:CommandDTO)
|
||||
+ execute() : void
|
||||
+ undo() : void
|
||||
+ toDTO() : CommandDTO
|
||||
}
|
||||
ICommand <|-- MoveBlockCommand
|
||||
@enduml
|
||||
@@ -0,0 +1,15 @@
|
||||
@startuml
|
||||
class RotateblockCommand {
|
||||
- blockId : string
|
||||
- newRotation : Quaternion
|
||||
- previousRotation : Quaternion
|
||||
- environment : Environment
|
||||
- blockTransform : Transform
|
||||
+ RotateblockCommand(blockId:string, newRotation:Quaternion)
|
||||
+ RotateblockCommand(commandDTO:CommandDTO)
|
||||
+ execute() : void
|
||||
+ undo() : void
|
||||
+ toDTO() : CommandDTO
|
||||
}
|
||||
ICommand <|-- RotateblockCommand
|
||||
@enduml
|
||||
@@ -0,0 +1,23 @@
|
||||
@startuml
|
||||
abstract class BaseInputProvider {
|
||||
+ OnCursorMoved : UnityEvent<Vector2>
|
||||
+ OnCursorDelta : UnityEvent<Vector2>
|
||||
+ OnPanStart : UnityEvent<Vector2>
|
||||
+ OnPanEnd : UnityEvent
|
||||
+ OnRotateStart : UnityEvent
|
||||
+ OnRotateEnd : UnityEvent
|
||||
+ OnZoom : UnityEvent<float>
|
||||
+ OnRotate : UnityEvent
|
||||
+ OnPlace : UnityEvent
|
||||
+ OnDraggingEnd : UnityEvent
|
||||
+ OnSelect : UnityEvent
|
||||
+ OnEnableMultiSelect : UnityEvent
|
||||
+ OnDisableMultiSelect : UnityEvent
|
||||
+ OnCancel : UnityEvent
|
||||
+ OnDelete : UnityEvent
|
||||
+ OnChangeAttachPoint : UnityEvent<int>
|
||||
+ <<virtual>> Enable() : void
|
||||
+ <<virtual>> Disable() : void
|
||||
}
|
||||
MonoBehaviour <|-- BaseInputProvider
|
||||
@enduml
|
||||
@@ -0,0 +1,17 @@
|
||||
@startuml
|
||||
enum InputMode {
|
||||
Camera,
|
||||
ObjectDragging,
|
||||
UI,
|
||||
Gizmo,
|
||||
}
|
||||
class InputModeManager {
|
||||
- {static} <<readonly>> _list : List<InputMode>
|
||||
+ {static} Current : InputMode <<get>>
|
||||
+ {static} Push(mode:InputMode) : void
|
||||
+ {static} Pop(mode:InputMode) : void
|
||||
+ {static} Has(mode:InputMode) : bool
|
||||
+ {static} Is(mode:InputMode) : bool
|
||||
+ {static} debugCurrentList() : void
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,10 @@
|
||||
@startuml
|
||||
class InputProviderManager {
|
||||
- {static} instance : InputProviderManager
|
||||
- currentInputProvider : BaseInputProvider
|
||||
- Awake() : void
|
||||
+ {static} getInstance() : InputProviderManager
|
||||
+ getCurrentInputProvider() : BaseInputProvider
|
||||
}
|
||||
MonoBehaviour <|-- InputProviderManager
|
||||
@enduml
|
||||
@@ -0,0 +1,6 @@
|
||||
@startuml
|
||||
class MobileInputProvider {
|
||||
- Start() : void
|
||||
}
|
||||
BaseInputProvider <|-- MobileInputProvider
|
||||
@enduml
|
||||
@@ -0,0 +1,35 @@
|
||||
@startuml
|
||||
class PCIntputProvider {
|
||||
+ mousePosition : InputAction
|
||||
+ mouseDelta : InputAction
|
||||
+ scrollAction : InputAction
|
||||
+ panAction : InputAction
|
||||
+ orbitAction : InputAction
|
||||
+ rotateAction : InputAction
|
||||
+ placeAction : InputAction
|
||||
+ EndDraggingAction : InputAction
|
||||
+ selectAction : InputAction
|
||||
+ cancelAction : InputAction
|
||||
+ deleteAction : InputAction
|
||||
+ enableMultiSelectAction : InputAction
|
||||
+ disableMultiSelectAction : InputAction
|
||||
- OnEnable() : void
|
||||
- OnDisable() : void
|
||||
- OnInputSystem_Move(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_Delta(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_Scroll(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_PanStart(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_PanEnd(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_OrbitStart(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_OrbitEnd(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_Rotate(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_Place(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_DraggingEnd(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_Cancel(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_Select(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_EnableMultiSelect(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_DisableMultiSelect(ctx:InputAction.CallbackContext) : void
|
||||
- OnInputSystem_Delete(ctx:InputAction.CallbackContext) : void
|
||||
}
|
||||
BaseInputProvider <|-- PCIntputProvider
|
||||
@enduml
|
||||
@@ -0,0 +1,18 @@
|
||||
@startuml
|
||||
class BaseInteractable {
|
||||
+ onSelectEnterEvent : UnityEvent
|
||||
+ onSelectExitEvent : UnityEvent
|
||||
+ onHoverEnterEvent : UnityEvent
|
||||
+ onHoverExitEvent : UnityEvent
|
||||
+ <<virtual>> onHoverEnter() : void
|
||||
+ <<virtual>> onHoverExit() : void
|
||||
- OnMouseEnter() : void
|
||||
- OnMouseExit() : void
|
||||
+ <<virtual>> onSelectEnter() : void
|
||||
+ <<virtual>> onSelectExit() : void
|
||||
+ <<virtual>> highLightOn() : void
|
||||
+ <<virtual>> highLightOff() : void
|
||||
}
|
||||
MonoBehaviour <|-- BaseInteractable
|
||||
IInteractable <|-- BaseInteractable
|
||||
@enduml
|
||||
@@ -0,0 +1,17 @@
|
||||
@startuml
|
||||
class GrabInteractable {
|
||||
- attachPoint : Transform
|
||||
+ alignToSurfaceNormal : bool = true
|
||||
+ alignmentSpeed : float = 15f
|
||||
+ snapRotation : bool = false
|
||||
+ followSpeed : float = 20f
|
||||
+ heightOffset : float = 0f
|
||||
- validator : IValidator
|
||||
+ validTint : Color
|
||||
+ invalidTint : Color
|
||||
+ GetAttachPoint() : Transform
|
||||
+ SetAttachPoint(attachPoint:Transform) : void
|
||||
+ GetValidator() : IValidator
|
||||
}
|
||||
MonoBehaviour <|-- GrabInteractable
|
||||
@enduml
|
||||
@@ -0,0 +1,11 @@
|
||||
@startuml
|
||||
class HoveredUI {
|
||||
- ghostManager : GhostManager
|
||||
- Start() : void
|
||||
+ OnPointerEnter(eventData:PointerEventData) : void
|
||||
+ OnPointerExit(eventData:PointerEventData) : void
|
||||
}
|
||||
MonoBehaviour <|-- HoveredUI
|
||||
IPointerEnterHandler <|-- HoveredUI
|
||||
IPointerExitHandler <|-- HoveredUI
|
||||
@enduml
|
||||
@@ -0,0 +1,11 @@
|
||||
@startuml
|
||||
interface IInteractable {
|
||||
transform : Transform <<get>>
|
||||
onSelectEnter() : void
|
||||
onSelectExit() : void
|
||||
onHoverEnter() : void
|
||||
onHoverExit() : void
|
||||
highLightOn() : void
|
||||
highLightOff() : void
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,16 @@
|
||||
@startuml
|
||||
class UIInteractable {
|
||||
- uIManager : UIManager
|
||||
- blockData : BlockData
|
||||
- isSelected : bool = false
|
||||
- originalColor : Color
|
||||
- Start() : void
|
||||
+ <<override>> onSelectEnter() : void
|
||||
+ <<override>> onSelectExit() : void
|
||||
<<internal>> getAssociatedBlockData() : BlockData
|
||||
+ setBlockData(blockData:BlockData) : void
|
||||
+ OnPointerDown(eventData:PointerEventData) : void
|
||||
}
|
||||
BaseInteractable <|-- UIInteractable
|
||||
IPointerDownHandler <|-- UIInteractable
|
||||
@enduml
|
||||
@@ -0,0 +1,11 @@
|
||||
@startuml
|
||||
class DeleteInteractor {
|
||||
- inputProvider : BaseInputProvider
|
||||
- commandHandler : CommandHandler
|
||||
- selectionManager : SelectionManager
|
||||
- Start() : void
|
||||
+ DeleteObjects() : void
|
||||
- FindBlockIndex(obj:GameObject) : string
|
||||
}
|
||||
MonoBehaviour <|-- DeleteInteractor
|
||||
@enduml
|
||||
@@ -0,0 +1,22 @@
|
||||
@startuml
|
||||
class RayInteractor {
|
||||
- {static} instance : RayInteractor
|
||||
+ {static} getInstance() : RayInteractor
|
||||
- gizmoLayerMask : LayerMask
|
||||
- interactableLayerMask : LayerMask
|
||||
- worldLayerMask : LayerMask
|
||||
- inputProvider : BaseInputProvider
|
||||
- mainCamera : Camera
|
||||
- lastHit : RaycastHit
|
||||
- currentGizmo : GameObject
|
||||
+ OnWorldClick : UnityEvent
|
||||
+ OnSelectEvent : UnityEvent<IInteractable>
|
||||
- Awake() : void
|
||||
- Start() : void
|
||||
- SetupInput() : void
|
||||
+ GetHitInfo(hitInfo:RaycastHit) : bool
|
||||
+ GetCurrentGizmo() : GameObject
|
||||
+ GetHitPosition() : Vector3
|
||||
}
|
||||
MonoBehaviour <|-- RayInteractor
|
||||
@enduml
|
||||
@@ -0,0 +1,18 @@
|
||||
@startuml
|
||||
class SnapSystem {
|
||||
- {static} instance : SnapSystem
|
||||
+ {static} getInstance() : SnapSystem
|
||||
- socketDetectionRadius : float = 0.5f
|
||||
- <<readonly>> nearbySockets : List<SocketPoint>
|
||||
- <<readonly>> visitedRoots : HashSet<Transform>
|
||||
- closestSocket : SocketPoint
|
||||
- Awake() : void
|
||||
+ UpdateSockets(detectionPoint:Vector3, ghostRoot:Transform) : void
|
||||
+ ClearHighlights() : void
|
||||
+ Clear() : void
|
||||
+ GetNearbySockets() : List<SocketPoint>
|
||||
+ GetClosestSocket() : SocketPoint
|
||||
- {static} FindClosest(position:Vector3, sockets:List<SocketPoint>) : SocketPoint
|
||||
}
|
||||
MonoBehaviour <|-- SnapSystem
|
||||
@enduml
|
||||
@@ -0,0 +1,7 @@
|
||||
@startuml
|
||||
class TestCommandInteractor {
|
||||
- commandHandler : CommandHandler
|
||||
- Update() : void
|
||||
}
|
||||
MonoBehaviour <|-- TestCommandInteractor
|
||||
@enduml
|
||||
@@ -0,0 +1,20 @@
|
||||
@startuml
|
||||
class AxisMoveStrategy {
|
||||
- <<readonly>> _lockedRotation : Quaternion
|
||||
- _isDragging : bool
|
||||
- _axisDirection : Vector3
|
||||
- _axisOrigin : Vector3
|
||||
- _clampMin : float
|
||||
- _clampMax : float
|
||||
- _camera : Camera
|
||||
- _frozenPosition : Vector3
|
||||
- _lastMousePos : Vector2
|
||||
- _accumulated : float
|
||||
+ AxisMoveStrategy(lockedRotation:Quaternion, clampMin:float, clampMax:float)
|
||||
+ BeginDrag(axisDirection:Vector3, ghostPosition:Vector3) : void
|
||||
+ EndDrag() : void
|
||||
+ UpdateMovement(ctx:GhostMovementContext) : void
|
||||
- TrySocketSnap(ctx:GhostMovementContext) : bool
|
||||
}
|
||||
IGhostMovementStrategy <|-- AxisMoveStrategy
|
||||
@enduml
|
||||
@@ -0,0 +1,24 @@
|
||||
@startuml
|
||||
class AxisRotateStrategy {
|
||||
+ OverridesSurfaceTracking : bool <<get>>
|
||||
- <<readonly>> _localAxis : LocalAxis
|
||||
- <<readonly>> _lockedPosition : Vector3
|
||||
- _isRotating : bool
|
||||
- _pendingDegrees : float
|
||||
- _lastMousePos : Vector2
|
||||
+ Sensitivity : float = 0.4f
|
||||
+ AxisRotateStrategy(localAxis:LocalAxis, lockedPosition:Vector3)
|
||||
+ BeginRotate() : void
|
||||
+ EndRotate() : void
|
||||
+ UpdateMovement(ctx:GhostMovementContext) : void
|
||||
- GetWorldAxis(t:Transform) : Vector3
|
||||
- {static} SnapToNearestRightAngle(q:Quaternion) : Quaternion
|
||||
}
|
||||
enum LocalAxis {
|
||||
Up,
|
||||
Forward,
|
||||
Right,
|
||||
}
|
||||
IGhostMovementStrategy <|-- AxisRotateStrategy
|
||||
AxisRotateStrategy +-- LocalAxis
|
||||
@enduml
|
||||
@@ -0,0 +1,12 @@
|
||||
@startuml
|
||||
class FreeMoveStrategy {
|
||||
+ UpdateMovement(ctx:GhostMovementContext) : void
|
||||
- {static} TrySocketSnap(ctx:GhostMovementContext) : bool
|
||||
- {static} PerformSocketSnap(ctx:GhostMovementContext) : void
|
||||
- {static} AlignToSurfaceNormal(ctx:GhostMovementContext) : void
|
||||
- {static} MoveAlongSurface(ctx:GhostMovementContext) : void
|
||||
- {static} GetCurrentPivot(ctx:GhostMovementContext) : Transform
|
||||
- {static} SnapToNearestRightAngle(q:Quaternion) : Quaternion
|
||||
}
|
||||
IGhostMovementStrategy <|-- FreeMoveStrategy
|
||||
@enduml
|
||||
@@ -0,0 +1,16 @@
|
||||
@startuml
|
||||
struct GhostMovementContext {
|
||||
+ <<readonly>> GhostTransform : Transform
|
||||
+ <<readonly>> SurfacePoint : Vector3
|
||||
+ <<readonly>> SurfaceNormal : Vector3
|
||||
+ <<readonly>> MySocket : SocketPoint
|
||||
+ <<readonly>> TargetSocket : SocketPoint
|
||||
+ <<readonly>> AttachPoint : Transform
|
||||
+ <<readonly>> FollowSpeed : float
|
||||
+ <<readonly>> HeightOffset : float
|
||||
+ <<readonly>> AlignToSurfaceNormal : bool
|
||||
+ <<readonly>> SnapRotation : bool
|
||||
+ RotationAxis : Vector3
|
||||
+ GhostMovementContext(ghostTransform:Transform, surfacePoint:Vector3, surfaceNormal:Vector3, mySocket:SocketPoint, targetSocket:SocketPoint, attachPoint:Transform, followSpeed:float, heightOffset:float, alignToSurfaceNormal:bool, snapRotation:bool)
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,18 @@
|
||||
@startuml
|
||||
class GhostStrategyHandler {
|
||||
- {static} instance : GhostStrategyHandler
|
||||
+ {static} getInstance() : GhostStrategyHandler
|
||||
- ghostManager : GhostManager
|
||||
- Awake() : void
|
||||
- Start() : void
|
||||
+ StartDraggingRight() : void
|
||||
+ StartDraggingUp() : void
|
||||
+ StartDraggingForward() : void
|
||||
+ EndDragging() : void
|
||||
+ StartRotatingRight() : AxisRotateStrategy
|
||||
+ StartRotatingUp() : AxisRotateStrategy
|
||||
+ StartRotatingForward() : AxisRotateStrategy
|
||||
+ StartRotation() : void
|
||||
}
|
||||
MonoBehaviour <|-- GhostStrategyHandler
|
||||
@enduml
|
||||
@@ -0,0 +1,41 @@
|
||||
@startuml
|
||||
class GhostStrategyTester {
|
||||
+ TestTarget : GameObject
|
||||
+ ClampMin : float
|
||||
+ ClampMax : float = 5f
|
||||
+ RotateSensitivity : float = 0.4f
|
||||
- _mode : Mode
|
||||
- _moveStrat : AxisMoveStrategy
|
||||
- _rotStrat : AxisRotateStrategy
|
||||
- _isEditing : bool
|
||||
- _buttonHeld : bool
|
||||
- _activeAxisIndex : int
|
||||
- _lastMouseX : float
|
||||
- _editingOrigin : Vector3
|
||||
- {static} <<readonly>> AxisColors : Color[]
|
||||
- {static} <<readonly>> AxisLabels : string[]
|
||||
- {static} <<readonly>> LocalMoveAxes : Vector3[]
|
||||
- {static} <<readonly>> RotateAxes : AxisRotateStrategy.LocalAxis[]
|
||||
- <<const>> BtnW : float = 96f
|
||||
- <<const>> BtnH : float = 36f
|
||||
- <<const>> PadX : float = 12f
|
||||
- <<const>> PadY : float = 8f
|
||||
- Start() : void
|
||||
- OnGUI() : void
|
||||
- DrawAxisButton(i:int, rect:Rect) : void
|
||||
- OnAxisButtonDown(axisIndex:int) : void
|
||||
- OnAxisButtonUp() : void
|
||||
- EnsureEditing() : void
|
||||
- CommitEdit() : void
|
||||
- StopEditing() : void
|
||||
- ResetState() : void
|
||||
- DrawModeButton(label:string, target:Mode, rect:Rect) : void
|
||||
}
|
||||
enum Mode {
|
||||
None,
|
||||
AxisMove,
|
||||
AxisRotate,
|
||||
}
|
||||
MonoBehaviour <|-- GhostStrategyTester
|
||||
GhostStrategyTester +-- Mode
|
||||
@enduml
|
||||
@@ -0,0 +1,5 @@
|
||||
@startuml
|
||||
interface IGhostMovementStrategy {
|
||||
UpdateMovement(ctx:GhostMovementContext) : void
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,72 @@
|
||||
@startuml
|
||||
class GhostManager {
|
||||
- {static} instance : GhostManager
|
||||
+ {static} getInstance() : GhostManager
|
||||
- selectedBlockData : BlockData
|
||||
- ghostObject : GameObject
|
||||
- canPlace : bool = false
|
||||
- onClearEvent : UnityEvent
|
||||
- alignToSurfaceNormal : bool = true
|
||||
- snapRotation : bool = false
|
||||
- followSpeed : float = 20f
|
||||
- heightOffset : float = 0f
|
||||
- validTint : Color
|
||||
- invalidTint : Color
|
||||
- attachPoint : Transform
|
||||
- validator : IValidator
|
||||
- isValidPlacement : bool = true
|
||||
- currentSurfaceNormal : Vector3
|
||||
- currentSurfacePoint : Vector3
|
||||
- rotationAxis : Vector3
|
||||
- ghostRenderers : Renderer[]
|
||||
- container : SocketContainer
|
||||
- jointBlock : JointBlock
|
||||
- block : Block
|
||||
- isDragged : bool = false
|
||||
- isJustPlaced : bool = false
|
||||
- editingSourceObject : GameObject
|
||||
- editingOriginalPos : Vector3
|
||||
- editingOriginalRot : Quaternion
|
||||
- isEditingExisting : bool
|
||||
- currentStrategy : IGhostMovementStrategy
|
||||
+ SetMovementStrategy(strategy:IGhostMovementStrategy) : void
|
||||
- rayInteractor : RayInteractor
|
||||
- snappingSystem : SnapSystem
|
||||
- environment : Environment
|
||||
- commandHandler : CommandHandler
|
||||
- socketIterator : SocketIterator
|
||||
- inputProvider : BaseInputProvider
|
||||
- Awake() : void
|
||||
- Start() : void
|
||||
- Update() : void
|
||||
+ GhostTransform : Transform <<get>>
|
||||
+ setDrag(drag:bool) : void
|
||||
- OnPlace() : void
|
||||
+ ForcePlace() : void
|
||||
- resetPlaced() : IEnumerator
|
||||
- OnPlaceWithDragging() : void
|
||||
- PlaceBlock() : void
|
||||
- CommitExistingBlock() : void
|
||||
+ SetupBlock(blockData:BlockData) : void
|
||||
+ SetupExistingBlock(sourceObject:GameObject, strategy:IGhostMovementStrategy) : void
|
||||
- InitialiseGhostFromObject(ghost:GameObject) : void
|
||||
+ HasActiveGhost() : bool
|
||||
+ isGhost(obj:GameObject) : bool
|
||||
+ ClearGhost() : void
|
||||
+ ClearGhostData() : void
|
||||
- UpdateSurfaceTracking() : void
|
||||
- UpdateVisualFeedback(isValid:bool) : void
|
||||
- {static} SetLayerRecursively(obj:GameObject, layer:int, Method:Func<Transform, bool>) : void
|
||||
- {static} SetLayerRecursively(obj:GameObject, layer:int) : void
|
||||
- {static} RestoreMaterialAlpha(obj:GameObject, Method:Func<GameObject, bool>) : void
|
||||
- {static} RestoreMaterialAlpha(obj:GameObject) : void
|
||||
- {static} RestoreMaterialColor(obj:GameObject, Method:Func<GameObject, bool>) : void
|
||||
- {static} RestoreMaterialColor(obj:GameObject) : void
|
||||
+ onClearAddListener(action:UnityAction) : void
|
||||
+ setupBlock(blockData:BlockData) : void
|
||||
+ clearGhost() : void
|
||||
+ clearGhostData() : void
|
||||
- afterCreation(blockObj:GameObject) : void
|
||||
}
|
||||
MonoBehaviour <|-- GhostManager
|
||||
@enduml
|
||||
@@ -0,0 +1,14 @@
|
||||
@startuml
|
||||
class InteractionManager {
|
||||
- {static} instance : InteractionManager
|
||||
- commandHandler : CommandHandler
|
||||
- ghostManager : GhostManager
|
||||
- selectionManager : SelectionManager
|
||||
- uiManager : UIManager
|
||||
- Awake() : void
|
||||
+ {static} getInstance() : InteractionManager
|
||||
- Start() : void
|
||||
- setupListeners() : void
|
||||
}
|
||||
MonoBehaviour <|-- InteractionManager
|
||||
@enduml
|
||||
@@ -0,0 +1,18 @@
|
||||
@startuml
|
||||
class SelectionManager {
|
||||
- {static} instance : SelectionManager
|
||||
+ {static} getInstance() : SelectionManager
|
||||
- rayInteractor : RayInteractor
|
||||
- inputProvider : BaseInputProvider
|
||||
- <<readonly>> currentSelections : List<IInteractable>
|
||||
- multiSelectEnabled : bool = false
|
||||
+ SelectionEvent : UnityEvent<IInteractable>
|
||||
- Awake() : void
|
||||
- Start() : void
|
||||
- HandleSelect(interactable:IInteractable) : void
|
||||
+ GetCurrentSelections() : List<IInteractable>
|
||||
+ ClearSelection() : void
|
||||
+ HasOneSelection() : bool
|
||||
}
|
||||
MonoBehaviour <|-- SelectionManager
|
||||
@enduml
|
||||
@@ -0,0 +1,18 @@
|
||||
@startuml
|
||||
class SocketManagerChecker {
|
||||
- environment : Environment
|
||||
- ghostManager : GhostManager
|
||||
- rayInteractor : RayInteractor
|
||||
- jointPlacementHandler : JointPlacementHandler
|
||||
- socketTolerance : float = 0.5f
|
||||
- Start() : void
|
||||
- OnRemove(arg0:Block) : void
|
||||
- OnAdd(arg0:Block) : void
|
||||
- OnBlockRemoved(arg0:Block) : void
|
||||
- OnJointRemoved(arg0:Block) : void
|
||||
- OnBlockAdded(arg0:Block) : void
|
||||
- OnJointAdded(arg0:Block) : void
|
||||
- getClosestSocketBy(socketPoint:SocketPoint, tol:float) : SocketPoint
|
||||
}
|
||||
MonoBehaviour <|-- SocketManagerChecker
|
||||
@enduml
|
||||
@@ -0,0 +1,14 @@
|
||||
@startuml
|
||||
class UIManager {
|
||||
- {static} instance : UIManager
|
||||
- currentSelectedUIInteractable : UIInteractable
|
||||
- currentSelectedData : BlockData
|
||||
+ onSelectEvent : UnityEvent<BlockData>
|
||||
- currentCategory : CategoryData
|
||||
- Awake() : void
|
||||
+ {static} getInstance() : UIManager
|
||||
+ selectUIInteractable(uiInteractable:UIInteractable) : void
|
||||
+ deselectUIInteractable() : void
|
||||
}
|
||||
MonoBehaviour <|-- UIManager
|
||||
@enduml
|
||||
@@ -0,0 +1,9 @@
|
||||
@startuml
|
||||
class BlockNode {
|
||||
+ blockData : BlockData
|
||||
+ position : Vector3
|
||||
+ rotation : Quaternion
|
||||
+ matchedNode : BlockNode
|
||||
+ BlockNode(blockData:BlockData, position:Vector3, rotation:Quaternion)
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,7 @@
|
||||
@startuml
|
||||
class BlocksGraph {
|
||||
- graph : Dictionary<BlockNode, List<BlockNode>>
|
||||
- root : BlockNode
|
||||
}
|
||||
ScriptableObject <|-- BlocksGraph
|
||||
@enduml
|
||||
@@ -0,0 +1,15 @@
|
||||
@startuml
|
||||
class BlocksMap {
|
||||
+ blocks : Dictionary<string, Dictionary<Vector3, BlockNode>>
|
||||
+ allNodes : List<BlockNode>
|
||||
+ rootNode : BlockNode
|
||||
+ calcTotalNodes() : long
|
||||
+ init(blocksMap:BlocksMap) : void
|
||||
- OnEnable() : void
|
||||
- RebuildDictionary() : void
|
||||
+ setRootNode(node:BlockNode) : void
|
||||
+ {static} RoundPosition(position:Vector3, precision:float) : Vector3
|
||||
+ {static} RoundRotation(rotation:Quaternion, precision:float) : Quaternion
|
||||
}
|
||||
ScriptableObject <|-- BlocksMap
|
||||
@enduml
|
||||
@@ -0,0 +1,28 @@
|
||||
@startuml
|
||||
class ModelCheckManager {
|
||||
- {static} instance : ModelCheckManager
|
||||
+ {static} getInstance() : ModelCheckManager
|
||||
- environment : Environment
|
||||
- blocksMap : BlocksMap
|
||||
- currentMap : BlocksMap
|
||||
- validNodes : long
|
||||
- invalidNodes : long
|
||||
- totalNodes : long
|
||||
+ OnAllValidEvent : UnityEvent
|
||||
+ OnValidNodeEvent : UnityEvent
|
||||
+ OnInvalidNodeEvent : UnityEvent
|
||||
+ newMapName : string = "NewBlocksMap"
|
||||
- debug : bool = false
|
||||
+ setBlockMap(map:BlocksMap) : void
|
||||
- Start() : void
|
||||
+ Initialize() : void
|
||||
- createBlockNode(blockData:BlockData, position:Vector3, rotation:Quaternion) : BlockNode
|
||||
- Awake() : void
|
||||
+ addNode(node:BlockNode) : void
|
||||
+ removeNode(blockName:string, position:Vector3) : void
|
||||
- tryMarkNode(node:BlockNode) : bool
|
||||
- matchRotation(node1:BlockNode, node2:BlockNode) : bool
|
||||
- debugisValid(node:BlockNode) : void
|
||||
}
|
||||
MonoBehaviour <|-- ModelCheckManager
|
||||
@enduml
|
||||
@@ -0,0 +1,7 @@
|
||||
@startuml
|
||||
class GizmoFMoveElement {
|
||||
- Start() : void
|
||||
- Update() : void
|
||||
}
|
||||
MonoBehaviour <|-- GizmoFMoveElement
|
||||
@enduml
|
||||
@@ -0,0 +1,22 @@
|
||||
@startuml
|
||||
enum GizmoDirection {
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
}
|
||||
class GizmoMoveElement {
|
||||
- direction : GizmoDirection
|
||||
- attachedTransform : Transform
|
||||
- moveStrategy : AxisMoveStrategy
|
||||
- ghostManager : GhostManager
|
||||
- OGMat : Material
|
||||
- SelectedMat : Material
|
||||
- Start() : void
|
||||
+ getDirection() : GizmoDirection
|
||||
+ onSelectEnter() : void
|
||||
+ onSelectExit() : void
|
||||
+ ResetMat() : void
|
||||
- GetAxisDirection() : Vector3
|
||||
}
|
||||
MonoBehaviour <|-- GizmoMoveElement
|
||||
@enduml
|
||||
@@ -0,0 +1,19 @@
|
||||
@startuml
|
||||
class GizmoRotateElement {
|
||||
- direction : GizmoDirection
|
||||
- rotationSensitivity : float = 0.3f
|
||||
- SelectedMat : Material
|
||||
- attachedTransform : Transform
|
||||
- rotateStrategy : AxisRotateStrategy
|
||||
- ghostManager : GhostManager
|
||||
- OGMat : Material
|
||||
- isDragging : bool
|
||||
- lastMousePos : Vector2
|
||||
- Start() : void
|
||||
+ onSelectEnter() : void
|
||||
+ onSelectExit() : void
|
||||
+ ResetMat() : void
|
||||
- GetLocalAxis() : AxisRotateStrategy.LocalAxis
|
||||
}
|
||||
MonoBehaviour <|-- GizmoRotateElement
|
||||
@enduml
|
||||
@@ -0,0 +1,10 @@
|
||||
@startuml
|
||||
class MultiSelectValidationCheck {
|
||||
- selectionManager : SelectionManager
|
||||
- BarTransform : RectTransform
|
||||
- OriginalBarTransform : Vector2
|
||||
- Start() : void
|
||||
+ SelectedItem(interactable:IInteractable) : void
|
||||
}
|
||||
MonoBehaviour <|-- MultiSelectValidationCheck
|
||||
@enduml
|
||||
@@ -0,0 +1,33 @@
|
||||
@startuml
|
||||
class TransformManager {
|
||||
- FreeMove : Toggle
|
||||
- AxialMove : Toggle
|
||||
- AxialRotate : Toggle
|
||||
- selectionManager : SelectionManager
|
||||
- mianCamera : Camera
|
||||
- FMoveEn : bool = false
|
||||
- gizmosMovePrefab : GameObject
|
||||
- gizmosRotatePrefab : GameObject
|
||||
- scaleFactor : float = 1
|
||||
- currentGizmosMove : GameObject
|
||||
- currentGizmosRotate : GameObject
|
||||
- CurrentSelection : IInteractable
|
||||
- GhostSH : GhostStrategyHandler
|
||||
- MElement : GizmoMoveElement
|
||||
- RElement : GizmoRotateElement
|
||||
- RayInteractor : RayInteractor
|
||||
- GizmosArray : Transform[]
|
||||
- IsSelected : bool = false
|
||||
- UnSelectedMaterial : Material
|
||||
- Start() : void
|
||||
- Update() : void
|
||||
- SelectionToMGizmo(element:GizmoMoveElement) : void
|
||||
- SelectionToRGizmo(element:GizmoRotateElement) : void
|
||||
- GizmoDeselect() : void
|
||||
- FMove(Trigger:bool) : void
|
||||
- AMove(Trigger:bool) : void
|
||||
- ARot(Trigger:bool) : void
|
||||
- SetCurrent(interactable:IInteractable) : void
|
||||
}
|
||||
MonoBehaviour <|-- TransformManager
|
||||
@enduml
|
||||
@@ -0,0 +1,15 @@
|
||||
@startuml
|
||||
class CommandSaveHandler {
|
||||
- {static} instance : CommandSaveHandler
|
||||
- commandList : LinkedList<CommandDTO>
|
||||
- saveFilePath : string
|
||||
+ {static} getInstance() : CommandSaveHandler
|
||||
+ setFileName(fileName:string) : void
|
||||
+ saveCommands() : void
|
||||
+ loadCommands() : void
|
||||
+ excuteAllCommands(action:Action) : IEnumerator
|
||||
+ addLastCommand(command:CommandDTO) : void
|
||||
+ removeLastCommand() : void
|
||||
+ clearCommandList() : void
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,9 @@
|
||||
@startuml
|
||||
class CommandSaveUtil <<static>> {
|
||||
- {static} getSettings() : JsonSerializerSettings
|
||||
+ {static} saveLinkedList(list:LinkedList<CommandDTO>, saveFilePath:string) : bool
|
||||
+ {static} loadLinkedList(saveFilePath:string) : LinkedList<CommandDTO>
|
||||
+ {static} deleteSaveFile(saveFilePath:string) : void
|
||||
+ {static} hasSaveFile(saveFilePath:string) : bool
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,15 @@
|
||||
@startuml
|
||||
class EnvironmentObserver {
|
||||
- environment : Environment
|
||||
- commandSaveHandler : CommandSaveHandler
|
||||
- autoSaving : bool = true
|
||||
- canSave : bool = true
|
||||
- Start() : void
|
||||
- onChange() : void
|
||||
+ save() : void
|
||||
+ load() : void
|
||||
- reloadSave() : IEnumerator
|
||||
- addAllCommands() : void
|
||||
}
|
||||
MonoBehaviour <|-- EnvironmentObserver
|
||||
@enduml
|
||||
@@ -0,0 +1,24 @@
|
||||
@startuml
|
||||
class AttachableBlock {
|
||||
- blockType : BlockType
|
||||
- socketContainer : SocketContainer
|
||||
- connectedBlocks : List<AttachableBlock>
|
||||
- attachedJoints : List<JointBlock>
|
||||
+ GetConnectedBlocks() : List<AttachableBlock>
|
||||
+ GetAttachedJoints() : List<JointBlock>
|
||||
+ SetBlockType(BlockType:BlockType) : void
|
||||
+ DisconnectFrom(otherBlock:AttachableBlock) : void
|
||||
+ UnregisterJoint(joint:JointBlock) : void
|
||||
- Awake() : void
|
||||
+ GetSocketContainer() : SocketContainer
|
||||
+ ConnectTo(otherBlock:AttachableBlock, mySocket:SocketPoint, theirSocket:SocketPoint) : void
|
||||
+ RegisterJoint(joint:JointBlock) : void
|
||||
}
|
||||
enum BlockType {
|
||||
Regular,
|
||||
Link,
|
||||
Gear,
|
||||
Structural,
|
||||
}
|
||||
MonoBehaviour <|-- AttachableBlock
|
||||
@enduml
|
||||
@@ -0,0 +1,5 @@
|
||||
@startuml
|
||||
interface BlockContainerInit {
|
||||
InitBlockContainer(sockets:List<SocketPoint>) : List<SocketPoint>
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,7 @@
|
||||
@startuml
|
||||
class SimpleLinkContainerInit {
|
||||
+ InitBlockContainer(sockets:List<SocketPoint>) : List<SocketPoint>
|
||||
}
|
||||
MonoBehaviour <|-- SimpleLinkContainerInit
|
||||
BlockContainerInit <|-- SimpleLinkContainerInit
|
||||
@enduml
|
||||
@@ -0,0 +1,19 @@
|
||||
@startuml
|
||||
interface ISocket {
|
||||
GetTransform() : Transform
|
||||
GetSocketType() : SocketType
|
||||
GetSocketRadius() : float
|
||||
IsOccupied() : bool
|
||||
GetOccupyingObject() : GameObject
|
||||
SetOccupied(obj:GameObject) : void
|
||||
Release() : void
|
||||
CanAccept(otherSocket:ISocket, isJoint:bool) : bool
|
||||
GetNormal() : Vector3
|
||||
}
|
||||
enum SocketType {
|
||||
Regular,
|
||||
JointHost,
|
||||
JointEnd,
|
||||
Universal,
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,36 @@
|
||||
@startuml
|
||||
class JointBlock {
|
||||
- jointType : JointBlockType
|
||||
- jointLength : float = 1f
|
||||
- socketEnd1 : SocketPoint
|
||||
- socketEnd2 : SocketPoint
|
||||
- usePhysics : bool = true
|
||||
- jointBreakForce : float
|
||||
- jointBreakTorque : float
|
||||
+ connectedBlocks : List<AttachableBlock>
|
||||
- createdJoints : List<Joint>
|
||||
- isPlaced : bool = false
|
||||
- jointPlacementHandler : JointPlacementHandler
|
||||
- Awake() : void
|
||||
+ TryPlaceJoint(targetSockets:List<SocketPoint>, isGhost:bool) : bool
|
||||
- AlignToSockets(targetSockets:List<SocketPoint>, isGhost:bool) : void
|
||||
+ CreatePhysicsJoint(targetObj:GameObject, socket:SocketPoint) : void
|
||||
- CreatePhysicsJoints(targetSockets:List<SocketPoint>) : void
|
||||
- CreateJointByType(connectedBody:Rigidbody, socket:SocketPoint) : Joint
|
||||
- CreateFixedJoint(connectedBody:Rigidbody) : FixedJoint
|
||||
- CreateHingeJoint(connectedBody:Rigidbody, socket:SocketPoint) : HingeJoint
|
||||
- CreateConfigurableJoint(connectedBody:Rigidbody, socket:SocketPoint) : ConfigurableJoint
|
||||
- MarkSocketsOccupied(targetSockets:List<SocketPoint>) : void
|
||||
+ RemoveJoint() : void
|
||||
+ GetJointType() : JointBlockType
|
||||
+ GetSocketEnd1() : SocketPoint
|
||||
+ GetSocketEnd2() : SocketPoint
|
||||
+ IsPlaced() : bool
|
||||
}
|
||||
enum JointBlockType {
|
||||
FixedPivot,
|
||||
HingePivot,
|
||||
ConfigurablePivot,
|
||||
}
|
||||
MonoBehaviour <|-- JointBlock
|
||||
@enduml
|
||||
@@ -0,0 +1,15 @@
|
||||
@startuml
|
||||
class JointPlacementHandler {
|
||||
- {static} instance : JointPlacementHandler
|
||||
- socketSearchRadius : float = 1f
|
||||
- blockLayerMask : LayerMask
|
||||
+ {static} getInstance() : JointPlacementHandler
|
||||
- Awake() : void
|
||||
+ FindAllSocketsAlignedBetween(start:SocketPoint, end:SocketPoint) : List<SocketPoint>
|
||||
- IsPointOnSegment(A:Vector3, B:Vector3, P:Vector3, tolerance:float) : bool
|
||||
+ FindTargetSocketsForJoint(jointBlock:JointBlock, searchPosition:Vector3) : List<SocketPoint>
|
||||
- FindSocketAtJointEnd(firstSocket:SocketPoint, end1:SocketPoint, end2:SocketPoint) : SocketPoint
|
||||
- FindClosestSocket(position:Vector3, sockets:List<SocketPoint>) : SocketPoint
|
||||
}
|
||||
MonoBehaviour <|-- JointPlacementHandler
|
||||
@enduml
|
||||
@@ -0,0 +1,35 @@
|
||||
@startuml
|
||||
class SocketContainer {
|
||||
- sockets : List<SocketPoint>
|
||||
- iterativeSockets : List<SocketPoint>
|
||||
- autoDetectSockets : bool = true
|
||||
- allowCycling : bool = true
|
||||
- wrapAround : bool = true
|
||||
- containerInit : BlockContainerInit
|
||||
- currentSocketIndex : int = 0
|
||||
- currentActiveSocket : SocketPoint
|
||||
- Awake() : void
|
||||
- InitializeSockets() : void
|
||||
+ GetActiveSocket() : SocketPoint
|
||||
+ CycleToNextSocket() : void
|
||||
+ CycleToPreviousSocket() : void
|
||||
+ SetActiveSocketByIndex(index:int) : void
|
||||
+ SetActiveSocket(socket:SocketPoint) : void
|
||||
+ ResetToFirstSocket() : void
|
||||
+ GetAllSockets() : List<SocketPoint>
|
||||
+ GetAvailableSockets() : List<SocketPoint>
|
||||
+ GetOccupiedSockets() : List<SocketPoint>
|
||||
+ FindNearestCompatibleSocket(worldPosition:Vector3, sourceSocket:SocketPoint) : SocketPoint
|
||||
+ FindSocketsInRadius(worldPosition:Vector3, radius:float, onlyAvailable:bool) : List<SocketPoint>
|
||||
+ GetSocketsByType(type:SocketType) : List<SocketPoint>
|
||||
+ HighlightAllSockets(state:HighlightState) : void
|
||||
+ ClearAllHighlights() : void
|
||||
+ AddSocket(socket:SocketPoint) : void
|
||||
+ RemoveSocket(socket:SocketPoint) : void
|
||||
+ GetSocketCount() : int
|
||||
+ HasSockets() : bool
|
||||
+ GetCurrentSocketIndex() : int
|
||||
+ FindSocketsCompatibleWithJoint(jointBlock:JointBlock) : List<SocketPoint>
|
||||
}
|
||||
MonoBehaviour <|-- SocketContainer
|
||||
@enduml
|
||||
@@ -0,0 +1,15 @@
|
||||
@startuml
|
||||
class SocketIterator {
|
||||
- {static} instance : SocketIterator
|
||||
+ {static} getInstance() : SocketIterator
|
||||
- currentActiveContainer : SocketContainer
|
||||
- currentActiveSocket : SocketPoint
|
||||
- inputProvider : BaseInputProvider
|
||||
- Awake() : void
|
||||
- Start() : void
|
||||
+ SetActiveContainer(container:SocketContainer) : void
|
||||
+ GetCurrentActiveSocket() : SocketPoint
|
||||
+ ClearActiveContainer() : void
|
||||
}
|
||||
MonoBehaviour <|-- SocketIterator
|
||||
@enduml
|
||||
@@ -0,0 +1,44 @@
|
||||
@startuml
|
||||
class SocketPoint {
|
||||
- socketType : SocketType
|
||||
- socketRadius : float = 0.1f
|
||||
- socketNormal : Vector3
|
||||
- acceptableTypes : List<SocketType>
|
||||
- radiusTolerance : float = 0.05f
|
||||
- visualIndicator : GameObject
|
||||
- defaultColor : Color
|
||||
- activeColor : Color
|
||||
- compatibleColor : Color
|
||||
- incompatibleColor : Color
|
||||
- canHoldJoint : bool = false
|
||||
- occupyingObject : GameObject
|
||||
- isOccupied : bool = false
|
||||
- holdedJoint : GameObject
|
||||
- isJointOccupied : bool = false
|
||||
- CanAccept(otherSocket:ISocket) : bool
|
||||
+ CanAccept(otherSocket:ISocket, isJoint:bool) : bool
|
||||
+ GetNormal() : Vector3
|
||||
+ Highlight(state:HighlightState) : void
|
||||
- Update() : void
|
||||
+ GetTransform() : Transform
|
||||
+ GetSocketType() : SocketType
|
||||
+ GetSocketRadius() : float
|
||||
+ SetSocketRadius(radius:float) : void
|
||||
+ IsOccupied() : bool
|
||||
+ IsJointOccupied() : bool
|
||||
+ GetOccupyingObject() : GameObject
|
||||
+ GetJointObject() : GameObject
|
||||
+ SetOccupied(obj:GameObject) : void
|
||||
+ SetJointOccupied(jointObject:GameObject) : void
|
||||
+ ReleaseJoint() : void
|
||||
+ Release() : void
|
||||
}
|
||||
enum HighlightState {
|
||||
Default,
|
||||
Active,
|
||||
Compatible,
|
||||
Incompatible,
|
||||
}
|
||||
MonoBehaviour <|-- SocketPoint
|
||||
ISocket <|-- SocketPoint
|
||||
@enduml
|
||||
@@ -0,0 +1,11 @@
|
||||
@startuml
|
||||
class CategoryInherit {
|
||||
- UIPrefab : GameObject
|
||||
- UIParent : GameObject
|
||||
- currentCategory : CategoryData
|
||||
- blockDatas : List<BlockData>
|
||||
+ UpdateCategory(category:CategoryData) : void
|
||||
- DestroyBlocks() : void
|
||||
}
|
||||
MonoBehaviour <|-- CategoryInherit
|
||||
@enduml
|
||||
@@ -0,0 +1,9 @@
|
||||
@startuml
|
||||
class DropdownCategories {
|
||||
+ Categories : CategoryData[]
|
||||
- DropdownMenu : TMP_Dropdown
|
||||
- categoryInherit : CategoryInherit
|
||||
- Start() : void
|
||||
}
|
||||
MonoBehaviour <|-- DropdownCategories
|
||||
@enduml
|
||||
@@ -0,0 +1,6 @@
|
||||
@startuml
|
||||
interface IValidator {
|
||||
IsValidPlacement(objToPlace:GameObject) : bool
|
||||
SetLayerMask(cLayerMask:LayerMask) : void
|
||||
}
|
||||
@enduml
|
||||
@@ -0,0 +1,11 @@
|
||||
@startuml
|
||||
class PlacementValidator {
|
||||
- collisionLayerMask : LayerMask
|
||||
- toleranceSkin : float = 0.05f
|
||||
- ignoredColliders : List<Collider>
|
||||
+ SetLayerMask(cLayerMask:LayerMask) : void
|
||||
+ IsValidPlacement(objToPlace:GameObject) : bool
|
||||
}
|
||||
MonoBehaviour <|-- PlacementValidator
|
||||
IValidator <|-- PlacementValidator
|
||||
@enduml
|
||||
@@ -0,0 +1,24 @@
|
||||
@startuml
|
||||
class CanvasPlatformUI {
|
||||
- platformManager : CanvasVirtualPlatformManager
|
||||
- planeDropdown : TMP_Dropdown
|
||||
- canvasSizeSlider : Slider
|
||||
- minCanvasSize : float = 1000f
|
||||
- maxCanvasSize : float = 10000f
|
||||
- platformToggle : Toggle
|
||||
- gridToggle : Toggle
|
||||
- infoText : TextMeshProUGUI
|
||||
- Start() : void
|
||||
- SetupUI() : void
|
||||
- OnPlaneChanged(index:int) : void
|
||||
- OnCanvasSizeSliderChanged(value:float) : void
|
||||
- OnCanvasWidthChanged(value:string) : void
|
||||
- OnCanvasHeightChanged(value:string) : void
|
||||
- UpdateCanvasSizeFields() : void
|
||||
- OnPlatformToggleChanged(isOn:bool) : void
|
||||
- OnGridToggleChanged(isOn:bool) : void
|
||||
- UpdateInfoDisplay() : void
|
||||
- Update() : void
|
||||
}
|
||||
MonoBehaviour <|-- CanvasPlatformUI
|
||||
@enduml
|
||||
@@ -0,0 +1,39 @@
|
||||
@startuml
|
||||
enum PlaneAxis {
|
||||
XZ= 0,
|
||||
XY= 1,
|
||||
YZ= 2,
|
||||
}
|
||||
class VirtualPlane {
|
||||
+ planeAxis : PlaneAxis
|
||||
+ canvasGrid : GameObject
|
||||
+ colliderObject : GameObject
|
||||
}
|
||||
class CanvasVirtualPlatformManager {
|
||||
- {static} instance : CanvasVirtualPlatformManager
|
||||
- virtualPlanes : VirtualPlane[]
|
||||
- colliderThickness : float = 0.1f
|
||||
- colliderLayer : string = "World"
|
||||
- currentPlane : PlaneAxis
|
||||
- platformVisible : bool = true
|
||||
- Awake() : void
|
||||
+ {static} getInstance() : CanvasVirtualPlatformManager
|
||||
- Start() : void
|
||||
- GenerateColliders() : void
|
||||
- GetColliderRotation(axis:PlaneAxis) : Quaternion
|
||||
+ RegenerateColliders() : void
|
||||
+ SwitchToPlane(plane:PlaneAxis) : void
|
||||
+ TogglePlatformVisibility(visible:bool) : void
|
||||
- UpdatePlaneVisibility() : void
|
||||
+ ToggleGridVisibility(visible:bool) : void
|
||||
+ GetCurrentPlane() : PlaneAxis
|
||||
+ IsPlatformVisible() : bool
|
||||
+ GetCurrentCollider() : GameObject
|
||||
+ GetCurrentCanvas() : GameObject
|
||||
+ SetCanvasSize(planeAxis:PlaneAxis, width:float, height:float) : void
|
||||
+ SetCurrentCanvasSize(width:float, height:float) : void
|
||||
- RegenerateSingleCollider(plane:VirtualPlane) : void
|
||||
+ GetCurrentCanvasSize() : Vector2
|
||||
}
|
||||
MonoBehaviour <|-- CanvasVirtualPlatformManager
|
||||
@enduml
|
||||
@@ -0,0 +1,16 @@
|
||||
@startuml
|
||||
class PlatformUI {
|
||||
- platformManager : VirtualPlatformManager
|
||||
- xAxisButton : Button
|
||||
- yAxisButton : Button
|
||||
- zAxisButton : Button
|
||||
- moveUpButton : Button
|
||||
- moveDownButton : Button
|
||||
- moveStep : float = 1f
|
||||
- gridToggle : Toggle
|
||||
- Start() : void
|
||||
- SetupButtons() : void
|
||||
- Update() : void
|
||||
}
|
||||
MonoBehaviour <|-- PlatformUI
|
||||
@enduml
|
||||
@@ -0,0 +1,48 @@
|
||||
@startuml
|
||||
enum BuildAxis {
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
}
|
||||
class VirtualPlatformManager {
|
||||
- {static} instance : VirtualPlatformManager
|
||||
- platformThickness : float = 0.1f
|
||||
- showGrid : bool = true
|
||||
- gridSpacing : float = 1f
|
||||
- gridExtent : int = 50
|
||||
- lineWidth : float = 0.5f
|
||||
- gridColor : Color
|
||||
- gridMaterial : Material
|
||||
- currentAxis : BuildAxis
|
||||
- currentDistance : float = 0f
|
||||
- gridLines : List<LineRenderer>
|
||||
- currentPlatform : GameObject
|
||||
- gridVisual : GameObject
|
||||
- colliderObj : GameObject
|
||||
- platformCollider : BoxCollider
|
||||
- mainCamera : Camera
|
||||
- Awake() : void
|
||||
+ {static} getInstance() : VirtualPlatformManager
|
||||
- Start() : void
|
||||
- LateUpdate() : void
|
||||
- UpdateGridPosition() : void
|
||||
- UpdateColliderPosition() : void
|
||||
- UpdateGridLines(center:Vector3, axis1:Vector3, axis2:Vector3) : void
|
||||
+ SwitchToAxis(axis:BuildAxis) : void
|
||||
+ MovePlatform(delta:float) : void
|
||||
+ SetPlatformDistance(distance:float) : void
|
||||
- UpdatePlatformDistance() : void
|
||||
- RecreatePlatform() : void
|
||||
- CreatePlatform() : void
|
||||
- CreateGridVisual() : void
|
||||
- SetupPlatformTransform() : void
|
||||
- CreateLine(start:Vector3, end:Vector3) : LineRenderer
|
||||
- GetPlatformOrigin() : Vector3
|
||||
- GetPlatformAxes(axis1:Vector3, axis2:Vector3) : void
|
||||
+ ToggleGridVisibility(visible:bool) : void
|
||||
+ GetCurrentAxis() : BuildAxis
|
||||
+ GetCurrentDistance() : float
|
||||
+ GetPlatformPosition() : Vector3
|
||||
}
|
||||
MonoBehaviour <|-- VirtualPlatformManager
|
||||
@enduml
|
||||
@@ -0,0 +1,77 @@
|
||||
@startuml
|
||||
!include .\\BlocksLayer\Block.puml
|
||||
!include .\\BlocksLayer\BlockData.puml
|
||||
!include .\\BlocksLayer\BlockFactory.puml
|
||||
!include .\\BlocksLayer\CategoryData.puml
|
||||
!include .\\BlocksLayer\CodingBlock.puml
|
||||
!include .\\BlocksLayer\ElectricalBlock.puml
|
||||
!include .\\BlocksLayer\Environment.puml
|
||||
!include .\\BlocksLayer\MechanicalBlock.puml
|
||||
!include .\\BlocksLayer\MechanicalJoint.puml
|
||||
!include .\\Camera\CameraControl.puml
|
||||
!include .\\Camera\ViewCubeController.puml
|
||||
!include .\\CommandLayer\CommandDTO.puml
|
||||
!include .\\CommandLayer\CommandHandler.puml
|
||||
!include .\\CommandLayer\CommandManager.puml
|
||||
!include .\\InputSystem\BaseInputProvider.puml
|
||||
!include .\\InputSystem\InputModeManager.puml
|
||||
!include .\\InputSystem\InputProviderManager.puml
|
||||
!include .\\InputSystem\MobileInputProvider.puml
|
||||
!include .\\InputSystem\PCIntputProvider.puml
|
||||
!include .\\ModelCheckingSystem\BlockNode.puml
|
||||
!include .\\ModelCheckingSystem\BlocksGraph.puml
|
||||
!include .\\ModelCheckingSystem\BlocksMap.puml
|
||||
!include .\\ModelCheckingSystem\ModelCheckManager.puml
|
||||
!include .\\Movement Scripts\GizmoFMoveElement.puml
|
||||
!include .\\Movement Scripts\GizmoMoveElement.puml
|
||||
!include .\\Movement Scripts\GizmoRotateElement.puml
|
||||
!include .\\Movement Scripts\MultiSelectValidationCheck.puml
|
||||
!include .\\Movement Scripts\TransformManager.puml
|
||||
!include .\\SaveSystem\CommandSaveHandler.puml
|
||||
!include .\\SaveSystem\CommandSaveUtil.puml
|
||||
!include .\\SaveSystem\EnvironmentObserver.puml
|
||||
!include .\\Sockets\AttachableBlock.puml
|
||||
!include .\\Sockets\ISocket.puml
|
||||
!include .\\Sockets\JointBlock.puml
|
||||
!include .\\Sockets\JointPlacementHandler.puml
|
||||
!include .\\Sockets\SocketContainer.puml
|
||||
!include .\\Sockets\SocketIterator.puml
|
||||
!include .\\Sockets\SocketPoint.puml
|
||||
!include .\\UI\CategoryInherit.puml
|
||||
!include .\\UI\DropdownCategories.puml
|
||||
!include .\\Validators\IValidator.puml
|
||||
!include .\\Validators\PlacementValidator.puml
|
||||
!include .\\VirtualPlatform\CanvasPlatformUI.puml
|
||||
!include .\\VirtualPlatform\CanvasVirtualPlatformManager.puml
|
||||
!include .\\VirtualPlatform\PlatformUI.puml
|
||||
!include .\\VirtualPlatform\VirtualPlatformManager.puml
|
||||
!include .\\CommandLayer\Commands\CreateBlockCommand.puml
|
||||
!include .\\CommandLayer\Commands\DeleteBlockCommand.puml
|
||||
!include .\\CommandLayer\Commands\DeleteGroupCommand.puml
|
||||
!include .\\CommandLayer\Commands\ICommand.puml
|
||||
!include .\\CommandLayer\Commands\MoveBlockCommand.puml
|
||||
!include .\\CommandLayer\Commands\RotateBlockCommand.puml
|
||||
!include .\\InteractionLayer\Interactables\BaseInteractable.puml
|
||||
!include .\\InteractionLayer\Interactables\GrabInteractable.puml
|
||||
!include .\\InteractionLayer\Interactables\HoveredUI.puml
|
||||
!include .\\InteractionLayer\Interactables\IInteractable.puml
|
||||
!include .\\InteractionLayer\Interactables\UIInteractable.puml
|
||||
!include .\\InteractionLayer\Interactors\DeleteInteractor.puml
|
||||
!include .\\InteractionLayer\Interactors\RayInteractor.puml
|
||||
!include .\\InteractionLayer\Interactors\SnapSystem.puml
|
||||
!include .\\InteractionLayer\Interactors\TestCommandInteractor.puml
|
||||
!include .\\InteractionLayer\Managers\GhostManager.puml
|
||||
!include .\\InteractionLayer\Managers\InteractionManager.puml
|
||||
!include .\\InteractionLayer\Managers\SelectionManager.puml
|
||||
!include .\\InteractionLayer\Managers\SocketManagerChecker.puml
|
||||
!include .\\InteractionLayer\Managers\UIManager.puml
|
||||
!include .\\Sockets\ContainerInit\BlockContainerInit.puml
|
||||
!include .\\Sockets\ContainerInit\SimpleLinkContainerInit.puml
|
||||
!include .\\InteractionLayer\Managers\GhostExtensions\AxisMoveStrategy.puml
|
||||
!include .\\InteractionLayer\Managers\GhostExtensions\AxisRotateStrategy.puml
|
||||
!include .\\InteractionLayer\Managers\GhostExtensions\FreeMoveStrategy.puml
|
||||
!include .\\InteractionLayer\Managers\GhostExtensions\GhostMovementContext.puml
|
||||
!include .\\InteractionLayer\Managers\GhostExtensions\GhostStrategyHandler.puml
|
||||
!include .\\InteractionLayer\Managers\GhostExtensions\GhostStrategyTester.puml
|
||||
!include .\\InteractionLayer\Managers\GhostExtensions\IGhostMovementStrategy.puml
|
||||
@enduml
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
# Define macros (only works in top-level gitattributes files)
|
||||
[attr]lfs filter=lfs diff=lfs merge=lfs -text
|
||||
[attr]unity-json eol=lf linguist-language=json
|
||||
[attr]unity-yaml merge=unityyamlmerge eol=lf linguist-language=yaml
|
||||
|
||||
# Optionally collapse Unity YAML files on GitHub diffs
|
||||
# [attr]unity-yaml merge=unityyamlmerge text linguist-language=yaml linguist-generated
|
||||
|
||||
# Unity source files
|
||||
*.cginc text
|
||||
*.compute text linguist-language=hlsl
|
||||
*.cs text diff=csharp
|
||||
*.hlsl text linguist-language=hlsl
|
||||
*.raytrace text linguist-language=hlsl
|
||||
*.shader text
|
||||
|
||||
# Unity JSON files
|
||||
*.asmdef unity-json
|
||||
*.asmref unity-json
|
||||
*.index unity-json
|
||||
*.inputactions unity-json
|
||||
*.shadergraph unity-json
|
||||
*.shadersubgraph unity-json
|
||||
|
||||
# Unity UI Toolkit files
|
||||
*.tss text diff=css linguist-language=css
|
||||
*.uss text diff=css linguist-language=css
|
||||
*.uxml text linguist-language=xml linguist-detectable
|
||||
|
||||
# Unity YAML files
|
||||
*.anim unity-yaml
|
||||
*.asset unity-yaml
|
||||
*.brush unity-yaml
|
||||
*.controller unity-yaml
|
||||
*.flare unity-yaml
|
||||
*.fontsettings unity-yaml
|
||||
*.giparams unity-yaml
|
||||
*.guiskin unity-yaml
|
||||
*.lighting unity-yaml
|
||||
*.mask unity-yaml
|
||||
*.mat unity-yaml
|
||||
*.meta unity-yaml
|
||||
*.mixer unity-yaml
|
||||
*.overrideController unity-yaml
|
||||
*.playable unity-yaml
|
||||
*.prefab unity-yaml
|
||||
*.preset unity-yaml
|
||||
*.renderTexture unity-yaml
|
||||
*.scenetemplate unity-yaml
|
||||
*.shadervariants unity-yaml
|
||||
*.signal unity-yaml
|
||||
*.spriteatlas unity-yaml
|
||||
*.spriteatlasv2 unity-yaml
|
||||
*.terrainlayer unity-yaml
|
||||
*.unity unity-yaml
|
||||
|
||||
# "physic" for 3D but "physics" for 2D
|
||||
*.physicMaterial unity-yaml
|
||||
*.physicsMaterial2D unity-yaml
|
||||
|
||||
# Exclude from GitHub stats and diffs: third-party plugins, packages lock file
|
||||
Assets/Plugins/** linguist-generated
|
||||
Packages/packages-lock.json linguist-generated
|
||||
|
||||
# Unity LFS
|
||||
*.cubemap lfs
|
||||
*.unitypackage lfs
|
||||
|
||||
# 3D models
|
||||
*.3dm lfs
|
||||
*.3ds lfs
|
||||
*.blend lfs
|
||||
*.blend1 lfs
|
||||
*.c4d lfs
|
||||
*.collada lfs
|
||||
*.dae lfs
|
||||
*.dxf lfs
|
||||
*.FBX lfs
|
||||
*.fbx lfs
|
||||
*.jas lfs
|
||||
*.lws lfs
|
||||
*.lxo lfs
|
||||
*.ma lfs
|
||||
*.max lfs
|
||||
*.mb lfs
|
||||
*.obj lfs
|
||||
*.ply lfs
|
||||
*.skp lfs
|
||||
*.stl lfs
|
||||
*.ztl lfs
|
||||
|
||||
# Audio
|
||||
*.aif lfs
|
||||
*.aiff lfs
|
||||
*.it lfs
|
||||
*.mod lfs
|
||||
*.mp3 lfs
|
||||
*.ogg lfs
|
||||
*.s3m lfs
|
||||
*.wav lfs
|
||||
*.xm lfs
|
||||
|
||||
# Video
|
||||
*.asf lfs
|
||||
*.avi lfs
|
||||
*.flv lfs
|
||||
*.mov lfs
|
||||
*.mp4 lfs
|
||||
*.mpeg lfs
|
||||
*.mpg lfs
|
||||
*.ogv lfs
|
||||
*.wmv lfs
|
||||
|
||||
# Images
|
||||
*.bmp lfs
|
||||
*.exr lfs
|
||||
*.gif lfs
|
||||
*.hdr lfs
|
||||
*.iff lfs
|
||||
*.jpeg lfs
|
||||
*.jpg lfs
|
||||
*.pict lfs
|
||||
*.png lfs
|
||||
*.psd lfs
|
||||
*.tga lfs
|
||||
*.tif lfs
|
||||
*.tiff lfs
|
||||
*.webp lfs
|
||||
|
||||
# Compressed Archive
|
||||
*.7z lfs
|
||||
*.bz2 lfs
|
||||
*.gz lfs
|
||||
*.rar lfs
|
||||
*.tar lfs
|
||||
*.zip lfs
|
||||
|
||||
# Compiled Dynamic Library
|
||||
*.dll lfs
|
||||
*.pdb lfs
|
||||
*.so lfs
|
||||
|
||||
# Fonts
|
||||
*.otf lfs
|
||||
*.ttf lfs
|
||||
|
||||
# Executable/Installer
|
||||
*.apk lfs
|
||||
*.exe lfs
|
||||
|
||||
# Documents
|
||||
*.pdf lfs
|
||||
|
||||
# ETC
|
||||
*.a lfs
|
||||
*.reason lfs
|
||||
*.rns lfs
|
||||
|
||||
# Spine export file for Unity
|
||||
*.skel.bytes lfs
|
||||
|
||||
# Exceptions for .asset files such as lightning pre-baking
|
||||
LightingData.asset binary
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
# ---> Unity
|
||||
# This .gitignore file should be placed at the root of your Unity project directory
|
||||
#
|
||||
# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore
|
||||
#
|
||||
/[Ll]ibrary/
|
||||
/[Tt]emp/
|
||||
/[Oo]bj/
|
||||
/[Bb]uild/
|
||||
/[Bb]uilds/
|
||||
/[Ll]ogs/
|
||||
/[Uu]ser[Ss]ettings/
|
||||
|
||||
# MemoryCaptures can get excessive in size.
|
||||
# They also could contain extremely sensitive data
|
||||
/[Mm]emoryCaptures/
|
||||
|
||||
# Recordings can get excessive in size
|
||||
/[Rr]ecordings/
|
||||
|
||||
# Uncomment this line if you wish to ignore the asset store tools plugin
|
||||
# /[Aa]ssets/AssetStoreTools*
|
||||
|
||||
# Autogenerated Jetbrains Rider plugin
|
||||
/[Aa]ssets/Plugins/Editor/JetBrains*
|
||||
|
||||
# Visual Studio cache directory
|
||||
.vs/
|
||||
|
||||
# Gradle cache directory
|
||||
.gradle/
|
||||
|
||||
# Autogenerated VS/MD/Consulo solution and project files
|
||||
ExportedObj/
|
||||
.consulo/
|
||||
*.csproj
|
||||
*.unityproj
|
||||
*.sln
|
||||
*.suo
|
||||
*.tmp
|
||||
*.user
|
||||
*.userprefs
|
||||
*.pidb
|
||||
*.booproj
|
||||
*.svd
|
||||
*.pdb
|
||||
*.mdb
|
||||
*.opendb
|
||||
*.VC.db
|
||||
|
||||
# Unity3D generated meta files
|
||||
*.pidb.meta
|
||||
*.pdb.meta
|
||||
*.mdb.meta
|
||||
|
||||
# Unity3D generated file on crash reports
|
||||
sysinfo.txt
|
||||
|
||||
# Builds
|
||||
*.apk
|
||||
*.aab
|
||||
*.unitypackage
|
||||
*.unitypackage.meta
|
||||
*.app
|
||||
|
||||
# Crashlytics generated file
|
||||
crashlytics-build.properties
|
||||
|
||||
# Packed Addressables
|
||||
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
|
||||
|
||||
# Temporary auto-generated Android Assets
|
||||
/[Aa]ssets/[Ss]treamingAssets/aa.meta
|
||||
/[Aa]ssets/[Ss]treamingAssets/aa/*
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"version": "1.0",
|
||||
"components": [
|
||||
"Microsoft.VisualStudio.Workload.ManagedGame"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e8a8485b4f5f934585cd8c7d95bea64
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,28 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ca089a66a5f23da42b228c8b6299a9d5, type: 3}
|
||||
m_Name: CurrentBlocksMap
|
||||
m_EditorClassIdentifier:
|
||||
allNodes:
|
||||
- blockData: {fileID: 11400000, guid: 2c3bcf71f1e39b74f9c7b0f2cfb63282, type: 2}
|
||||
position: {x: -0.84, y: 0.1, z: -0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
- blockData: {fileID: 11400000, guid: da7213f08293477469e917a1983ebe26, type: 2}
|
||||
position: {x: -0.07, y: 0.48, z: 2.33}
|
||||
rotation: {x: 0, y: 0.70710677, z: 0, w: 0.70710677}
|
||||
- blockData: {fileID: 11400000, guid: da7213f08293477469e917a1983ebe26, type: 2}
|
||||
position: {x: -0.07, y: 0.48, z: -2.28}
|
||||
rotation: {x: 0, y: 0.70710677, z: 0, w: 0.70710677}
|
||||
rootNode:
|
||||
blockData: {fileID: 11400000, guid: 2c3bcf71f1e39b74f9c7b0f2cfb63282, type: 2}
|
||||
position: {x: -0.84, y: 0.1, z: -0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f40c8ab03535f04f967341d932f0c32
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,28 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: ca089a66a5f23da42b228c8b6299a9d5, type: 3}
|
||||
m_Name: NewBlocksMap
|
||||
m_EditorClassIdentifier:
|
||||
allNodes:
|
||||
- blockData: {fileID: 11400000, guid: 2c3bcf71f1e39b74f9c7b0f2cfb63282, type: 2}
|
||||
position: {x: -0.84, y: 0.1, z: -0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
- blockData: {fileID: 11400000, guid: da7213f08293477469e917a1983ebe26, type: 2}
|
||||
position: {x: -0.07, y: 0.48, z: 2.33}
|
||||
rotation: {x: 0, y: 0.70710677, z: 0, w: 0.70710677}
|
||||
- blockData: {fileID: 11400000, guid: da7213f08293477469e917a1983ebe26, type: 2}
|
||||
position: {x: -0.07, y: 0.48, z: -2.28}
|
||||
rotation: {x: 0, y: 0.70710677, z: 0, w: 0.70710677}
|
||||
rootNode:
|
||||
blockData: {fileID: 11400000, guid: 2c3bcf71f1e39b74f9c7b0f2cfb63282, type: 2}
|
||||
position: {x: -0.84, y: 0.1, z: -0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ced5d277e1d43c40ba60c28dddde902
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 317585e2de1c4e945958203a05bc9c80
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fde3d897c3a1bc245826eb76644d5ac5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
-----------------------
|
||||
| DESCRIPTION |
|
||||
-----------------------
|
||||
CGHierarchyIcons is a simple package used to show an icon at the right or left of GameObjects in the HierarchyView.
|
||||
|
||||
It is composed of a simple script that is added to GameObjects and through an editor script you can select the icon and add an optional tooltip.
|
||||
You can select as icon all the textures Unity can reference, including yours in the ProjectView.
|
||||
|
||||
-----------------------
|
||||
| NOTES |
|
||||
-----------------------
|
||||
- The properties of the HierarchyIcon script are only compiled in the Unity Editor.
|
||||
- After you build your project, all instances of the HierarchyIcon attached to game objects are destroyed from the scenes since they are useless on build.
|
||||
|
||||
-----------------------
|
||||
| LINKS |
|
||||
-----------------------
|
||||
- How to Use: https://youtu.be/mjXW5EIvO6U
|
||||
- Unity Forum Thread: https://forum.unity.com/threads/released-free-hierarchy-icon.521145/
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e572d0beafbbc114d95c10afc11057ec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7812f55d89e530c4abba636cdfae8e03
|
||||
folderAsset: yes
|
||||
timeCreated: 1518156898
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86c83c65fcdbfc144893224d7677edba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace CGHierarchyIconsEditor
|
||||
{
|
||||
internal static class TextureHelper
|
||||
{
|
||||
public static readonly Texture2D NO_ICON = Load(NoIconBytes);
|
||||
public static readonly Texture2D BUTTON_ON = Load(ButtonOnBytes);
|
||||
public static readonly Texture2D CLEAR_SEARCH = Load(ClearSearchBytes);
|
||||
public static readonly Texture2D REMOVE_ICON = Load(RemoveIconBytes);
|
||||
|
||||
static Texture2D Load(byte[] bytes)
|
||||
{
|
||||
Texture2D texture = new Texture2D(1, 1, TextureFormat.ARGB32, false);
|
||||
texture.hideFlags = HideFlags.HideAndDontSave;
|
||||
texture.LoadImage(bytes, true);
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
#region TEXTURE BYTES
|
||||
|
||||
static byte[] ButtonOnBytes
|
||||
{
|
||||
get { return new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 2, 0, 0, 0, 2, 8, 2, 0, 0, 0, 253, 212, 154, 115, 0, 0, 0, 19, 73, 68, 65, 84, 8, 29, 99, 180, 171, 125, 206, 192, 192, 192, 4, 196, 64, 0, 0, 19, 25, 1, 166, 188, 203, 191, 138, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130}; }
|
||||
}
|
||||
|
||||
static byte[] NoIconBytes
|
||||
{
|
||||
get { return new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 2, 24, 73, 68, 65, 84, 56, 17, 133, 147, 93, 104, 141, 97, 28, 192, 127, 59, 239, 206, 216, 230, 107, 67, 171, 83, 139, 19, 133, 104, 156, 181, 220, 156, 88, 67, 169, 133, 41, 69, 73, 228, 163, 220, 184, 65, 41, 110, 92, 184, 90, 114, 225, 198, 40, 23, 148, 90, 185, 83, 106, 74, 145, 152, 175, 204, 87, 81, 83, 98, 109, 62, 98, 148, 89, 107, 200, 248, 61, 239, 57, 111, 142, 83, 242, 175, 223, 251, 127, 190, 254, 159, 207, 251, 84, 164, 248, 91, 158, 57, 221, 47, 159, 229, 158, 44, 149, 211, 50, 93, 206, 75, 185, 148, 219, 151, 239, 255, 119, 94, 238, 160, 66, 139, 195, 178, 76, 170, 101, 159, 76, 147, 127, 74, 106, 194, 173, 18, 42, 127, 193, 150, 163, 112, 112, 6, 212, 189, 133, 181, 153, 130, 163, 70, 143, 181, 74, 85, 185, 167, 40, 114, 37, 164, 81, 164, 122, 29, 228, 179, 208, 92, 239, 225, 73, 80, 27, 106, 159, 11, 7, 174, 65, 102, 141, 14, 247, 66, 207, 93, 215, 18, 82, 33, 231, 18, 194, 124, 228, 24, 156, 92, 13, 187, 103, 195, 156, 22, 200, 217, 204, 190, 46, 56, 158, 134, 38, 143, 155, 220, 31, 41, 239, 65, 40, 56, 186, 9, 87, 59, 225, 220, 84, 152, 117, 65, 227, 121, 176, 224, 132, 151, 243, 18, 94, 252, 128, 49, 33, 1, 83, 142, 41, 102, 81, 101, 161, 57, 13, 107, 38, 67, 125, 155, 117, 215, 216, 196, 44, 180, 180, 67, 71, 4, 13, 66, 41, 149, 73, 50, 122, 15, 142, 190, 171, 30, 21, 215, 198, 212, 55, 138, 227, 7, 234, 0, 71, 36, 116, 242, 74, 152, 40, 137, 3, 131, 50, 83, 222, 172, 52, 187, 14, 7, 193, 58, 72, 200, 112, 68, 174, 203, 99, 185, 40, 165, 146, 10, 145, 37, 99, 147, 242, 227, 133, 43, 179, 249, 44, 18, 171, 136, 3, 216, 130, 56, 104, 168, 50, 4, 108, 144, 240, 143, 196, 18, 45, 86, 213, 106, 176, 81, 7, 195, 48, 124, 8, 78, 121, 178, 117, 20, 62, 230, 97, 207, 79, 104, 247, 38, 150, 27, 253, 235, 54, 232, 90, 8, 155, 27, 97, 73, 15, 60, 213, 116, 52, 21, 92, 73, 109, 157, 77, 91, 5, 27, 94, 65, 90, 7, 155, 238, 23, 116, 243, 86, 216, 101, 9, 243, 219, 96, 125, 175, 149, 237, 128, 51, 154, 52, 77, 209, 137, 144, 74, 126, 34, 179, 72, 223, 134, 39, 94, 114, 88, 218, 185, 194, 102, 235, 104, 252, 44, 108, 247, 167, 138, 250, 225, 189, 27, 175, 63, 65, 191, 181, 77, 56, 142, 194, 193, 232, 155, 159, 15, 54, 110, 0, 134, 46, 67, 111, 31, 12, 104, 144, 187, 228, 184, 27, 238, 100, 125, 144, 157, 208, 125, 203, 199, 233, 185, 119, 190, 214, 161, 65, 24, 124, 8, 207, 157, 127, 209, 60, 150, 228, 106, 13, 26, 95, 115, 120, 64, 161, 97, 33, 72, 156, 169, 58, 217, 11, 103, 195, 94, 208, 252, 6, 80, 219, 116, 25, 64, 124, 234, 141, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130}; }
|
||||
}
|
||||
|
||||
static byte[] ClearSearchBytes
|
||||
{
|
||||
get { return new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 13, 0, 0, 0, 13, 8, 6, 0, 0, 0, 114, 235, 228, 124, 0, 0, 1, 47, 73, 68, 65, 84, 40, 21, 117, 82, 65, 106, 131, 80, 16, 213, 6, 68, 76, 64, 107, 19, 8, 93, 202, 63, 64, 54, 122, 0, 169, 123, 215, 61, 64, 47, 208, 43, 148, 120, 6, 247, 186, 17, 247, 133, 8, 57, 129, 71, 8, 89, 184, 10, 72, 136, 171, 46, 74, 193, 190, 247, 243, 5, 73, 226, 192, 115, 254, 188, 121, 51, 127, 230, 163, 174, 93, 77, 192, 61, 3, 142, 138, 31, 185, 14, 228, 5, 56, 60, 225, 35, 194, 48, 124, 45, 138, 66, 239, 251, 190, 157, 2, 243, 212, 81, 15, 104, 62, 136, 0, 226, 197, 64, 224, 172, 13, 160, 0, 38, 152, 167, 14, 103, 159, 68, 4, 98, 3, 239, 218, 182, 189, 133, 103, 98, 108, 129, 226, 93, 165, 139, 56, 158, 52, 16, 63, 101, 89, 238, 45, 203, 250, 2, 49, 20, 6, 140, 201, 51, 175, 164, 210, 201, 155, 64, 114, 36, 179, 174, 235, 119, 8, 119, 44, 164, 103, 76, 94, 229, 57, 81, 196, 170, 113, 145, 44, 76, 146, 228, 147, 5, 244, 163, 2, 230, 238, 139, 216, 1, 38, 88, 144, 231, 249, 135, 186, 81, 190, 214, 195, 155, 174, 122, 77, 24, 134, 241, 173, 70, 178, 233, 25, 179, 17, 243, 119, 55, 129, 147, 175, 119, 179, 131, 220, 241, 246, 245, 216, 192, 207, 178, 204, 71, 151, 85, 85, 85, 111, 240, 195, 210, 236, 44, 119, 84, 252, 138, 58, 234, 103, 248, 152, 109, 219, 46, 49, 198, 60, 142, 227, 95, 196, 252, 157, 214, 35, 44, 61, 207, 251, 195, 142, 78, 154, 166, 86, 211, 52, 39, 29, 73, 154, 7, 188, 0, 14, 131, 9, 235, 192, 159, 129, 227, 63, 69, 197, 241, 197, 126, 216, 78, 194, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130}; }
|
||||
}
|
||||
|
||||
static byte[] RemoveIconBytes
|
||||
{
|
||||
get { return new byte[] {137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 9, 0, 0, 0, 9, 8, 6, 0, 0, 0, 224, 145, 6, 16, 0, 0, 0, 111, 73, 68, 65, 84, 24, 25, 93, 143, 209, 13, 128, 48, 8, 68, 169, 113, 60, 117, 11, 117, 36, 63, 220, 162, 14, 229, 26, 189, 87, 133, 52, 92, 114, 133, 192, 11, 208, 114, 153, 85, 51, 187, 229, 71, 206, 90, 85, 168, 179, 158, 141, 228, 239, 142, 96, 7, 84, 47, 64, 40, 131, 1, 208, 116, 40, 131, 76, 46, 20, 209, 244, 133, 120, 185, 13, 224, 140, 138, 146, 17, 98, 197, 46, 51, 97, 145, 15, 185, 203, 33, 7, 184, 13, 17, 3, 228, 166, 12, 0, 33, 255, 204, 11, 196, 10, 159, 64, 115, 84, 7, 27, 132, 23, 20, 126, 163, 174, 246, 6, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130}; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3aaac47a537340843a1d85cf4774c7dd
|
||||
timeCreated: 1519027026
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "HierarchyIconsEditor",
|
||||
"references": [
|
||||
"HierarchyIcons"
|
||||
],
|
||||
"optionalUnityReferences": [],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: effacf331d64ef64c83f1b4e2312f212
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc907af72a34a6741809816222a956fa
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,113 @@
|
||||
using HierarchyIcons;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace CGHierarchyIconsEditor
|
||||
{
|
||||
[CanEditMultipleObjects]
|
||||
[CustomEditor(typeof(HierarchyIcon))]
|
||||
public class HierarchyIconEditor : Editor
|
||||
{
|
||||
SerializedProperty m_iconProperty;
|
||||
SerializedProperty m_tooltipProperty;
|
||||
SerializedProperty m_positionProperty;
|
||||
SerializedProperty m_directionProperty;
|
||||
HierarchyIcon m_hierarchyIcon;
|
||||
|
||||
const float ICON_BUTTON_SIZE = 28;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
m_iconProperty = serializedObject.FindProperty("icon");
|
||||
m_tooltipProperty = serializedObject.FindProperty("tooltip");
|
||||
m_positionProperty = serializedObject.FindProperty("position");
|
||||
m_directionProperty = serializedObject.FindProperty("direction");
|
||||
m_hierarchyIcon = target as HierarchyIcon;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
#region DRAW SCRIPT HEADER
|
||||
|
||||
GUI.enabled = false;
|
||||
|
||||
DrawPropertiesExcluding(
|
||||
serializedObject,
|
||||
m_iconProperty.name,
|
||||
m_tooltipProperty.name,
|
||||
m_positionProperty.name,
|
||||
m_directionProperty.name
|
||||
);
|
||||
|
||||
GUI.enabled = true;
|
||||
|
||||
#endregion
|
||||
|
||||
// Update the serializedProperty - always do this in the beginning of OnInspectorGUI.
|
||||
serializedObject.Update();
|
||||
|
||||
#region PICK ICON BUTTON
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.PrefixLabel("Icon");
|
||||
Rect btnRect = EditorGUILayout.GetControlRect(GUILayout.Width(ICON_BUTTON_SIZE), GUILayout.Height(ICON_BUTTON_SIZE));
|
||||
GUIContent btnContent = new GUIContent();
|
||||
|
||||
// if selected multiple game objects show a _ character
|
||||
if (m_iconProperty.hasMultipleDifferentValues)
|
||||
{
|
||||
btnContent.text = "_";
|
||||
btnContent.tooltip = "Different values on selection";
|
||||
}
|
||||
else
|
||||
{
|
||||
// show the selected icon
|
||||
btnContent.image = m_hierarchyIcon.icon;
|
||||
}
|
||||
|
||||
if (GUI.Button(btnRect, btnContent))
|
||||
PopupWindow.Show(btnRect, new PickIconWindow(m_iconProperty));
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
#endregion
|
||||
|
||||
#region POSITION
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(m_positionProperty);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
// repaint the hierarchy
|
||||
EditorApplication.RepaintHierarchyWindow();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DIRECTION
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(m_directionProperty);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
// repaint the hierarchy
|
||||
EditorApplication.RepaintHierarchyWindow();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TOOLTIP
|
||||
|
||||
EditorGUILayout.PropertyField(m_tooltipProperty);
|
||||
|
||||
#endregion
|
||||
|
||||
// Apply changes to the serializedProperty - always do this in the end of OnInspectorGUI.
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
// space at the bottom
|
||||
GUILayout.Space(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0f001d5f6bf9374fb393d140eef3727
|
||||
timeCreated: 1519023853
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef1be50a405732a42b3a48997126cd0b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HierarchyIcons;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
// https://forum.unity.com/threads/excluding-certain-monobehaviour-classes-from-build.568090/#post-3779695
|
||||
public class DestroyInstancesOnBuild : MonoBehaviour
|
||||
{
|
||||
[PostProcessScene]
|
||||
public static void DeleteObjects()
|
||||
{
|
||||
if (BuildPipeline.isBuildingPlayer)
|
||||
{
|
||||
Type type = typeof(HierarchyIcon);
|
||||
Debug.Log("Destroying all instances of '" + type.Name + "' from scenes on build!");
|
||||
|
||||
foreach (Component obj in FindObjectsOfTypeAll(type, true))
|
||||
DestroyImmediate(obj);
|
||||
}
|
||||
}
|
||||
|
||||
static List<Component> FindObjectsOfTypeAll(Type type, bool findInactive = false)
|
||||
{
|
||||
List<Component> results = new List<Component>();
|
||||
for (int i = 0; i < SceneManager.sceneCount; i++)
|
||||
{
|
||||
Scene scene = SceneManager.GetSceneAt(i);
|
||||
if (scene.isLoaded)
|
||||
{
|
||||
GameObject[] allGameObjects = scene.GetRootGameObjects();
|
||||
for (int j = 0; j < allGameObjects.Length; j++)
|
||||
{
|
||||
GameObject go = allGameObjects[j];
|
||||
results.AddRange(go.GetComponentsInChildren(type, findInactive));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e80715f9811a6ab449fc1b6403f5bf27
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user