카메라 이동범위 설정 -0.2(노준학)
기즈모 고정 -0.5(노준학) 완료 MQTT 재연결 로직 -0.2(노준학) - 작업중
This commit is contained in:
92
.json
92
.json
@@ -1,92 +0,0 @@
|
||||
[
|
||||
{
|
||||
"prefabName": "ForkLift",
|
||||
"modelName": "ForkLift_0",
|
||||
"modelType": "Move",
|
||||
"modelID": "",
|
||||
"nodeID": "conveyor_0_59857fd6-573b-4ac1-8ea3-caaafe362d8f",
|
||||
"position": "(14.64, 0.00, -12.49)",
|
||||
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
|
||||
"scale": "(1.00, 1.00, 1.00)"
|
||||
},
|
||||
{
|
||||
"prefabName": "BigShelves01",
|
||||
"modelName": "BigShelves01_0",
|
||||
"modelType": "Queue",
|
||||
"modelID": "",
|
||||
"nodeID": "queue_0_e38d4154-304b-49bf-b3b3-8efb9eec5bcc",
|
||||
"position": "(2.33, 0.00, -11.97)",
|
||||
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
|
||||
"scale": "(1.00, 1.00, 1.00)"
|
||||
},
|
||||
{
|
||||
"prefabName": "Pallet",
|
||||
"modelName": "Pallet_0",
|
||||
"modelType": "Source",
|
||||
"modelID": "",
|
||||
"nodeID": "product_generator_0_9752fa8d-edce-4688-ae61-5c230fd9e215",
|
||||
"position": "(-8.78, 0.00, -11.54)",
|
||||
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
|
||||
"scale": "(1.00, 1.00, 1.00)"
|
||||
},
|
||||
{
|
||||
"prefabName": "Pallet",
|
||||
"modelName": "Pallet_1",
|
||||
"modelType": "Source",
|
||||
"modelID": "",
|
||||
"nodeID": "queue_0_814c82ee-39dd-400c-9431-7a08e53c7cdc",
|
||||
"position": "(19.00, 0.00, -10.32)",
|
||||
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
|
||||
"scale": "(1.00, 1.00, 1.00)"
|
||||
},
|
||||
{
|
||||
"prefabName": "Pallet",
|
||||
"modelName": "Pallet_2",
|
||||
"modelType": "Source",
|
||||
"modelID": "",
|
||||
"nodeID": "queue_0_5fe5935a-12da-4df8-826a-2866f1ebb39c",
|
||||
"position": "(44.92, 0.00, -10.08)",
|
||||
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
|
||||
"scale": "(1.00, 1.00, 1.00)"
|
||||
},
|
||||
{
|
||||
"prefabName": "Pallet",
|
||||
"modelName": "Pallet_3",
|
||||
"modelType": "Source",
|
||||
"modelID": "",
|
||||
"nodeID": "queue_0_7d839a7a-8669-4a52-8ee3-9397d9eea97d",
|
||||
"position": "(54.26, 0.00, -9.26)",
|
||||
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
|
||||
"scale": "(1.00, 1.00, 1.00)"
|
||||
},
|
||||
{
|
||||
"prefabName": "Pallet",
|
||||
"modelName": "Pallet_4",
|
||||
"modelType": "Source",
|
||||
"modelID": "",
|
||||
"nodeID": "shipment_0_6b2177cc-e89c-48c0-8948-918ed6adf8ee",
|
||||
"position": "(63.43, 0.00, -9.95)",
|
||||
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
|
||||
"scale": "(1.00, 1.00, 1.00)"
|
||||
},
|
||||
{
|
||||
"prefabName": "ForkLift",
|
||||
"modelName": "ForkLift_1",
|
||||
"modelType": "Move",
|
||||
"modelID": "",
|
||||
"nodeID": "conveyor_0_32e374b3-7f80-44ae-ae24-c686fd77d4c1",
|
||||
"position": "(48.46, 0.00, -9.92)",
|
||||
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
|
||||
"scale": "(1.00, 1.00, 1.00)"
|
||||
},
|
||||
{
|
||||
"prefabName": "BigShelves01",
|
||||
"modelName": "BigShelves01_1",
|
||||
"modelType": "Queue",
|
||||
"modelID": "",
|
||||
"nodeID": "store_0_28fefae0-5091-4e0f-a1ac-a44ae5d272db",
|
||||
"position": "(31.60, 0.00, -11.43)",
|
||||
"rotation": "(0.00000, 0.00000, 0.00000, 1.00000)",
|
||||
"scale": "(1.00, 1.00, 1.00)"
|
||||
}
|
||||
]
|
||||
@@ -1,6 +1,7 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace RTG
|
||||
{
|
||||
@@ -99,7 +100,7 @@ namespace RTG
|
||||
private List<GameObject> _transformableParents;
|
||||
private AABB _targetGroupAABBOnDragBegin;
|
||||
|
||||
private GizmoSpace _transformSpace = GizmoSpace.Global;
|
||||
private GizmoSpace _transformSpace = GizmoSpace.Local;
|
||||
private bool _isTransformSpacePermanent;
|
||||
private GizmoObjectTransformPivot _transformPivot = GizmoObjectTransformPivot.ObjectGroupCenter;
|
||||
private bool _isTransformPivotPermanent;
|
||||
@@ -339,8 +340,19 @@ namespace RTG
|
||||
if (_transformSpace == GizmoSpace.Global) gizmoTransform.Rotation3D = Quaternion.identity;
|
||||
else
|
||||
{
|
||||
if (_targetPivotObject == null) gizmoTransform.Rotation3D = Quaternion.identity;
|
||||
else gizmoTransform.Rotation3D = _targetPivotObject.transform.rotation;
|
||||
if (_targetPivotObject != null)
|
||||
{
|
||||
gizmoTransform.Rotation3D = _targetPivotObject.transform.rotation;
|
||||
}
|
||||
else if (_targetObjects.Count() == 1)
|
||||
{
|
||||
GameObject pivotObject = _targetObjects.First();
|
||||
gizmoTransform.Rotation3D = pivotObject.transform.rotation;
|
||||
}
|
||||
else
|
||||
{
|
||||
gizmoTransform.Rotation3D = Quaternion.identity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using static UnityEditor.PlayerSettings;
|
||||
|
||||
namespace RTG
|
||||
{
|
||||
@@ -68,7 +69,8 @@ namespace RTG
|
||||
private CameraProjectionSwitchSettings _projectionSwitchSettings = new CameraProjectionSwitchSettings();
|
||||
[SerializeField]
|
||||
private CameraHotkeys _hotkeys = new CameraHotkeys();
|
||||
|
||||
[SerializeField]
|
||||
private CameraLimit _cameraLimitSetting = new CameraLimit();
|
||||
public Camera TargetCamera { get { return _targetCamera; } }
|
||||
public bool IsDoingProjectionSwitch { get { return _prjSwitchTranstion.IsActive; } }
|
||||
public CameraPrjSwitchTransition.Type PrjSwitchTransitionType { get { return _prjSwitchTranstion.TransitionType; } }
|
||||
@@ -114,7 +116,9 @@ namespace RTG
|
||||
public CameraRotationSwitchSettings RotationSwitchSettings { get { return _rotationSwitchSettings; } }
|
||||
public CameraProjectionSwitchSettings ProjectionSwitchSettings { get { return _projectionSwitchSettings; } }
|
||||
public CameraHotkeys Hotkeys { get { return _hotkeys; } }
|
||||
public CameraLimit LimitSetting { get { return _cameraLimitSetting; } }
|
||||
|
||||
|
||||
public bool IsViewportHoveredByDevice()
|
||||
{
|
||||
Vector2 devicePos = RTInputDevice.Get.Device.GetPositionYAxisUp();
|
||||
@@ -310,7 +314,16 @@ namespace RTG
|
||||
else if (IsMovingDown) moveVector -= _targetTransform.up * moveAmount;
|
||||
|
||||
bool needsToMove = moveVector.sqrMagnitude != 0.0f;
|
||||
if (needsToMove) _targetTransform.position += moveVector;
|
||||
if (needsToMove)
|
||||
{
|
||||
var pos = _targetTransform.position + moveVector;
|
||||
var isOverX = IsLimit(pos.x, _cameraLimitSetting.LimitMinX, _cameraLimitSetting.LimitMaxX, out var clampX);
|
||||
var isOverY = IsLimit(pos.y, _cameraLimitSetting.LimitMinY, _cameraLimitSetting.LimitMaxY, out var clampY);
|
||||
var isOverZ = IsLimit(pos.z, _cameraLimitSetting.LimitMinZ, _cameraLimitSetting.LimitMaxZ, out var clampz);
|
||||
|
||||
if (!isOverX && !isOverY && !isOverZ)
|
||||
_targetTransform.position = new Vector3(clampX, clampY, clampz);
|
||||
}
|
||||
|
||||
if (needsToMove || wasZoomed)
|
||||
{
|
||||
@@ -407,7 +420,16 @@ namespace RTG
|
||||
{
|
||||
Vector3 focusPoint = GetFocusPoint();
|
||||
|
||||
_targetTransform.position += _targetTransform.forward * zoomAmount;
|
||||
var pos = _targetTransform.position + _targetTransform.forward * zoomAmount;
|
||||
var isOverX = IsLimit(pos.x, _cameraLimitSetting.LimitMinX, _cameraLimitSetting.LimitMaxX, out var clampX);
|
||||
var isOverY = IsLimit(pos.y, _cameraLimitSetting.LimitMinY, _cameraLimitSetting.LimitMaxY, out var clampY);
|
||||
var isOverZ = IsLimit(pos.z, _cameraLimitSetting.LimitMinZ, _cameraLimitSetting.LimitMaxZ, out var clampz);
|
||||
|
||||
if (isOverX || isOverY || isOverZ)
|
||||
return;
|
||||
|
||||
_targetTransform.position = new Vector3(clampX, clampY, clampz);
|
||||
|
||||
if (TargetCamera.orthographic)
|
||||
{
|
||||
Vector3 toFocusPt = focusPoint - _targetTransform.position;
|
||||
@@ -420,6 +442,14 @@ namespace RTG
|
||||
SetFocusPoint(focusPoint);
|
||||
AdjustOrthoSizeForFocusPt();
|
||||
}
|
||||
private bool IsLimit(float value,float min, float max,out float result)
|
||||
{
|
||||
result = Mathf.Clamp(value, min, max);
|
||||
if (value > max || value < min)
|
||||
return true;
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
private Vector3 GetFocusPoint()
|
||||
{
|
||||
@@ -432,13 +462,21 @@ namespace RTG
|
||||
if (_zoomSettings.InvertZoomAxis) zoomAmount *= -1.0f;
|
||||
|
||||
zoomAmount *= _targetCamera.EstimateZoomFactorSpherical(_lastFocusPoint);
|
||||
|
||||
return zoomAmount;
|
||||
}
|
||||
|
||||
private void Pan(Vector2 panAmount)
|
||||
{
|
||||
_targetTransform.position += _targetTransform.right * panAmount.x + _targetTransform.up * panAmount.y;
|
||||
var pos = _targetTransform.position + _targetTransform.right * panAmount.x + _targetTransform.up * panAmount.y;
|
||||
var isOverX = IsLimit(pos.x, _cameraLimitSetting.LimitMinX, _cameraLimitSetting.LimitMaxX, out var clampX);
|
||||
var isOverY = IsLimit(pos.y, _cameraLimitSetting.LimitMinY, _cameraLimitSetting.LimitMaxY, out var clampY);
|
||||
var isOverZ = IsLimit(pos.z, _cameraLimitSetting.LimitMinZ, _cameraLimitSetting.LimitMaxZ, out var clampz);
|
||||
|
||||
if (isOverX || isOverY || isOverZ)
|
||||
return;
|
||||
|
||||
_targetTransform.position = new Vector3(clampX, clampY, clampz);
|
||||
//_targetTransform.position += _targetTransform.right * panAmount.x + _targetTransform.up * panAmount.y;
|
||||
}
|
||||
|
||||
public void LookAround(float degreesLocalX, float degreesWorldY)
|
||||
|
||||
@@ -25,6 +25,11 @@ namespace RTG
|
||||
_camera.Settings.RenderEditorGUI(_camera);
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
_camera.LimitSetting.UsesFoldout = true;
|
||||
_camera.LimitSetting.FoldoutLabel = "Limit settings";
|
||||
_camera.LimitSetting.RenderEditorGUI(_camera);
|
||||
|
||||
_camera.MoveSettings.UsesFoldout = true;
|
||||
_camera.MoveSettings.FoldoutLabel = "Move settings";
|
||||
_camera.MoveSettings.RenderEditorGUI(_camera);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
69
Assets/Scripts/AlertManager.cs
Normal file
69
Assets/Scripts/AlertManager.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
public class AlertManager : UnitySingleton<AlertManager>
|
||||
{
|
||||
private GameObject prefab;
|
||||
private UIAlert alert;
|
||||
|
||||
|
||||
private void Create()
|
||||
{
|
||||
if (alert == null)
|
||||
{
|
||||
if (prefab == null)
|
||||
{
|
||||
prefab = Resources.Load("Prefabs/Popup/UIAlert", typeof(GameObject)) as GameObject;
|
||||
}
|
||||
GameObject go = UnityEngine.Object.Instantiate(prefab);
|
||||
alert = go.GetComponent<UIAlert>();
|
||||
}
|
||||
//var canvas = FindAnyObjectByType<Canvas_Label>();
|
||||
//alert.transform.SetParent(canvas.Canvas.rootCanvas.transform, false);
|
||||
}
|
||||
|
||||
//public async UniTask ShowAlert(string title, string message, string okButtonTitle = "OK")
|
||||
//{
|
||||
// Create();
|
||||
|
||||
// bool isClosed = false;
|
||||
|
||||
// alert.Init(title: title, message: message, okButtonText: okButtonTitle, showCancelButton: false);
|
||||
// alert.OnOk.AddListener(() =>
|
||||
// {
|
||||
// isClosed = true;
|
||||
// });
|
||||
// alert.Open();
|
||||
// await UniTask.WaitUntil(() => isClosed == true);
|
||||
//}
|
||||
|
||||
//public async UniTask<bool> ShowConfirm(string title, string message, string okButtonTitle = "OK", string cancelButtonTitle = "CANCEL")
|
||||
//{
|
||||
// Create();
|
||||
|
||||
// bool isClosed = false;
|
||||
// bool result = false;
|
||||
|
||||
// alert.Init(title, message, okButtonTitle, cancelButtonTitle, true);
|
||||
|
||||
// alert.OnOk.AddListener(() =>
|
||||
// {
|
||||
// result = true;
|
||||
// isClosed = true;
|
||||
// });
|
||||
|
||||
// alert.OnCancel.AddListener(() =>
|
||||
// {
|
||||
// result = false;
|
||||
// isClosed = true;
|
||||
// });
|
||||
|
||||
// alert.Open();
|
||||
|
||||
|
||||
// await UniTask.WaitUntil(() => isClosed == true);
|
||||
|
||||
// return result;
|
||||
//}
|
||||
|
||||
}
|
||||
2
Assets/Scripts/AlertManager.cs.meta
Normal file
2
Assets/Scripts/AlertManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 210ab3bedc01a564089219c90ecc3e5b
|
||||
96
Assets/Scripts/CameraLimit.cs
Normal file
96
Assets/Scripts/CameraLimit.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
using System;
|
||||
|
||||
namespace RTG
|
||||
{
|
||||
[Serializable]
|
||||
public class CameraLimit : Settings
|
||||
{
|
||||
[SerializeField]
|
||||
private float minX;
|
||||
[SerializeField]
|
||||
private float maxX;
|
||||
[SerializeField]
|
||||
private float minY;
|
||||
[SerializeField]
|
||||
private float maxY;
|
||||
[SerializeField]
|
||||
private float minZ;
|
||||
[SerializeField]
|
||||
private float maxZ;
|
||||
|
||||
public float LimitMinX { get { return minX; } set { minX = Mathf.Max(value, -1000f); } }
|
||||
public float LimitMaxX { get { return maxX; } set { maxX = Mathf.Max(value, 1e-2f); } }
|
||||
public float LimitMinY { get { return minY; } set { minY = Mathf.Max(value, -1000f); } }
|
||||
public float LimitMaxY { get { return maxY; } set { maxY = Mathf.Max(value, 1e-2f); } }
|
||||
public float LimitMinZ { get { return minZ; } set { minZ = Mathf.Max(value, -1000f); } }
|
||||
public float LimitMaxZ { get { return maxZ; } set { maxZ = Mathf.Max(value, 1e-2f); } }
|
||||
|
||||
#if UNITY_EDITOR
|
||||
protected override void RenderContent(UnityEngine.Object undoRecordObject)
|
||||
{
|
||||
EditorGUILayout.BeginVertical();
|
||||
GUIContent content = new GUIContent();
|
||||
content.text = "Camera PosX Min Limit";
|
||||
content.tooltip = "???";
|
||||
var newMinX = EditorGUILayout.FloatField(content, minX);
|
||||
if (newMinX != LimitMinX)
|
||||
{
|
||||
EditorUndoEx.Record(undoRecordObject);
|
||||
LimitMinX = newMinX;
|
||||
}
|
||||
|
||||
content.text = "Camera PosX Max Limit";
|
||||
content.tooltip = "???";
|
||||
var newMaxX = EditorGUILayout.FloatField(content, maxX);
|
||||
if(newMaxX != LimitMaxX)
|
||||
{
|
||||
EditorUndoEx.Record(undoRecordObject);
|
||||
LimitMaxX = newMaxX;
|
||||
}
|
||||
|
||||
content.text = "Camera PosY Min Limit";
|
||||
content.tooltip = "???";
|
||||
var newMinY = EditorGUILayout.FloatField(content, minY);
|
||||
if (newMinY != LimitMinY)
|
||||
{
|
||||
EditorUndoEx.Record(undoRecordObject);
|
||||
LimitMinY = newMinY;
|
||||
}
|
||||
|
||||
content.text = "Camera PosY Max Limit";
|
||||
content.tooltip = "???";
|
||||
var newMaxY = EditorGUILayout.FloatField(content, maxY);
|
||||
if (newMaxY != LimitMaxY)
|
||||
{
|
||||
EditorUndoEx.Record(undoRecordObject);
|
||||
LimitMaxY = newMaxY;
|
||||
}
|
||||
|
||||
content.text = "Camera PosZ Min Limit";
|
||||
content.tooltip = "???";
|
||||
var newMinZ = EditorGUILayout.FloatField(content, minZ);
|
||||
if (newMinZ != LimitMinZ)
|
||||
{
|
||||
EditorUndoEx.Record(undoRecordObject);
|
||||
LimitMinZ = newMinZ;
|
||||
}
|
||||
|
||||
content.text = "Camera Pos Z Max Limit";
|
||||
content.tooltip = "???";
|
||||
var newMaxZ = EditorGUILayout.FloatField(content, maxZ);
|
||||
if (newMaxZ != LimitMaxZ)
|
||||
{
|
||||
EditorUndoEx.Record(undoRecordObject);
|
||||
LimitMaxZ = newMaxZ;
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
2
Assets/Scripts/CameraLimit.cs.meta
Normal file
2
Assets/Scripts/CameraLimit.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c4af8eb58f405b42a97234f59d24768
|
||||
@@ -1,4 +1,4 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ClickHandler : MonoBehaviour
|
||||
return;
|
||||
|
||||
if (UnityEngine.EventSystems.EventSystem.current?.IsPointerOverGameObject() == true)
|
||||
return; // UI Ŭ¸¯ÀÌ¸é ¹«½Ã
|
||||
return; // UI 클릭이면 무시
|
||||
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
if (Physics.Raycast(ray, out RaycastHit hit))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using RTG;
|
||||
using RTG;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Octopus.Simulator;
|
||||
@@ -98,7 +98,6 @@ public class RTGController : UnitySingleton<RTGController>
|
||||
objectRotationGizmo.Gizmo.SetEnabled(false);
|
||||
objectScaleGizmo.Gizmo.SetEnabled(false);
|
||||
objectUniversalGizmo.Gizmo.SetEnabled(false);
|
||||
|
||||
if (gizmoId == "None")
|
||||
{
|
||||
workGizmoId = GizmoId.None;
|
||||
|
||||
201
Assets/Scripts/UIAlert.cs
Normal file
201
Assets/Scripts/UIAlert.cs
Normal file
@@ -0,0 +1,201 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
[RequireComponent(typeof(CanvasGroup))]
|
||||
public class UIAlert : MonoBehaviour
|
||||
{
|
||||
private string title;
|
||||
private string message;
|
||||
|
||||
private string okButtonText = "확인";
|
||||
private string cancelButtonText = "취소";
|
||||
|
||||
private bool showCancelButton = false;
|
||||
|
||||
public UnityEvent OnOk;
|
||||
public UnityEvent OnCancel;
|
||||
|
||||
private Button okButton;
|
||||
private Button cancelButton;
|
||||
private TextMeshProUGUI titleText;
|
||||
private TextMeshProUGUI messageText;
|
||||
private CanvasGroup canvasGroup;
|
||||
|
||||
private bool animatting = false;
|
||||
|
||||
private float target = 0;
|
||||
private float duration = 0.25f;
|
||||
private float alpha = 1;
|
||||
|
||||
private bool useKeyboard = false;
|
||||
|
||||
public void Init(string title, string message, string okButtonText = "확인", string cancelButtonText = "취소", bool showCancelButton = true)
|
||||
{
|
||||
|
||||
this.title = title;
|
||||
this.message = message;
|
||||
this.okButtonText = okButtonText;
|
||||
this.cancelButtonText = cancelButtonText;
|
||||
this.showCancelButton = showCancelButton;
|
||||
|
||||
canvasGroup = GetComponent<CanvasGroup>();
|
||||
|
||||
var okBtn = GetComponentInChildren<UIPopupButtonOk>();
|
||||
var cancelBtn = GetComponentInChildren<UIPopupButtonCancel>();
|
||||
var titleTxt = GetComponentInChildren<UIPopupTitle>();
|
||||
var messageTxt = GetComponentInChildren<UIPopupMessage>();
|
||||
|
||||
|
||||
if (okButton == null) okButton = okBtn.GetComponent<Button>();
|
||||
|
||||
if (okButton != null)
|
||||
{
|
||||
if (useKeyboard) okButton.navigation = new Navigation() { mode = Navigation.Mode.None };
|
||||
okButton.GetComponentInChildren<TextMeshProUGUI>().text = okButtonText;
|
||||
okButton.onClick.AddListener(() =>
|
||||
{
|
||||
if (OnOk != null) OnOk.Invoke();
|
||||
Close();
|
||||
});
|
||||
}
|
||||
|
||||
if (cancelButton == null) cancelButton = cancelBtn.GetComponent<Button>();
|
||||
|
||||
if (cancelButton != null)
|
||||
{
|
||||
if (useKeyboard) cancelButton.navigation = new Navigation() { mode = Navigation.Mode.None };
|
||||
if (showCancelButton)
|
||||
{
|
||||
cancelButton.gameObject.SetActive(true);
|
||||
cancelButton.GetComponentInChildren<TextMeshProUGUI>().text = cancelButtonText;
|
||||
cancelButton.onClick.AddListener(() =>
|
||||
{
|
||||
if (OnCancel != null) OnCancel.Invoke();
|
||||
Close();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
cancelButton.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (titleTxt != null)
|
||||
{
|
||||
titleText = titleTxt.GetComponent<TextMeshProUGUI>();
|
||||
titleText.text = title;
|
||||
}
|
||||
|
||||
if (messageTxt != null)
|
||||
{
|
||||
messageText = messageTxt.GetComponent<TextMeshProUGUI>();
|
||||
messageText.text = message;
|
||||
}
|
||||
|
||||
canvasGroup.alpha = 0;
|
||||
canvasGroup.interactable = false;
|
||||
canvasGroup.blocksRaycasts = false;
|
||||
}
|
||||
|
||||
public void Open()
|
||||
{
|
||||
canvasGroup.interactable = true;
|
||||
canvasGroup.blocksRaycasts = true;
|
||||
target = 1;
|
||||
alpha = canvasGroup.alpha;
|
||||
animatting = true;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
target = 0;
|
||||
alpha = canvasGroup.alpha;
|
||||
animatting = true;
|
||||
}
|
||||
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (animatting)
|
||||
{
|
||||
if (duration < 0)
|
||||
{
|
||||
duration = 0.001f;
|
||||
}
|
||||
|
||||
alpha = Mathf.MoveTowards(alpha, target, (1 / duration) * Time.deltaTime);
|
||||
canvasGroup.alpha = alpha;
|
||||
if (alpha == target)
|
||||
{
|
||||
if (target == 0)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
animatting = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (alpha == 1 && target == 1 && useKeyboard)
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
if (showCancelButton)
|
||||
{
|
||||
cancelButton.OnPointerDown(new UnityEngine.EventSystems.PointerEventData(EventSystem.current));
|
||||
}
|
||||
}
|
||||
else if (Input.GetKeyUp(KeyCode.Escape))
|
||||
{
|
||||
if (showCancelButton)
|
||||
{
|
||||
cancelButton.OnPointerUp(new UnityEngine.EventSystems.PointerEventData(EventSystem.current));
|
||||
}
|
||||
if (OnCancel != null) OnCancel.Invoke();
|
||||
Close();
|
||||
}
|
||||
else if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
okButton.OnPointerDown(new UnityEngine.EventSystems.PointerEventData(EventSystem.current));
|
||||
}
|
||||
else if (Input.GetKeyUp(KeyCode.Space))
|
||||
{
|
||||
okButton.OnPointerUp(new UnityEngine.EventSystems.PointerEventData(EventSystem.current));
|
||||
if (OnOk != null) OnOk.Invoke();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (okButton != null)
|
||||
{
|
||||
okButton.onClick.RemoveAllListeners();
|
||||
}
|
||||
|
||||
if (cancelButton != null)
|
||||
{
|
||||
cancelButton.onClick.RemoveAllListeners();
|
||||
}
|
||||
|
||||
if (OnOk != null)
|
||||
{
|
||||
OnOk.RemoveAllListeners();
|
||||
OnOk = null;
|
||||
}
|
||||
|
||||
if (OnCancel != null)
|
||||
{
|
||||
OnCancel.RemoveAllListeners();
|
||||
OnCancel = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
Assets/Scripts/UIAlert.cs.meta
Normal file
2
Assets/Scripts/UIAlert.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df24e34663a0c284fab8f402000f0bcd
|
||||
16
Assets/UIPopupButtonCancel.cs
Normal file
16
Assets/UIPopupButtonCancel.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class UIPopupButtonCancel : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/UIPopupButtonCancel.cs.meta
Normal file
2
Assets/UIPopupButtonCancel.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e25ab5d901782b4a80dfddaff90dd16
|
||||
16
Assets/UIPopupButtonOk.cs
Normal file
16
Assets/UIPopupButtonOk.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class UIPopupButtonOk : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/UIPopupButtonOk.cs.meta
Normal file
2
Assets/UIPopupButtonOk.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe2b4ed9a25d1634fa10e9275ea25b59
|
||||
16
Assets/UIPopupMessage.cs
Normal file
16
Assets/UIPopupMessage.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class UIPopupMessage : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/UIPopupMessage.cs.meta
Normal file
2
Assets/UIPopupMessage.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d97c6befb927004aae611312e5445ac
|
||||
16
Assets/UIPopupTitle.cs
Normal file
16
Assets/UIPopupTitle.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class UIPopupTitle : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/UIPopupTitle.cs.meta
Normal file
2
Assets/UIPopupTitle.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b451020cbfe9ea4f8ac206a6d05c482
|
||||
@@ -1,4 +1,4 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
using Best.MQTT;
|
||||
using Best.MQTT.Packets;
|
||||
using Best.MQTT.Packets.Builders;
|
||||
@@ -138,7 +138,8 @@ namespace Octopus.Simulator.Networks
|
||||
|
||||
private void OnDisconnected(MQTTClient client, DisconnectReasonCodes reasonCode, string reasonMessage)
|
||||
{
|
||||
Debug.Log(reasonMessage);
|
||||
//Debug.Log(reasonMessage);
|
||||
|
||||
//throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,213 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>com.Tivadar.Best.WebSockets</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Best.WebSockets.Implementations.WebSocketStates">
|
||||
<summary>
|
||||
States of the underlying implementation's state.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Best.WebSockets.Implementations.WebSocketBaseImplementation">
|
||||
<summary>
|
||||
Abstract class for concrete websocket communication implementations.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.Implementations.WebSocketBaseImplementation.RTTBufferCapacity">
|
||||
<summary>
|
||||
Capacity of the RTT buffer where the latencies are kept.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Best.WebSockets.WebSocket">
|
||||
<summary>
|
||||
Implements the WebSocket standard for duplex, two-way communications.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocket.MaxFragmentSize">
|
||||
<summary>
|
||||
Maximum payload size of a websocket frame. Its default value is 32 KiB.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Best.WebSockets.WebSocket.IsOpen">
|
||||
<summary>
|
||||
The connection to the WebSocket server is open.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Best.WebSockets.WebSocket.BufferedAmount">
|
||||
<summary>
|
||||
Data waiting to be written to the wire.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocket.OnOpen">
|
||||
<summary>
|
||||
Called when the connection to the WebSocket server is established.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocket.OnMessage">
|
||||
<summary>
|
||||
Called when a new textual message is received from the server.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocket.OnBinary">
|
||||
<summary>
|
||||
Called when a Binary message received.
|
||||
The content of the <see cref="T:Best.HTTP.Shared.PlatformSupport.Memory.BufferSegment"/> must be used or copied to a new array in the callbacks because the plugin reuses the memory immediately after the callback by placing it back to the <see cref="T:Best.HTTP.Shared.PlatformSupport.Memory.BufferPool"/>!
|
||||
</summary>
|
||||
<remarks>Note that the memory will be reused when this event returns. Either process it in this call or make a copy from the received data.</remarks>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocket.OnClosed">
|
||||
<summary>
|
||||
Called when the WebSocket connection is closed.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Best.WebSockets.WebSocket.Context">
|
||||
<summary>
|
||||
Logging context of this websocket instance.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocket.implementation">
|
||||
<summary>
|
||||
The underlying, real implementation.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Best.WebSockets.WebSocket.#ctor(System.Uri)">
|
||||
<summary>
|
||||
Creates a WebSocket instance from the given uri.
|
||||
</summary>
|
||||
<param name="uri">The uri of the WebSocket server</param>
|
||||
</member>
|
||||
<member name="M:Best.WebSockets.WebSocket.#ctor(System.Uri,System.String,System.String)">
|
||||
<summary>
|
||||
Creates a WebSocket instance from the given uri, protocol and origin.
|
||||
</summary>
|
||||
<param name="uri">The uri of the WebSocket server</param>
|
||||
<param name="origin">Servers that are not intended to process input from any web page but only for certain sites SHOULD verify the |Origin| field is an origin they expect.
|
||||
If the origin indicated is unacceptable to the server, then it SHOULD respond to the WebSocket handshake with a reply containing HTTP 403 Forbidden status code.</param>
|
||||
<param name="protocol">The application-level protocol that the client want to use(eg. "chat", "leaderboard", etc.). Can be null or empty string if not used.</param>
|
||||
<param name="extensions">Optional <see cref="!:IExtension"/> implementations</param>
|
||||
</member>
|
||||
<member name="M:Best.WebSockets.WebSocket.Open">
|
||||
<summary>
|
||||
Start the opening process.
|
||||
</summary>
|
||||
<remarks>It's a non-blocking call. To get notified when the WebSocket instance is considered open and can send/receive, use the <see cref="F:Best.WebSockets.WebSocket.OnOpen"/> event.</remarks>
|
||||
</member>
|
||||
<member name="M:Best.WebSockets.WebSocket.Send(System.String)">
|
||||
<summary>
|
||||
It will send the given textual message to the remote server.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Best.WebSockets.WebSocket.Send(System.Byte[])">
|
||||
<summary>
|
||||
It will send the given binary message to the remote server.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Best.WebSockets.WebSocket.Send(System.Byte[],System.UInt64,System.UInt64)">
|
||||
<summary>
|
||||
It will send the given binary message to the remote server.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Best.WebSockets.WebSocket.SendAsBinary(Best.HTTP.Shared.PlatformSupport.Memory.BufferSegment)">
|
||||
<summary>
|
||||
Will send the data in one or more binary frame and takes ownership over it calling BufferPool.Release when the data sent.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Best.WebSockets.WebSocket.SendAsText(Best.HTTP.Shared.PlatformSupport.Memory.BufferSegment)">
|
||||
<summary>
|
||||
Will send data as a text frame and takes owenership over the memory region releasing it to the BufferPool as soon as possible.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Best.WebSockets.WebSocket.Close">
|
||||
<summary>
|
||||
It will initiate the closing of the connection to the server.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Best.WebSockets.WebSocket.Close(Best.WebSockets.WebSocketStatusCodes,System.String)">
|
||||
<summary>
|
||||
It will initiate the closing of the connection to the server sending the given code and message.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Best.WebSockets.WebSocketStatusCodes">
|
||||
<summary>
|
||||
<see href="http://tools.ietf.org/html/rfc6455#section-7.4.1"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.NormalClosure">
|
||||
<summary>
|
||||
Indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.GoingAway">
|
||||
<summary>
|
||||
Indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.ProtocolError">
|
||||
<summary>
|
||||
Indicates that an endpoint is terminating the connection due to a protocol error.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.WrongDataType">
|
||||
<summary>
|
||||
Indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept
|
||||
(e.g., an endpoint that understands only text data MAY send this if it receives a binary message).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.Reserved">
|
||||
<summary>
|
||||
Reserved. The specific meaning might be defined in the future.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.NoStatusCode">
|
||||
<summary>
|
||||
A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint.
|
||||
It is designated for use in applications expecting a status code to indicate that no status code was actually present.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.ClosedAbnormally">
|
||||
<summary>
|
||||
A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint.
|
||||
It is designated for use in applications expecting a status code to indicate that the connection was closed abnormally, e.g., without sending or receiving a Close control frame.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.DataError">
|
||||
<summary>
|
||||
Indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [RFC3629] data within a text message).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.PolicyError">
|
||||
<summary>
|
||||
Indicates that an endpoint is terminating the connection because it has received a message that violates its policy.
|
||||
This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.TooBigMessage">
|
||||
<summary>
|
||||
Indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.ExtensionExpected">
|
||||
<summary>
|
||||
Indicates that an endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension,
|
||||
but the server didn't return them in the response message of the WebSocket handshake.
|
||||
The list of extensions that are needed SHOULD appear in the /reason/ part of the Close frame. Note that this status code is not used by the server, because it can fail the WebSocket handshake instead.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.WrongRequest">
|
||||
<summary>
|
||||
Indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:Best.WebSockets.WebSocketStatusCodes.TLSHandshakeError">
|
||||
<summary>
|
||||
A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:UnitySourceGeneratedAssemblyMonoScriptTypes_v1.MonoScriptData">
|
||||
<summary>
|
||||
Data is UTF-8 encoded strings
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
Reference in New Issue
Block a user