| | 1 | | using System; |
| | 2 | | using DCL.Configuration; |
| | 3 | | using UnityEngine; |
| | 4 | | using UnityEngine.EventSystems; |
| | 5 | | using UnityEngine.UI; |
| | 6 | |
|
| | 7 | | public interface ITopActionsButtonsView |
| | 8 | | { |
| | 9 | | event Action OnChangeModeClicked, |
| | 10 | | OnExtraClicked, |
| | 11 | | OnTranslateClicked, |
| | 12 | | OnRotateClicked, |
| | 13 | | OnScaleClicked, |
| | 14 | | OnUndoClicked, |
| | 15 | | OnRedoClicked, |
| | 16 | | OnDuplicateClicked, |
| | 17 | | OnDeleteClicked, |
| | 18 | | OnLogOutClicked, |
| | 19 | | OnSnapModeClicked, |
| | 20 | | OnPointerExit; |
| | 21 | |
|
| | 22 | | event Action<BaseEventData, string> OnChangeCameraModePointerEnter, |
| | 23 | | OnTranslatePointerEnter, |
| | 24 | | OnRotatePointerEnter, |
| | 25 | | OnScalePointerEnter, |
| | 26 | | OnUndoPointerEnter, |
| | 27 | | OnRedoPointerEnter, |
| | 28 | | OnDuplicatePointerEnter, |
| | 29 | | OnDeletePointerEnter, |
| | 30 | | OnMoreActionsPointerEnter, |
| | 31 | | OnLogoutPointerEnter, |
| | 32 | | OnSnapModePointerEnter; |
| | 33 | |
|
| | 34 | | void ConfigureExtraActions(IExtraActionsController extraActionsController); |
| | 35 | | void OnChangeModeClick(DCLAction_Trigger action); |
| | 36 | | void OnDeleteClick(DCLAction_Trigger action); |
| | 37 | | void OnDuplicateClick(DCLAction_Trigger action); |
| | 38 | | void OnExtraClick(DCLAction_Trigger action); |
| | 39 | | void OnLogOutClick(DCLAction_Trigger action); |
| | 40 | | void OnRotateClick(DCLAction_Trigger action); |
| | 41 | | void OnScaleClick(DCLAction_Trigger action); |
| | 42 | | void OnTranslateClick(DCLAction_Trigger action); |
| | 43 | | void SetGizmosActive(string gizmos); |
| | 44 | | void SetActionsInteractable(bool isActive); |
| | 45 | | void SetUndoInteractable(bool isActive); |
| | 46 | | void SetRedoInteractable(bool isActive); |
| | 47 | | void SetSnapActive(bool isActive); |
| | 48 | | } |
| | 49 | |
|
| | 50 | | public class TopActionsButtonsView : MonoBehaviour, ITopActionsButtonsView |
| | 51 | | { |
| | 52 | | public event Action OnChangeModeClicked, |
| | 53 | | OnExtraClicked, |
| | 54 | | OnTranslateClicked, |
| | 55 | | OnRotateClicked, |
| | 56 | | OnScaleClicked, |
| | 57 | | OnUndoClicked, |
| | 58 | | OnRedoClicked, |
| | 59 | | OnDuplicateClicked, |
| | 60 | | OnDeleteClicked, |
| | 61 | | OnLogOutClicked, |
| | 62 | | OnSnapModeClicked, |
| | 63 | | OnPointerExit; |
| | 64 | |
|
| | 65 | | public event Action<BaseEventData, string> OnChangeCameraModePointerEnter, |
| | 66 | | OnTranslatePointerEnter, |
| | 67 | | OnRotatePointerEnter, |
| | 68 | | OnScalePointerEnter, |
| | 69 | | OnUndoPointerEnter, |
| | 70 | | OnRedoPointerEnter, |
| | 71 | | OnDuplicatePointerEnter, |
| | 72 | | OnDeletePointerEnter, |
| | 73 | | OnMoreActionsPointerEnter, |
| | 74 | | OnLogoutPointerEnter, |
| | 75 | | OnSnapModePointerEnter; |
| | 76 | |
|
| | 77 | | [Header("Buttons")] |
| | 78 | | [SerializeField] internal Button changeModeBtn; |
| | 79 | |
|
| | 80 | | [SerializeField] internal Button extraBtn; |
| | 81 | | [SerializeField] internal Button translateBtn; |
| | 82 | | [SerializeField] internal Button rotateBtn; |
| | 83 | | [SerializeField] internal Button scaleBtn; |
| | 84 | | [SerializeField] internal Button undoBtn; |
| | 85 | | [SerializeField] internal Button redoBtn; |
| | 86 | | [SerializeField] internal Button duplicateBtn; |
| | 87 | | [SerializeField] internal Button deleteBtn; |
| | 88 | | [SerializeField] internal Button logOutBtn; |
| | 89 | | [SerializeField] internal Button snapModeBtn; |
| | 90 | |
|
| | 91 | | [Header("Input Actions")] |
| | 92 | | [SerializeField] internal InputAction_Trigger toggleChangeCameraInputAction; |
| | 93 | |
|
| | 94 | | [SerializeField] internal InputAction_Trigger toggleTranslateInputAction; |
| | 95 | | [SerializeField] internal InputAction_Trigger toggleRotateInputAction; |
| | 96 | | [SerializeField] internal InputAction_Trigger toggleScaleInputAction; |
| | 97 | | [SerializeField] internal InputAction_Trigger toggleDuplicateInputAction; |
| | 98 | | [SerializeField] internal InputAction_Trigger toggleDeleteInputAction; |
| | 99 | |
|
| | 100 | | [Header("Event Triggers")] |
| | 101 | | [SerializeField] internal EventTrigger changeCameraModeEventTrigger; |
| | 102 | |
|
| | 103 | | [SerializeField] internal EventTrigger translateEventTrigger; |
| | 104 | | [SerializeField] internal EventTrigger rotateEventTrigger; |
| | 105 | | [SerializeField] internal EventTrigger scaleEventTrigger; |
| | 106 | | [SerializeField] internal EventTrigger undoEventTrigger; |
| | 107 | | [SerializeField] internal EventTrigger redoEventTrigger; |
| | 108 | | [SerializeField] internal EventTrigger duplicateEventTrigger; |
| | 109 | | [SerializeField] internal EventTrigger deleteEventTrigger; |
| | 110 | | [SerializeField] internal EventTrigger moreActionsEventTrigger; |
| | 111 | | [SerializeField] internal EventTrigger logoutEventTrigger; |
| | 112 | | [SerializeField] internal EventTrigger snapModeEventTrigger; |
| | 113 | |
|
| | 114 | | [Header("Tooltip Texts")] |
| 40 | 115 | | [SerializeField] internal string changeCameraModeTooltipText = "Change Camera (V)"; |
| | 116 | |
|
| 40 | 117 | | [SerializeField] internal string translateTooltipText = "Translate (M)"; |
| 40 | 118 | | [SerializeField] internal string rotateTooltipText = "Rotate (R)"; |
| 40 | 119 | | [SerializeField] internal string scaleTooltipText = "Scale (G)"; |
| 40 | 120 | | [SerializeField] internal string undoTooltipText = "Undo (Shift+Z)"; |
| 40 | 121 | | [SerializeField] internal string redoTooltipText = "Redo (Shift+Y)"; |
| 40 | 122 | | [SerializeField] internal string duplicateTooltipText = "Duplicate (Shift+D)"; |
| 40 | 123 | | [SerializeField] internal string deleteTooltipText = "Delete (Del) or (Backspace)"; |
| 40 | 124 | | [SerializeField] internal string moreActionsTooltipText = "Extra Actions"; |
| 40 | 125 | | [SerializeField] internal string logoutTooltipText = "Exit from edition"; |
| 40 | 126 | | [SerializeField] internal string snapModeTooltipText = "Toggle Snapping (O)"; |
| | 127 | |
|
| | 128 | | [Header("Sub-Views")] |
| | 129 | | [SerializeField] internal ExtraActionsView extraActionsView; |
| | 130 | |
|
| | 131 | | [Header("Images")] |
| | 132 | | [SerializeField] internal Image translateGizmosBtnImg; |
| | 133 | |
|
| | 134 | | [SerializeField] internal Image rotateGizmosBtnImg; |
| | 135 | | [SerializeField] internal Image scaleGizmosBtnImg; |
| | 136 | | [SerializeField] internal Image snapModeBtnImg; |
| | 137 | |
|
| | 138 | | [Header("Colors")] |
| | 139 | | [SerializeField] internal Color normalBtnImgColor; |
| | 140 | |
|
| | 141 | | [SerializeField] internal Color selectedBtnImgColor; |
| | 142 | |
|
| | 143 | | private DCLAction_Trigger dummyActionTrigger = new DCLAction_Trigger(); |
| | 144 | | internal IExtraActionsController extraActionsController; |
| | 145 | |
|
| | 146 | | private const string VIEW_PATH = "GodMode/TopActionsButtons/TopActionsButtonsView"; |
| | 147 | |
|
| | 148 | | internal static TopActionsButtonsView Create() |
| | 149 | | { |
| 19 | 150 | | var view = Instantiate(Resources.Load<GameObject>(VIEW_PATH)).GetComponent<TopActionsButtonsView>(); |
| 19 | 151 | | view.gameObject.name = "_TopActionsButtonsView"; |
| | 152 | |
|
| 19 | 153 | | return view; |
| | 154 | | } |
| | 155 | |
|
| | 156 | | private void Awake() |
| | 157 | | { |
| 38 | 158 | | changeModeBtn.onClick.AddListener(() => OnChangeModeClick(dummyActionTrigger)); |
| 38 | 159 | | translateBtn.onClick.AddListener(() => OnTranslateClick(dummyActionTrigger)); |
| 38 | 160 | | rotateBtn.onClick.AddListener(() => OnRotateClick(dummyActionTrigger)); |
| 38 | 161 | | scaleBtn.onClick.AddListener(() => OnScaleClick(dummyActionTrigger)); |
| 38 | 162 | | undoBtn.onClick.AddListener(OnUndoClick); |
| 38 | 163 | | redoBtn.onClick.AddListener(OnRedoClick); |
| 38 | 164 | | duplicateBtn.onClick.AddListener(() => OnDuplicateClick(dummyActionTrigger)); |
| 38 | 165 | | deleteBtn.onClick.AddListener(() => OnDeleteClick(dummyActionTrigger)); |
| 38 | 166 | | logOutBtn.onClick.AddListener(() => OnLogOutClick(dummyActionTrigger)); |
| 38 | 167 | | extraBtn.onClick.AddListener(() => OnExtraClick(dummyActionTrigger)); |
| 38 | 168 | | snapModeBtn.onClick.AddListener(() => OnSnapModeClick(dummyActionTrigger)); |
| | 169 | |
|
| 38 | 170 | | BIWUtils.ConfigureEventTrigger( |
| | 171 | | changeCameraModeEventTrigger, |
| | 172 | | EventTriggerType.PointerEnter, |
| 0 | 173 | | (eventData) => OnChangeCameraModePointerEnter?.Invoke(eventData, changeCameraModeTooltipText)); |
| | 174 | |
|
| 38 | 175 | | BIWUtils.ConfigureEventTrigger( |
| | 176 | | changeCameraModeEventTrigger, |
| | 177 | | EventTriggerType.PointerExit, |
| 0 | 178 | | (eventData) => OnPointerExit?.Invoke()); |
| | 179 | |
|
| 38 | 180 | | BIWUtils.ConfigureEventTrigger( |
| | 181 | | translateEventTrigger, |
| | 182 | | EventTriggerType.PointerEnter, |
| 0 | 183 | | (eventData) => OnTranslatePointerEnter?.Invoke(eventData, translateTooltipText)); |
| | 184 | |
|
| 38 | 185 | | BIWUtils.ConfigureEventTrigger( |
| | 186 | | translateEventTrigger, |
| | 187 | | EventTriggerType.PointerExit, |
| 0 | 188 | | (eventData) => OnPointerExit?.Invoke()); |
| | 189 | |
|
| 38 | 190 | | BIWUtils.ConfigureEventTrigger( |
| | 191 | | rotateEventTrigger, |
| | 192 | | EventTriggerType.PointerEnter, |
| 0 | 193 | | (eventData) => OnRotatePointerEnter?.Invoke(eventData, rotateTooltipText)); |
| | 194 | |
|
| 38 | 195 | | BIWUtils.ConfigureEventTrigger( |
| | 196 | | rotateEventTrigger, |
| | 197 | | EventTriggerType.PointerExit, |
| 0 | 198 | | (eventData) => OnPointerExit?.Invoke()); |
| | 199 | |
|
| 38 | 200 | | BIWUtils.ConfigureEventTrigger( |
| | 201 | | scaleEventTrigger, |
| | 202 | | EventTriggerType.PointerEnter, |
| 0 | 203 | | (eventData) => OnScalePointerEnter?.Invoke(eventData, scaleTooltipText)); |
| | 204 | |
|
| 38 | 205 | | BIWUtils.ConfigureEventTrigger( |
| | 206 | | scaleEventTrigger, |
| | 207 | | EventTriggerType.PointerExit, |
| 0 | 208 | | (eventData) => OnPointerExit?.Invoke()); |
| | 209 | |
|
| 38 | 210 | | BIWUtils.ConfigureEventTrigger( |
| | 211 | | undoEventTrigger, |
| | 212 | | EventTriggerType.PointerEnter, |
| 0 | 213 | | (eventData) => OnUndoPointerEnter?.Invoke(eventData, undoTooltipText)); |
| | 214 | |
|
| 38 | 215 | | BIWUtils.ConfigureEventTrigger( |
| | 216 | | undoEventTrigger, |
| | 217 | | EventTriggerType.PointerExit, |
| 0 | 218 | | (eventData) => OnPointerExit?.Invoke()); |
| | 219 | |
|
| 38 | 220 | | BIWUtils.ConfigureEventTrigger( |
| | 221 | | redoEventTrigger, |
| | 222 | | EventTriggerType.PointerEnter, |
| 0 | 223 | | (eventData) => OnRedoPointerEnter?.Invoke(eventData, redoTooltipText)); |
| | 224 | |
|
| 38 | 225 | | BIWUtils.ConfigureEventTrigger( |
| | 226 | | redoEventTrigger, |
| | 227 | | EventTriggerType.PointerExit, |
| 0 | 228 | | (eventData) => OnPointerExit?.Invoke()); |
| | 229 | |
|
| 38 | 230 | | BIWUtils.ConfigureEventTrigger( |
| | 231 | | duplicateEventTrigger, |
| | 232 | | EventTriggerType.PointerEnter, |
| 0 | 233 | | (eventData) => OnDuplicatePointerEnter?.Invoke(eventData, duplicateTooltipText)); |
| | 234 | |
|
| 38 | 235 | | BIWUtils.ConfigureEventTrigger( |
| | 236 | | duplicateEventTrigger, |
| | 237 | | EventTriggerType.PointerExit, |
| 0 | 238 | | (eventData) => OnPointerExit?.Invoke()); |
| | 239 | |
|
| 38 | 240 | | BIWUtils.ConfigureEventTrigger( |
| | 241 | | deleteEventTrigger, |
| | 242 | | EventTriggerType.PointerEnter, |
| 0 | 243 | | (eventData) => OnDeletePointerEnter?.Invoke(eventData, deleteTooltipText)); |
| | 244 | |
|
| 38 | 245 | | BIWUtils.ConfigureEventTrigger( |
| | 246 | | deleteEventTrigger, |
| | 247 | | EventTriggerType.PointerExit, |
| 0 | 248 | | (eventData) => OnPointerExit?.Invoke()); |
| | 249 | |
|
| 38 | 250 | | BIWUtils.ConfigureEventTrigger( |
| | 251 | | moreActionsEventTrigger, |
| | 252 | | EventTriggerType.PointerEnter, |
| 0 | 253 | | (eventData) => OnMoreActionsPointerEnter?.Invoke(eventData, moreActionsTooltipText)); |
| | 254 | |
|
| 38 | 255 | | BIWUtils.ConfigureEventTrigger( |
| | 256 | | moreActionsEventTrigger, |
| | 257 | | EventTriggerType.PointerExit, |
| 0 | 258 | | (eventData) => OnPointerExit?.Invoke()); |
| | 259 | |
|
| 38 | 260 | | BIWUtils.ConfigureEventTrigger( |
| | 261 | | logoutEventTrigger, |
| | 262 | | EventTriggerType.PointerEnter, |
| 0 | 263 | | (eventData) => OnLogoutPointerEnter?.Invoke(eventData, logoutTooltipText)); |
| | 264 | |
|
| 38 | 265 | | BIWUtils.ConfigureEventTrigger( |
| | 266 | | logoutEventTrigger, |
| | 267 | | EventTriggerType.PointerExit, |
| 0 | 268 | | (eventData) => OnPointerExit?.Invoke()); |
| | 269 | |
|
| 38 | 270 | | BIWUtils.ConfigureEventTrigger( |
| | 271 | | snapModeEventTrigger, |
| | 272 | | EventTriggerType.PointerEnter, |
| 0 | 273 | | (eventData) => OnSnapModePointerEnter?.Invoke(eventData, snapModeTooltipText)); |
| | 274 | |
|
| 38 | 275 | | BIWUtils.ConfigureEventTrigger( |
| | 276 | | snapModeEventTrigger, |
| | 277 | | EventTriggerType.PointerExit, |
| 0 | 278 | | (eventData) => OnPointerExit?.Invoke()); |
| | 279 | |
|
| | 280 | | //TODO: This should be reactivate when we activate the first person camera |
| | 281 | | // toggleChangeCameraInputAction.OnTriggered += OnChangeModeClick; |
| 38 | 282 | | toggleTranslateInputAction.OnTriggered += OnTranslateClick; |
| 38 | 283 | | toggleRotateInputAction.OnTriggered += OnRotateClick; |
| 38 | 284 | | toggleScaleInputAction.OnTriggered += OnScaleClick; |
| 38 | 285 | | toggleDuplicateInputAction.OnTriggered += OnDuplicateClick; |
| 38 | 286 | | toggleDeleteInputAction.OnTriggered += OnDeleteClick; |
| 38 | 287 | | } |
| | 288 | |
|
| | 289 | | private void OnDestroy() |
| | 290 | | { |
| 38 | 291 | | changeModeBtn.onClick.RemoveAllListeners(); |
| 38 | 292 | | translateBtn.onClick.RemoveAllListeners(); |
| 38 | 293 | | rotateBtn.onClick.RemoveAllListeners(); |
| 38 | 294 | | scaleBtn.onClick.RemoveAllListeners(); |
| 38 | 295 | | undoBtn.onClick.RemoveAllListeners(); |
| 38 | 296 | | redoBtn.onClick.RemoveAllListeners(); |
| 38 | 297 | | duplicateBtn.onClick.RemoveAllListeners(); |
| 38 | 298 | | deleteBtn.onClick.RemoveAllListeners(); |
| 38 | 299 | | logOutBtn.onClick.RemoveAllListeners(); |
| 38 | 300 | | extraBtn.onClick.RemoveAllListeners(); |
| 38 | 301 | | snapModeBtn.onClick.RemoveAllListeners(); |
| | 302 | |
|
| 38 | 303 | | BIWUtils.RemoveEventTrigger(changeCameraModeEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 304 | | BIWUtils.RemoveEventTrigger(changeCameraModeEventTrigger, EventTriggerType.PointerExit); |
| 38 | 305 | | BIWUtils.RemoveEventTrigger(translateEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 306 | | BIWUtils.RemoveEventTrigger(translateEventTrigger, EventTriggerType.PointerExit); |
| 38 | 307 | | BIWUtils.RemoveEventTrigger(rotateEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 308 | | BIWUtils.RemoveEventTrigger(rotateEventTrigger, EventTriggerType.PointerExit); |
| 38 | 309 | | BIWUtils.RemoveEventTrigger(scaleEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 310 | | BIWUtils.RemoveEventTrigger(scaleEventTrigger, EventTriggerType.PointerExit); |
| 38 | 311 | | BIWUtils.RemoveEventTrigger(undoEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 312 | | BIWUtils.RemoveEventTrigger(undoEventTrigger, EventTriggerType.PointerExit); |
| 38 | 313 | | BIWUtils.RemoveEventTrigger(redoEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 314 | | BIWUtils.RemoveEventTrigger(redoEventTrigger, EventTriggerType.PointerExit); |
| 38 | 315 | | BIWUtils.RemoveEventTrigger(duplicateEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 316 | | BIWUtils.RemoveEventTrigger(duplicateEventTrigger, EventTriggerType.PointerExit); |
| 38 | 317 | | BIWUtils.RemoveEventTrigger(deleteEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 318 | | BIWUtils.RemoveEventTrigger(deleteEventTrigger, EventTriggerType.PointerExit); |
| 38 | 319 | | BIWUtils.RemoveEventTrigger(moreActionsEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 320 | | BIWUtils.RemoveEventTrigger(moreActionsEventTrigger, EventTriggerType.PointerExit); |
| 38 | 321 | | BIWUtils.RemoveEventTrigger(logoutEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 322 | | BIWUtils.RemoveEventTrigger(logoutEventTrigger, EventTriggerType.PointerExit); |
| 38 | 323 | | BIWUtils.RemoveEventTrigger(snapModeEventTrigger, EventTriggerType.PointerEnter); |
| 38 | 324 | | BIWUtils.RemoveEventTrigger(snapModeEventTrigger, EventTriggerType.PointerExit); |
| | 325 | |
|
| 38 | 326 | | toggleChangeCameraInputAction.OnTriggered -= OnChangeModeClick; |
| 38 | 327 | | toggleTranslateInputAction.OnTriggered -= OnTranslateClick; |
| 38 | 328 | | toggleRotateInputAction.OnTriggered -= OnRotateClick; |
| 38 | 329 | | toggleScaleInputAction.OnTriggered -= OnScaleClick; |
| 38 | 330 | | toggleDuplicateInputAction.OnTriggered -= OnDuplicateClick; |
| 38 | 331 | | toggleDeleteInputAction.OnTriggered -= OnDeleteClick; |
| | 332 | |
|
| 38 | 333 | | if (extraActionsController != null) |
| 1 | 334 | | extraActionsController.Dispose(); |
| 38 | 335 | | } |
| | 336 | |
|
| | 337 | | public void ConfigureExtraActions(IExtraActionsController extraActionsController) |
| | 338 | | { |
| 1 | 339 | | this.extraActionsController = extraActionsController; |
| 1 | 340 | | this.extraActionsController.Initialize(extraActionsView); |
| 1 | 341 | | } |
| | 342 | |
|
| 2 | 343 | | public void OnChangeModeClick(DCLAction_Trigger action) { OnChangeModeClicked?.Invoke(); } |
| | 344 | |
|
| 2 | 345 | | public void OnExtraClick(DCLAction_Trigger action) { OnExtraClicked?.Invoke(); } |
| | 346 | |
|
| 2 | 347 | | public void OnTranslateClick(DCLAction_Trigger action) { OnTranslateClicked?.Invoke(); } |
| 0 | 348 | | public void OnSnapModeClick(DCLAction_Trigger action) { OnSnapModeClicked?.Invoke(); } |
| | 349 | |
|
| 4 | 350 | | public void SetSnapActive(bool isActive) { snapModeBtnImg.color = isActive ? selectedBtnImgColor : normalBtnImgColor |
| | 351 | |
|
| | 352 | | public void SetGizmosActive(string gizmos) |
| | 353 | | { |
| 4 | 354 | | translateGizmosBtnImg.color = normalBtnImgColor; |
| 4 | 355 | | rotateGizmosBtnImg.color = normalBtnImgColor; |
| 4 | 356 | | scaleGizmosBtnImg.color = normalBtnImgColor; |
| | 357 | |
|
| | 358 | | switch (gizmos) |
| | 359 | | { |
| | 360 | | case BIWSettings.TRANSLATE_GIZMO_NAME: |
| 1 | 361 | | translateGizmosBtnImg.color = selectedBtnImgColor; |
| 1 | 362 | | break; |
| | 363 | | case BIWSettings.ROTATE_GIZMO_NAME: |
| 1 | 364 | | rotateGizmosBtnImg.color = selectedBtnImgColor; |
| 1 | 365 | | break; |
| | 366 | | case BIWSettings.SCALE_GIZMO_NAME: |
| 1 | 367 | | scaleGizmosBtnImg.color = selectedBtnImgColor; |
| | 368 | | break; |
| | 369 | | } |
| 1 | 370 | | } |
| | 371 | |
|
| | 372 | | public void SetActionsInteractable(bool isActive) |
| | 373 | | { |
| 2 | 374 | | duplicateBtn.interactable = isActive; |
| 2 | 375 | | deleteBtn.interactable = isActive; |
| 2 | 376 | | } |
| | 377 | |
|
| 0 | 378 | | public void SetUndoInteractable(bool isActive) { undoBtn.interactable = isActive; } |
| | 379 | |
|
| 0 | 380 | | public void SetRedoInteractable(bool isActive) { redoBtn.interactable = isActive; } |
| | 381 | |
|
| 2 | 382 | | public void OnRotateClick(DCLAction_Trigger action) { OnRotateClicked?.Invoke(); } |
| | 383 | |
|
| 2 | 384 | | public void OnScaleClick(DCLAction_Trigger action) { OnScaleClicked?.Invoke(); } |
| | 385 | |
|
| 2 | 386 | | public void OnUndoClick() { OnUndoClicked?.Invoke(); } |
| 2 | 387 | | public void OnRedoClick() { OnRedoClicked?.Invoke(); } |
| | 388 | |
|
| 2 | 389 | | public void OnDuplicateClick(DCLAction_Trigger action) { OnDuplicateClicked?.Invoke(); } |
| | 390 | |
|
| 2 | 391 | | public void OnDeleteClick(DCLAction_Trigger action) { OnDeleteClicked?.Invoke(); } |
| | 392 | |
|
| 2 | 393 | | public void OnLogOutClick(DCLAction_Trigger action) { OnLogOutClicked?.Invoke(); } |
| | 394 | | } |