카메라 시점 기능 수정
This commit is contained in:
@@ -53,6 +53,7 @@ namespace WI
|
||||
|
||||
public Action<RaycastHit[], Transform> onPerspectiveView;
|
||||
public Action<RaycastHit> onFirstPersonViewRay;
|
||||
public Action<ViewMode> onChangeViewMode;
|
||||
|
||||
public float targetColliderRadius;
|
||||
|
||||
@@ -385,6 +386,7 @@ namespace WI
|
||||
CameraFirstPersonView();
|
||||
break;
|
||||
}
|
||||
onChangeViewMode?.Invoke(viewMode);
|
||||
}
|
||||
public void CameraTopView()
|
||||
{
|
||||
|
||||
@@ -9079,6 +9079,7 @@ Transform:
|
||||
- {fileID: 900828463}
|
||||
- {fileID: 835498836}
|
||||
- {fileID: 548894194}
|
||||
- {fileID: 1431561627}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &49804084
|
||||
@@ -77957,6 +77958,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 516316034}
|
||||
- {fileID: 492436678}
|
||||
m_Father: {fileID: 495533499}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -103103,6 +103105,81 @@ BoxCollider:
|
||||
serializedVersion: 3
|
||||
m_Size: {x: 1.0000001, y: 1, z: 1}
|
||||
m_Center: {x: -0.0000009536743, y: -0.000000059604645, z: 0.0000076293945}
|
||||
--- !u!1 &516316033
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 516316034}
|
||||
- component: {fileID: 516316036}
|
||||
- component: {fileID: 516316035}
|
||||
m_Layer: 5
|
||||
m_Name: Image_Select
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &516316034
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516316033}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 379440002}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 34, y: 34}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &516316035
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516316033}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: abf7a59d5066c4a43baaa762e40bb0aa, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &516316036
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 516316033}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &516625872
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -162411,6 +162488,81 @@ MeshFilter:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 715325438}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!1 &715405378
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 715405379}
|
||||
- component: {fileID: 715405381}
|
||||
- component: {fileID: 715405380}
|
||||
m_Layer: 5
|
||||
m_Name: Image_Select
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &715405379
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 715405378}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1340366680}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 34, y: 34}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &715405380
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 715405378}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: abf7a59d5066c4a43baaa762e40bb0aa, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &715405381
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 715405378}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &715590781
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -308669,6 +308821,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 715405379}
|
||||
- {fileID: 1313698871}
|
||||
m_Father: {fileID: 495533499}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -326579,6 +326732,50 @@ Transform:
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 1431234041}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &1431561626
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1431561627}
|
||||
- component: {fileID: 1431561628}
|
||||
m_Layer: 0
|
||||
m_Name: ViewManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1431561627
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1431561626}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 49225333}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1431561628
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1431561626}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 74b9e0ad948970648bdc18cdbdbb9f4c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1432085803
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -388424,6 +388621,81 @@ MeshFilter:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1735365676}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!1 &1735636044
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1735636045}
|
||||
- component: {fileID: 1735636047}
|
||||
- component: {fileID: 1735636046}
|
||||
m_Layer: 5
|
||||
m_Name: Image_Select
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &1735636045
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1735636044}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1836944051}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 34, y: 34}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1735636046
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1735636044}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: abf7a59d5066c4a43baaa762e40bb0aa, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &1735636047
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1735636044}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1737417192
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -410090,6 +410362,7 @@ RectTransform:
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1735636045}
|
||||
- {fileID: 1776696786}
|
||||
m_Father: {fileID: 495533499}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace CHN
|
||||
public Floor currentFloor;
|
||||
|
||||
public Action<int> onSettingBuildingComplete;
|
||||
public Action<Floor, Vector3> onChangeFloor;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
@@ -65,30 +66,7 @@ namespace CHN
|
||||
pos.y = currentFloor.StartPoint.position.y;
|
||||
controller.SetTargetPos(pos);
|
||||
|
||||
if (currentFloor.isEmptyFloor)
|
||||
{
|
||||
if (controller.viewMode.Equals(ViewMode.FirstPersonView))
|
||||
{
|
||||
controller.SetViewMode(ViewMode.PerspectiveView);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!currentFloor.FloorContainsPoint(controller.option.target.position))
|
||||
{
|
||||
if (controller.viewMode.Equals(ViewMode.FirstPersonView))
|
||||
{
|
||||
controller.SetViewMode(ViewMode.PerspectiveView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SetAllFloorExternalState();
|
||||
|
||||
if (!controller.option.isFirstPersonView)
|
||||
return;
|
||||
|
||||
currentFloor.SetInternalState();
|
||||
onChangeFloor?.Invoke(currentFloor, pos);
|
||||
}
|
||||
|
||||
public Floor GetFloor(int index)
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace CHN
|
||||
var workConditionsManager = FindSingle<WorkConditionsManager>();
|
||||
var workTimeManager = FindSingle<WorkTimeManager>();
|
||||
var highLightManager = FindSingle<HighLighterManager>();
|
||||
var viewManager = FindSingle<ViewManager>();
|
||||
|
||||
var topCanvas = FindSingle<Canvas_Top>();
|
||||
var rightCanvas = FindSingle<Canvas_Right>();
|
||||
@@ -33,7 +34,10 @@ namespace CHN
|
||||
var datamanager = FindSingle<DataManager>();
|
||||
var raycaster = FindSingle<CHNRaycaster>();
|
||||
|
||||
topCanvas.panel_toolbar.onClickCameraView += ChangeCameraView;
|
||||
controller.onChangeViewMode += topCanvas.panel_toolbar.SetChangeViewButtonState;
|
||||
building.onChangeFloor += viewManager.ChangeViewWithFloorControl;
|
||||
|
||||
topCanvas.panel_toolbar.onClickCameraView += viewManager.ChangeViewWithButtonClick;
|
||||
topCanvas.panel_toolbar.onClickDashBoard += popupCanvas.panel_dashboard.Open;
|
||||
topCanvas.panel_toolbar.onClickCustomView += controller.SaveTargetPosition;
|
||||
topCanvas.panel_toolbar.onClickMiniMap += popupCanvas.panel_minimap.SetActive;
|
||||
@@ -163,69 +167,6 @@ namespace CHN
|
||||
controller.option.isFirstPersonView = false;
|
||||
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
|
||||
}
|
||||
private void ChangeCameraView(ViewMode mode)
|
||||
{
|
||||
var preViewMode = controller.viewMode;
|
||||
var preViewModeDistance = controller.option.currentDistance;
|
||||
var preViewModeAzimuth = controller.option.currentAzimuth;
|
||||
var preViewModeElevation = controller.option.currentElevation;
|
||||
|
||||
controller.SetViewMode(mode);
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case ViewMode.PerspectiveView:
|
||||
var perspectivePos = controller.option.target.position;
|
||||
var floorStartPos = building.currentFloor.StartPoint.position;
|
||||
controller.nextPosition = new Vector3(perspectivePos.x, floorStartPos.y, perspectivePos.z);
|
||||
|
||||
building.SetAllFloorExternalState();
|
||||
break;
|
||||
|
||||
case ViewMode.TopView:
|
||||
building.SetAllFloorExternalState();
|
||||
break;
|
||||
|
||||
case ViewMode.FirstPersonView:
|
||||
|
||||
if (building.currentFloor.isEmptyFloor)
|
||||
{
|
||||
controller.SetViewMode(preViewMode);
|
||||
controller.option.currentDistance = preViewModeDistance;
|
||||
controller.option.currentAzimuth = preViewModeAzimuth;
|
||||
controller.option.currentElevation = preViewModeElevation;
|
||||
break;
|
||||
}
|
||||
if (controller.saveTargetPositions[ViewMode.FirstPersonView] == null)
|
||||
{
|
||||
building.SetCurrentFloorInternalState();
|
||||
|
||||
var pos = controller.option.target.position;
|
||||
var startPos = building.currentFloor.StartPoint.position;
|
||||
|
||||
if (building.currentFloor.FloorContainsPoint(pos))
|
||||
{
|
||||
var tourModePos = new Vector3(pos.x, startPos.y, pos.z);
|
||||
controller.option.target.position = tourModePos;
|
||||
controller.nextPosition = tourModePos;
|
||||
break;
|
||||
}
|
||||
|
||||
controller.option.target.position = startPos;
|
||||
controller.nextPosition = startPos;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
var floorIndex = controller.saveTargetPositions[ViewMode.FirstPersonView].floorIndex;
|
||||
var slider = FindSingle<Canvas_Right>().panel_floorcontrol;
|
||||
slider.ChangeValueFromOutside(floorIndex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
controller.LastPositioning(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,11 @@ using RenderHeads.Media.AVProMovieCapture;
|
||||
using System.IO;
|
||||
using SFB;
|
||||
using CHN;
|
||||
using System.Linq;
|
||||
|
||||
public class Panel_ToolBar : PanelBase
|
||||
{
|
||||
private Dictionary<ViewMode, Button> viewButtons = new Dictionary<ViewMode, Button>();
|
||||
public Button Button_TopView;
|
||||
public Button Button_QuarterView;
|
||||
public Button Button_SholuderView;
|
||||
@@ -26,6 +28,7 @@ public class Panel_ToolBar : PanelBase
|
||||
private Image Image_MiniMapActive;
|
||||
private Image Image_FloorControlActive;
|
||||
|
||||
private Button currentViewButton;
|
||||
private CaptureBase capture;
|
||||
|
||||
public Action<ViewMode> onClickCameraView;
|
||||
@@ -47,6 +50,10 @@ public class Panel_ToolBar : PanelBase
|
||||
Button_Capture.onClick.AddListener(OnClickCapture);
|
||||
Button_FloorControl.onClick.AddListener(OnClickFloorControl);
|
||||
|
||||
viewButtons.Add(ViewMode.TopView, Button_TopView);
|
||||
viewButtons.Add(ViewMode.PerspectiveView, Button_QuarterView);
|
||||
viewButtons.Add(ViewMode.FirstPersonView, Button_SholuderView);
|
||||
|
||||
RecordSetting();
|
||||
CaptureSetting();
|
||||
}
|
||||
@@ -168,4 +175,24 @@ public class Panel_ToolBar : PanelBase
|
||||
{
|
||||
onClickCameraView?.Invoke(ViewMode.TopView);
|
||||
}
|
||||
private void SetViewButtonState(Button button)
|
||||
{
|
||||
if (currentViewButton != null)
|
||||
{
|
||||
var images = currentViewButton.GetComponentsInChildren<Image>(true);
|
||||
var image = images.Where(a => a != currentViewButton.image).First();
|
||||
|
||||
image.gameObject.SetActive(false);
|
||||
}
|
||||
currentViewButton = button;
|
||||
var currentButtonImages = currentViewButton.GetComponentsInChildren<Image>(true);
|
||||
var currentButtonImage = currentButtonImages.Where(a => a != currentViewButton.image).First();
|
||||
|
||||
currentButtonImage.gameObject.SetActive(true);
|
||||
}
|
||||
public void SetChangeViewButtonState(ViewMode viewMode)
|
||||
{
|
||||
var viewButton = viewButtons[viewMode];
|
||||
SetViewButtonState(viewButton);
|
||||
}
|
||||
}
|
||||
|
||||
132
Assets/WorkSpace/Personal/JYM/ViewManager.cs
Normal file
132
Assets/WorkSpace/Personal/JYM/ViewManager.cs
Normal file
@@ -0,0 +1,132 @@
|
||||
using CHN;
|
||||
using UnityEngine;
|
||||
using WI;
|
||||
|
||||
public class ViewManager : MonoBehaviour, ISingle
|
||||
{
|
||||
private Building building;
|
||||
private OrbitalController controller;
|
||||
private ViewMode preViewMode;
|
||||
public override void AfterAwake()
|
||||
{
|
||||
building = FindSingle<Building>();
|
||||
controller = FindSingle<OrbitalController>();
|
||||
}
|
||||
public void ChangeViewWithButtonClick(ViewMode mode)
|
||||
{
|
||||
preViewMode = controller.viewMode;
|
||||
controller.SetViewMode(mode);
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case ViewMode.PerspectiveView:
|
||||
SetPerPerspectiveView();
|
||||
break;
|
||||
|
||||
case ViewMode.TopView:
|
||||
SetTopView();
|
||||
break;
|
||||
|
||||
case ViewMode.FirstPersonView:
|
||||
SetFirstPersonView(preViewMode);
|
||||
break;
|
||||
}
|
||||
controller.LastPositioning(true);
|
||||
}
|
||||
private void SetPerPerspectiveView()
|
||||
{
|
||||
if(controller.saveTargetPositions[ViewMode.PerspectiveView] == null)
|
||||
{
|
||||
var perspectivePos = controller.option.target.position;
|
||||
var floorStartPos = building.currentFloor.StartPoint.position;
|
||||
|
||||
var newPos = new Vector3(perspectivePos.x, floorStartPos.y, perspectivePos.z);
|
||||
controller.nextPosition = newPos;
|
||||
|
||||
building.SetAllFloorExternalState();
|
||||
}
|
||||
else
|
||||
{
|
||||
building.SetAllFloorExternalState();
|
||||
|
||||
var floorIndex = controller.saveTargetPositions[ViewMode.PerspectiveView].floorIndex;
|
||||
var slider = FindSingle<Canvas_Right>().panel_floorcontrol;
|
||||
slider.ChangeValueFromOutside(floorIndex);
|
||||
}
|
||||
}
|
||||
private void SetTopView()
|
||||
{
|
||||
if (controller.saveTargetPositions[ViewMode.TopView] == null)
|
||||
{
|
||||
building.SetAllFloorExternalState();
|
||||
}
|
||||
else
|
||||
{
|
||||
building.SetAllFloorExternalState();
|
||||
|
||||
var floorIndex = controller.saveTargetPositions[ViewMode.TopView].floorIndex;
|
||||
var slider = FindSingle<Canvas_Right>().panel_floorcontrol;
|
||||
slider.ChangeValueFromOutside(floorIndex);
|
||||
}
|
||||
}
|
||||
private void SetFirstPersonView(ViewMode preViewMode)
|
||||
{
|
||||
if (building.currentFloor.isEmptyFloor)
|
||||
{
|
||||
controller.SetViewMode(preViewMode);
|
||||
return;
|
||||
}
|
||||
if (controller.saveTargetPositions[ViewMode.FirstPersonView] == null)
|
||||
{
|
||||
building.SetCurrentFloorInternalState();
|
||||
|
||||
var pos = controller.option.target.position;
|
||||
var startPos = building.currentFloor.StartPoint.position;
|
||||
|
||||
if (building.currentFloor.FloorContainsPoint(pos))
|
||||
{
|
||||
var tourModePos = new Vector3(pos.x, startPos.y, pos.z);
|
||||
startPos = tourModePos;
|
||||
}
|
||||
controller.nextPosition = startPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
building.SetCurrentFloorInternalState();
|
||||
|
||||
var floorIndex = controller.saveTargetPositions[ViewMode.FirstPersonView].floorIndex;
|
||||
var slider = FindSingle<Canvas_Right>().panel_floorcontrol;
|
||||
slider.ChangeValueFromOutside(floorIndex);
|
||||
}
|
||||
}
|
||||
public void ChangeViewWithFloorControl(Floor currentFloor, Vector3 pos)
|
||||
{
|
||||
var startPos = building.currentFloor.StartPoint.position;
|
||||
|
||||
if (currentFloor.isEmptyFloor)
|
||||
{
|
||||
if (controller.viewMode.Equals(ViewMode.FirstPersonView))
|
||||
{
|
||||
controller.SetViewMode(ViewMode.PerspectiveView);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!currentFloor.FloorContainsPoint(controller.option.target.position))
|
||||
{
|
||||
if (controller.viewMode.Equals(ViewMode.FirstPersonView))
|
||||
{
|
||||
controller.nextPosition = startPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
building.SetAllFloorExternalState();
|
||||
|
||||
if (!controller.option.isFirstPersonView)
|
||||
return;
|
||||
|
||||
currentFloor.SetInternalState();
|
||||
controller.LastPositioning(true);
|
||||
}
|
||||
}
|
||||
2
Assets/WorkSpace/Personal/JYM/ViewManager.cs.meta
Normal file
2
Assets/WorkSpace/Personal/JYM/ViewManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74b9e0ad948970648bdc18cdbdbb9f4c
|
||||
@@ -257,7 +257,7 @@
|
||||
"worknm": "Injector No.08",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "금형고장",
|
||||
"itemcd": "WP135-GE200",
|
||||
"itemdesc": "INLET-TUBE ASSY W/P",
|
||||
"pjtcd": "GME T4",
|
||||
@@ -922,7 +922,7 @@
|
||||
"worknm": "GF6 C/VB LINE-1",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "비가동",
|
||||
"itemcd": "24295087",
|
||||
"itemdesc": "COVER ASM-C/VLV BODY",
|
||||
"pjtcd": "GF6",
|
||||
@@ -957,7 +957,7 @@
|
||||
"worknm": "GF9 C/VB LINE",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "비가동",
|
||||
"itemcd": "24049859-GMA",
|
||||
"itemdesc": "COVER ASM-C/VLV BODY",
|
||||
"pjtcd": "GF9",
|
||||
@@ -992,7 +992,7 @@
|
||||
"worknm": "CVT C/VB LINE",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "비가동",
|
||||
"itemcd": "24052991",
|
||||
"itemdesc": "COVER ASM-C/VLV BODY",
|
||||
"pjtcd": "CVT",
|
||||
@@ -1027,7 +1027,7 @@
|
||||
"worknm": "OIL DEFLECTOR",
|
||||
"workseq": "1",
|
||||
"status": "4",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "비가동",
|
||||
"itemcd": "00000000",
|
||||
"itemdesc": "None",
|
||||
"pjtcd": "None",
|
||||
@@ -1062,7 +1062,7 @@
|
||||
"worknm": "SGE W/O LINE",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "비가동",
|
||||
"itemcd": "12707589-GMA",
|
||||
"itemdesc": "OUTLET ASM – WATER",
|
||||
"pjtcd": "SGE",
|
||||
@@ -1097,7 +1097,7 @@
|
||||
"worknm": "CSS W/O LINE",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "비가동",
|
||||
"itemcd": "55513502",
|
||||
"itemdesc": "OUTLET ASM-WAT",
|
||||
"pjtcd": "CSS PRIME",
|
||||
@@ -1132,7 +1132,7 @@
|
||||
"worknm": "U/SONIC WELD-1",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "비가동",
|
||||
"itemcd": "24051088-KOR",
|
||||
"itemdesc": "SCOOP ASM-DRV LINK LUB",
|
||||
"pjtcd": "GF6",
|
||||
@@ -1167,7 +1167,7 @@
|
||||
"worknm": "U/SONIC WELD-2",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "비가동",
|
||||
"itemcd": "24298736",
|
||||
"itemdesc": "SCOOP ASM-DRV LINK LUB",
|
||||
"pjtcd": "GF9",
|
||||
@@ -1272,7 +1272,7 @@
|
||||
"worknm": "INSULATOR-ENG FFRT CVR",
|
||||
"workseq": "1",
|
||||
"status": "4",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "비가동",
|
||||
"itemcd": "00000000",
|
||||
"itemdesc": "None",
|
||||
"pjtcd": "None",
|
||||
@@ -1412,7 +1412,7 @@
|
||||
"worknm": "최종검사-02",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "휴식시간",
|
||||
"itemcd": "42748260-KOR",
|
||||
"itemdesc": "BRACKET-WIRELESS CHARGING SYS MDL",
|
||||
"pjtcd": "9BQX",
|
||||
@@ -1430,7 +1430,7 @@
|
||||
"sttm": "0826",
|
||||
"totm": "",
|
||||
"goaltime": "214",
|
||||
"ptotm": "2025-04-09 10:15:18",
|
||||
"ptotm": "2025-04-09 16:05:15",
|
||||
"psttm": "2025-04-03 08:26:00"
|
||||
},
|
||||
"isCheck": false
|
||||
@@ -1465,7 +1465,7 @@
|
||||
"sttm": "1043",
|
||||
"totm": "",
|
||||
"goaltime": "299",
|
||||
"ptotm": "2025-04-09 12:32:17",
|
||||
"ptotm": "2025-04-09 15:13:09",
|
||||
"psttm": "2025-04-03 10:43:18"
|
||||
},
|
||||
"isCheck": false
|
||||
@@ -1482,7 +1482,7 @@
|
||||
"worknm": "최종검사-07",
|
||||
"workseq": "2",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "휴식시간",
|
||||
"itemcd": "24299053-KOR",
|
||||
"itemdesc": "BAFFLE-FRT DIFF CARR",
|
||||
"pjtcd": "GF6 GEN3",
|
||||
@@ -1517,7 +1517,7 @@
|
||||
"worknm": "최종검사-08",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "휴식시간",
|
||||
"itemcd": "24298738-GMA",
|
||||
"itemdesc": "BAFFLE ASM-FRT DIFF CARR",
|
||||
"pjtcd": "GF9",
|
||||
@@ -1552,7 +1552,7 @@
|
||||
"worknm": "최종검사-09",
|
||||
"workseq": "2",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "휴식시간",
|
||||
"itemcd": "24299051-KOR",
|
||||
"itemdesc": "BAFFLE-FRT DIFF CARR",
|
||||
"pjtcd": "GF6 GEN3",
|
||||
@@ -1587,7 +1587,7 @@
|
||||
"worknm": "최종검사-10",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "휴식시간",
|
||||
"itemcd": "24298738-GMA",
|
||||
"itemdesc": "BAFFLE ASM-FRT DIFF CARR",
|
||||
"pjtcd": "GF9",
|
||||
@@ -1657,7 +1657,7 @@
|
||||
"worknm": "최종검사-06",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "휴식시간",
|
||||
"itemcd": "24299058-KOR",
|
||||
"itemdesc": "BAFFLE-FRT DIFF CARR",
|
||||
"pjtcd": "GF6 GEN3",
|
||||
@@ -1675,7 +1675,7 @@
|
||||
"sttm": "0905",
|
||||
"totm": "",
|
||||
"goaltime": "111",
|
||||
"ptotm": "2025-04-09 09:13:15",
|
||||
"ptotm": "2025-04-09 16:29:36",
|
||||
"psttm": "2025-04-07 09:05:21"
|
||||
},
|
||||
"isCheck": false
|
||||
@@ -1692,7 +1692,7 @@
|
||||
"worknm": "최종검사-11",
|
||||
"workseq": "2",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "휴식시간",
|
||||
"itemcd": "24298737-GMA",
|
||||
"itemdesc": "BAFFLE ASM-FRT DIFF CARR",
|
||||
"pjtcd": "GF9",
|
||||
@@ -1727,7 +1727,7 @@
|
||||
"worknm": "최종검사-05",
|
||||
"workseq": "1",
|
||||
"status": "1",
|
||||
"statusnm": "가동중",
|
||||
"statusnm": "휴식시간",
|
||||
"itemcd": "24298739-GMA",
|
||||
"itemdesc": "BAFFLE ASM-FRT DIFF CARR",
|
||||
"pjtcd": "GF9",
|
||||
|
||||
Reference in New Issue
Block a user