[정영민] 천일 오류 수정

26-01-23
- Resources Load 오류 수정
- Camera 기능 수정 및 위치 저장 기능 통합
- 층 StartPoint 찾지 못하는 오류 수정
This commit is contained in:
정영민
2026-01-23 12:58:43 +09:00
parent 3875f6f36b
commit a5b3c9a1e8
52 changed files with 740 additions and 2581 deletions

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d10fcd63c1ede73469cd22e78a9cec4d guid: 6451148b055de754fb30fc15d65fe211
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

View File

@@ -1,341 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2656137905910655519
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3640034311448942995}
- component: {fileID: 1502361923454310464}
- component: {fileID: 8226876023088850677}
m_Layer: 0
m_Name: PRF_ControllerViewTarget
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3640034311448942995
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2656137905910655519}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -20, y: 27, z: -20}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 135340969371884068}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1502361923454310464
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2656137905910655519}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eab1a07f8f5c6754a8f2a9789fb6b020, type: 3}
m_Name:
m_EditorClassIdentifier:
alwaysActive: 0
active: 0
--- !u!135 &8226876023088850677
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2656137905910655519}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.25
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &4602595839876627761
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7888456699290281049}
- component: {fileID: 1769739476192758786}
- component: {fileID: 2795261250788500754}
- component: {fileID: 6689677178373688372}
- component: {fileID: 6315610840044275566}
m_Layer: 10
m_Name: Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7888456699290281049
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4602595839876627761}
serializedVersion: 2
m_LocalRotation: {x: 0.35355338, y: 0.35355338, z: -0.1464466, w: 0.8535535}
m_LocalPosition: {x: -45, y: 62.35534, z: -45}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 135340969371884068}
m_LocalEulerAnglesHint: {x: 45, y: 45, z: 0}
--- !u!20 &1769739476192758786
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4602595839876627761}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!114 &2795261250788500754
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4602595839876627761}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fafd8d68ae7258c4485adb2fffef3373, type: 3}
m_Name:
m_EditorClassIdentifier:
camera: {fileID: 0}
option: {fileID: 11400000, guid: 0443d35219f9d1646a57d550cc10e2b9, type: 2}
nextPosition: {x: 0, y: 0, z: 0}
saveTargetPositions:
datas: []
maxValue: 0
duration_MoveToCamera: 5
speed_MoveToCamera: 1
process: 0
yUpPos: 0
runSpeed: 0
up: 119
down: 115
left: 97
right: 100
run: 304
targetVisualization: 306
viewMode: 2
targetColliderRadius: 0
--- !u!136 &6689677178373688372
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4602595839876627761}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Height: 1
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &6315610840044275566
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4602595839876627761}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 0
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_AllowHDROutput: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
m_TaaSettings:
m_Quality: 3
m_FrameInfluence: 0.1
m_JitterScale: 1
m_MipBias: 0
m_VarianceClampScale: 0.9
m_ContrastAdaptiveSharpening: 0
--- !u!1 &8457166540169997683
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3282114688579573793}
- component: {fileID: 2097398073062650089}
m_Layer: 0
m_Name: MaxRange
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3282114688579573793
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8457166540169997683}
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: 135340969371884068}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &2097398073062650089
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8457166540169997683}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 100, y: 40, z: 100}
m_Center: {x: 0, y: 15, z: 0}
--- !u!1 &9065749286782967344
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 135340969371884068}
m_Layer: 0
m_Name: Controller
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &135340969371884068
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9065749286782967344}
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:
- {fileID: 3640034311448942995}
- {fileID: 3282114688579573793}
- {fileID: 7888456699290281049}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: e8aa14877be9b924882fcad9d88abe46
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,131 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.EventSystems;
namespace WI
{
public enum ViewMode
{
None,
TopView,
PerspectiveView,
FirstPersonView,
}
//TODO::Eat Viewmode
[RequireComponent(typeof(Camera))]
public abstract class GenericController : MonoBehaviour
{
public new Camera camera;
public GenericControllerOption option;
public MaxRangeLimitter maxRangeLimitter = new();
protected Vector3 moveVector;
protected Vector3 cameraPosition;
public Vector3 nextPosition;
public override void AfterAwake()
{
camera = GetComponent<Camera>();
option.Apply(this);
Collider MaxRange = transform.parent.Find(nameof(MaxRange)).GetComponent<BoxCollider>();
maxRangeLimitter.SetRange(MaxRange);
}
public virtual void Movement()
{
Move();
Zoom();
Rotate();
}
protected abstract void Move();
protected abstract void Zoom();
protected abstract void Rotate();
public abstract void LastPositioning(bool limit);
public abstract void Rewind();
protected UserInput input;
public bool IsClickUI
{
get
{
bool result = false;
if (Input.GetMouseButtonDown(0))
{
result = EventSystem.current.IsPointerOverGameObject();
}
return result;
}
}
public bool IsOnTheUI
{
get
{
if (IsPointerOverExcludedUI())
{
return false;
}
else
{
var result = EventSystem.current.IsPointerOverGameObject();
return result;
}
}
}
bool IsPointerOverExcludedUI()
{
PointerEventData pointerData = new PointerEventData(EventSystem.current);
pointerData.position = Input.mousePosition;
List<RaycastResult> raycastResults = new List<RaycastResult>();
EventSystem.current.RaycastAll(pointerData, raycastResults);
if (raycastResults.Count > 0)
{
if ((LayerMask.GetMask("Default") & (1 << raycastResults[0].gameObject.layer)) != 0)
{
return true;
}
}
return false;
}
bool isPressed;
protected virtual void LateUpdate()
{
if (IsPressedUI())
return;
if (IsClickUI)
return;
if (IsOnTheUI)
return;
input.GetInput();
Movement();
var limitCheck = maxRangeLimitter.MoveRangeLimit(nextPosition);
LastPositioning(limitCheck);
}
private bool IsPressedUI()
{
if (Input.GetMouseButtonDown(0))
{
if (EventSystem.current.IsPointerOverGameObject())
{
isPressed = true;
}
}
if (Input.GetMouseButtonUp(0))
{
isPressed = false;
}
return isPressed;
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ffea721820281784f8195cdaac4c6c68
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,78 +0,0 @@
using System;
using UnityEngine;
namespace WI
{
public abstract class GenericControllerOption : ScriptableObject, ISerializationCallbackReceiver
{
[SerializeField]bool _orthographic;
[SerializeField]float _moveSensivity;
[SerializeField]float _zoomSensivity;
[SerializeField]float _rotateSensivity;
[SerializeField]float _moveSpeed;
[SerializeField]float _zoomSpeed;
[SerializeField]float _rotateSpeed;
[SerializeField]float _fieldOfView;
[SerializeField]bool _moveLimit;
[SerializeField]bool _rotateLimit;
[SerializeField]bool _azimuthRotateLimit;
[SerializeField]bool _elevationRotateLimit;
[SerializeField] bool _isFirstPersonView;
/**initialize Values*/
[NonSerialized]
public bool orthographic;
[NonSerialized]
public float moveSensivity;
[NonSerialized]
public float zoomSensivity;
[NonSerialized]
public float rotateSensivity;
[NonSerialized]
public float moveSpeed;
[NonSerialized]
public float zoomSpeed;
[NonSerialized]
public float rotateSpeed;
[NonSerialized]
public float fieldOfView;
[NonSerialized]
public bool moveLimit;
[NonSerialized]
public bool rotateLimit;
[NonSerialized]
public bool azimuthRotateLimit;
[NonSerialized]
public bool elevationRotateLimit;
[NonSerialized]
public bool isFirstPersonView;
public virtual void OnAfterDeserialize()
{
orthographic = _orthographic;
moveSensivity = _moveSensivity;
zoomSensivity = _zoomSensivity;
rotateSensivity = _rotateSensivity;
moveSpeed = _moveSpeed;
zoomSpeed = _zoomSpeed;
rotateSpeed = _rotateSpeed;
fieldOfView = _fieldOfView;
moveLimit = _moveLimit;
rotateLimit = _rotateLimit;
azimuthRotateLimit = _azimuthRotateLimit;
elevationRotateLimit = _elevationRotateLimit;
isFirstPersonView = _isFirstPersonView;
}
public virtual void Apply(GenericController controller)
{
controller.camera.orthographic = orthographic;
controller.camera.fieldOfView = fieldOfView;
}
public void OnBeforeSerialize()
{
//throw new NotImplementedException();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 0f577bf79af2c134a872981610d2806d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,28 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace WI
{
public class MaxRangeLimitter
{
public Collider maxRange;
public void SetRange(Collider maxrRangeCollider)
{
maxRange = maxrRangeCollider;
}
public bool MoveRangeLimit(Vector3 pos)
{
if (maxRange == null)
return false;
if (maxRange.bounds.Contains(pos))
{
return true;
}
return false;
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c74d6b8e9cbe1514f80fb2384ea51e38
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,43 +0,0 @@
%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: 0d55d555ae3a31a439ca5986c6199986, type: 3}
m_Name: OrbitalControllerOption
m_EditorClassIdentifier:
_orthographic: 0
_moveSensivity: 0.5
_zoomSensivity: 1
_rotateSensivity: 10
_moveSpeed: 2
_zoomSpeed: 30
_rotateSpeed: 5
_fieldOfView: 60
_moveLimit: 0
_rotateLimit: 0
_azimuthRotateLimit: 0
_elevationRotateLimit: 0
_isFirstPersonView: 0
originElevation: 28.5
currentElevation: 45
elevationSensivity: 15
minElevation: 5
maxElevation: 90
originAzimuth: 133
currentAzimuth: 35
azimuthSensivity: 15
maxDistance: 60
minDistance: 5
moveClamper: 0.17225535
originDistance: 40
originTargetPos: {x: 9.714996, y: 57.3, z: 236.99342}
originTargetRot: {x: -0, y: 0, z: 0}
currentDistance: 10.335321
target: {fileID: 0}

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 0443d35219f9d1646a57d550cc10e2b9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,16 +0,0 @@
namespace WI
{
[System.Serializable]
public class CameraEntity
{
public float x;
public float y;
public float z;
public float distance;
public float elevation;
public float azimuth;
public int floorIndex;
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: db7ea094b0ebba741893718f5fbfcbaa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
@@ -6,498 +6,233 @@ using UnityEngine.EventSystems;
namespace WI namespace WI
{ {
//TODO::Something... Util Functions public enum ViewMode
public class OrbitalController : GenericController, ISingle, IOptionable
{ {
public new OrbitalControllerOption option => base.option as OrbitalControllerOption; PerspectiveView,
public SDictionary<ViewMode, CameraEntity> saveTargetPositions = new SDictionary<ViewMode, CameraEntity>(); TopView
}
public Action<int> ZoomInOutEvent; public struct OrbitState
public int maxValue; {
public float duration_MoveToCamera; public float elevation;
public float speed_MoveToCamera; public float distance;
public float process; public float azimuth;
public float yUpPos; public Vector3 pivotPosition;
public float runSpeed; }
float timer;
[OptionSection]
string controllerOption;
[OptionKey]
string MoveSpeed="2";
[OptionKey]
string ZoomSpeed = "30";
[OptionKey]
string RotateSpeed ="5";
[OptionKey]
string FORWARD="W";
[OptionKey]
string BACKWARD="S";
[OptionKey]
string LEFT="A";
[OptionKey]
string RIGHT = "D";
[OptionKey]
string RUN = "LeftShift";
[OptionKey]
string TargetVisualization = "LeftControl";
public KeyCode up;
public KeyCode down;
public KeyCode left;
public KeyCode right;
public KeyCode run;
public KeyCode targetVisualization;
//TODO::Something... Util Functions
public class OrbitalController : MonoBehaviour, ISingle
{
public ViewMode viewMode; public ViewMode viewMode;
private Vector3 originValue;
private Vector3 originTargetPos;
private OrbitState perspectiveState;
private OrbitState orthoState;
private new Camera camera;
public float moveSpeed;
public float rotateSpeed;
public float zoomSpeed;
public float maxElevation;
public float minElevation;
public float minDistance;
public float maxDistance;
public float currentElevation;
public float currentDistance;
public float currentAzimuth;
private Vector3 cameraPosition;
private Vector3 nextPosition;
public OrbitalControllerTarget cameraPivot;
private UserInput input;
public Action<RaycastHit[], Transform> onPerspectiveView;
public Action<RaycastHit> onFirstPersonViewRay;
public Action<ViewMode> onChangeViewMode; public Action<ViewMode> onChangeViewMode;
public float targetColliderRadius; public void Awake()
public override void AfterAwake()
{ {
base.AfterAwake(); camera = Camera.main;
cameraPivot = transform.GetComponentInChildren<OrbitalControllerTarget>();
}
void Start()
{
originValue.x = currentElevation;
originValue.y = currentDistance;
originValue.z = currentAzimuth;
targetColliderRadius = option.target.GetComponent<SphereCollider>().radius; nextPosition = cameraPivot.transform.position;
originTargetPos = cameraPivot.transform.position;
perspectiveState.elevation = originValue.x;
perspectiveState.distance = originValue.y;
perspectiveState.azimuth = originValue.z;
perspectiveState.pivotPosition = originTargetPos;
orthoState.elevation = 90f;
orthoState.distance = originValue.y;
orthoState.azimuth = originValue.z;
orthoState.pivotPosition = originTargetPos;
foreach(ViewMode mode in Enum.GetValues(typeof(ViewMode)))
{
saveTargetPositions.Add(mode, null);
}
SetViewMode(ViewMode.PerspectiveView); SetViewMode(ViewMode.PerspectiveView);
} }
public override void AfterStart() private void LateUpdate()
{ {
SetControllOptionValue(); input.GetInput();
Movement();
} }
public void SetControllOptionValue() public void Movement()
{ {
option.moveSpeed = float.Parse(MoveSpeed);
option.zoomSpeed = float.Parse(ZoomSpeed);
option.rotateSpeed = float.Parse(RotateSpeed);
runSpeed = option.moveSpeed * 1.5f;
up = (KeyCode)Enum.Parse(typeof(KeyCode), FORWARD);
down = (KeyCode)Enum.Parse(typeof(KeyCode), BACKWARD);
left = (KeyCode)Enum.Parse(typeof(KeyCode), LEFT);
right = (KeyCode)Enum.Parse(typeof(KeyCode), RIGHT);
run = (KeyCode)Enum.Parse(typeof(KeyCode), RUN);
targetVisualization = (KeyCode)Enum.Parse(typeof(KeyCode), TargetVisualization);
}
public override void Movement()
{
nextPosition = option.target.position;
Zoom(); Zoom();
Rotate(); Rotate();
Move(); Move();
//FindLookAtObject();
LastPositioning();
} }
protected override void Move() private void Move()
{ {
if (option.moveLimit) if (!input.leftClick)
{ {
return; return;
} }
if (option.isFirstPersonView) var delta = new Vector2(input.mouseX, input.mouseY);
{ var x = delta.x;
float keyboardX = 0; var y = delta.y * ((maxElevation - minElevation) / currentElevation);
float keyboardY = 0; var z = delta.y * ((minElevation - currentElevation) / maxElevation);
if (Input.GetKey(up)) var moveVector = camera.transform.TransformDirection(x, y, -z);
{ moveVector.y = 0;
keyboardY = 1;
}
if (Input.GetKey(down))
{
keyboardY = -1;
}
if (Input.GetKey(left))
{
keyboardX = -1;
}
if (Input.GetKey(right))
{
keyboardX = 1;
}
float moveSpeed; moveVector *= moveSpeed * (currentDistance / maxDistance);
if (Input.GetKey(run)) nextPosition = cameraPivot.transform.position - moveVector;
{
moveSpeed = runSpeed * 2.5f;
}
else
{
moveSpeed = option.moveSpeed * 2.5f;
}
moveVector = transform.TransformDirection(keyboardX, 0, keyboardY);
moveVector.y = 0;
var t = option.currentDistance / option.maxDistance;
option.moveClamper = Mathf.Min(t, 1f);
moveVector = moveVector.normalized * moveSpeed * Time.unscaledDeltaTime;
nextPosition = CalculateMovePosition(option.target.position, moveVector);
}
else
{
if (!input.leftClick)
{
return;
}
moveVector = Vector3.zero;
var mouseYsen = input.mouseY * option.elevationSensivity;
float y = mouseYsen * ((option.maxElevation - option.minElevation) / option.currentElevation);
float z = mouseYsen * ((option.minElevation - option.currentElevation) / option.maxElevation);
moveVector = transform.TransformDirection(input.mouseX * option.elevationSensivity, y, z);
moveVector.y = 0;
var t = option.currentDistance / option.maxDistance;
option.moveClamper = Mathf.Min(t, 1f);
moveVector *= option.moveClamper * option.moveSpeed * option.moveSensivity;
nextPosition = option.target.position - moveVector;
}
} }
Vector3 CalculateMovePosition(Vector3 origPos, Vector3 moveVec) private void Zoom()
{ {
if (moveVec == Vector3.zero) var nextDistance = currentDistance - input.mouseWheel * zoomSpeed;
return origPos; currentDistance = Mathf.Lerp(currentDistance, nextDistance, zoomSpeed * Time.deltaTime);
currentDistance = Mathf.Clamp(currentDistance, minDistance, maxDistance);
float moveDist = moveVec.magnitude; camera.orthographicSize = currentDistance;
Vector3 destPos = origPos + moveVec;
int wallMask = LayerMask.GetMask("Floor Wall");
Collider[] hitColliders = Physics.OverlapSphere(destPos, targetColliderRadius, wallMask);
if (hitColliders.Length > 0)
{
RaycastHit[] raycastHits = Physics.SphereCastAll(origPos, targetColliderRadius, moveVec, moveDist + 0.11f, wallMask);
if (raycastHits.Length > 0)
{
foreach (RaycastHit hit in raycastHits)
{
moveVec -= hit.normal * Vector3.Dot(hit.normal, moveVec);
}
}
}
return origPos + moveVec;
} }
protected override void Zoom() protected void Rotate()
{ {
if (option.isFirstPersonView)
return;
camera.orthographicSize = camera.orthographic ? option.currentDistance : 0f;
var nextDistance = option.currentDistance - input.mouseWheel * option.zoomSpeed;
option.currentDistance = Mathf.Lerp(option.currentDistance, nextDistance, option.zoomSpeed * Time.deltaTime);
option.currentDistance = Mathf.Clamp(option.currentDistance, option.minDistance, option.maxDistance);
camera.orthographicSize = Mathf.Clamp(option.currentDistance, option.minDistance, option.maxDistance);
var syncValue = -(maxValue * (option.currentDistance - option.maxDistance) / option.maxDistance);
ZoomInOutEvent?.Invoke(Mathf.RoundToInt(syncValue));
}
//TODO:: Into Member Methods... anywhere
public void SliderZoomInOut(int value)
{
camera.orthographicSize = camera.orthographic ? option.currentDistance : 0f;
var nextDistance = option.maxDistance - (option.maxDistance / maxValue * value);
var lerpDistance = Mathf.Lerp(option.currentDistance, nextDistance, option.zoomSpeed * Time.deltaTime);
option.currentDistance = Mathf.Clamp(lerpDistance, option.minDistance, option.maxDistance);
camera.orthographicSize = Mathf.Clamp(option.currentDistance, option.minDistance, option.maxDistance);
}
protected override void Rotate()
{
if (option.rotateLimit)
return;
if (!input.rightClick) if (!input.rightClick)
return; return;
if (option.isFirstPersonView) currentAzimuth += input.mouseX * rotateSpeed;
{ currentAzimuth %= 360;
option.currentAzimuth += input.mouseX * option.rotateSpeed;
option.currentAzimuth %= 360;
option.currentElevation += input.mouseY * option.rotateSpeed; if(viewMode == ViewMode.PerspectiveView)
option.currentElevation = Mathf.Clamp(option.currentElevation, -35f, 75f); {
currentElevation -= input.mouseY * rotateSpeed;
currentElevation = Mathf.Clamp(currentElevation, minElevation, maxElevation);
}
}
public void LastPositioning()
{
cameraPivot.transform.position = nextPosition;
var dist = new Vector3(0, 0, -currentDistance);
var distPos = Quaternion.Euler(currentElevation, currentAzimuth, 0f) * dist;
cameraPosition = nextPosition + distPos;
camera.transform.position = cameraPosition;
if (currentElevation <= 90f)
{
camera.transform.rotation = Quaternion.Euler(currentElevation, currentAzimuth, 0f);
} }
else else
{ {
AzimuthControl(); camera.transform.LookAt(cameraPivot.transform);
ElevationControl();
}
}
protected void AzimuthControl()
{
if (option.azimuthRotateLimit)
return;
option.currentAzimuth += input.mouseX * option.rotateSpeed;
option.currentAzimuth %= 360;
}
protected void ElevationControl()
{
if (option.orthographic)
return;
if (option.elevationRotateLimit)
return;
option.currentElevation -= input.mouseY * option.rotateSpeed;
option.currentElevation = Mathf.Clamp(option.currentElevation, option.minElevation, option.maxElevation);
}
public override void LastPositioning(bool limit)
{
if (!limit)
return;
if (option.isFirstPersonView)
{
option.target.position = nextPosition;
cameraPosition = nextPosition;
camera.transform.position = cameraPosition;
transform.eulerAngles = new Vector3(-option.currentElevation, option.currentAzimuth, 0);
}
else
{
option.target.position = nextPosition;
var dist = new Vector3(0, 0, -option.currentDistance);
var distPos = Quaternion.Euler(option.currentElevation, option.currentAzimuth, 0f) * dist;
cameraPosition = nextPosition + distPos;
camera.transform.position = cameraPosition;
camera.orthographicSize = Mathf.Clamp(option.currentDistance, option.minDistance, option.maxDistance);
if (option.currentElevation <= 90f)
{
camera.transform.rotation = Quaternion.Euler(option.currentElevation, option.currentAzimuth, 0f);
}
else
{
camera.transform.LookAt(option.target);
}
} }
} }
public override void Rewind() public void Rewind()
{ {
option.target.position = option.originTargetPos; SetViewMode(ViewMode.PerspectiveView);
option.target.eulerAngles = option.originTargetRot; nextPosition = originTargetPos;
option.currentDistance = option.originDistance;
option.currentElevation = option.originElevation;
option.currentAzimuth = option.originAzimuth;
var dist = new Vector3(0, 0, -option.currentDistance);
var distPos = Quaternion.Euler(option.currentElevation, option.currentAzimuth, 0f) * dist;
cameraPosition = option.target.position + distPos;
camera.transform.position = cameraPosition;
camera.transform.LookAt(option.target);
}
void ProcessWinding() currentDistance = originValue.x;
{ currentElevation = originValue.y;
if (process > 0f) currentAzimuth = originValue.z;
{
process = 1f - process;
}
}
public void SmoothMove(Vector3 pos, float distance, float elevation, float azimuth)
{
StopAllCoroutines();
StartCoroutine(SmoothMoving(pos, distance, elevation, azimuth));
}
IEnumerator SmoothMoving(Vector3 pos, float distance, float elevation, float azimuth)
{
ProcessWinding();
while (process < 1f)
{
timer += speed_MoveToCamera * Time.deltaTime;
process += timer / duration_MoveToCamera;
MoveToCamera(pos, distance, elevation, azimuth);
yield return null;
}
timer = 0f;
}
void MoveToCamera(Vector3 pos, float distance, float elevation, float azimuth)
{
option.target.position = Vector3.Lerp(option.target.position, pos, process);
option.currentDistance = Mathf.Lerp(option.currentDistance, distance, process);
option.currentElevation = Mathf.LerpAngle(option.currentElevation, elevation, process);
option.currentAzimuth = Mathf.LerpAngle(option.currentAzimuth, azimuth, process);
CameraFix(); LastPositioning();
}
public void CameraFix()
{
//option.target.position = nextPostion;
var dist = new Vector3(0, 0, -option.currentDistance);
//option.outlineCamera.orthographicSize = option.currentDistance;
cameraPosition = option.target.position + Quaternion.Euler(option.currentElevation, option.currentAzimuth, 0f) * dist;
camera.transform.position = cameraPosition;
camera.transform.LookAt(option.target);
} }
public void SetViewMode(ViewMode mode) public void SetViewMode(ViewMode mode)
{ {
if (viewMode == mode)
return;
SaveViewMode(viewMode);
viewMode = mode; viewMode = mode;
switch (mode) switch (mode)
{ {
case ViewMode.None:
break;
case ViewMode.TopView:
camera.orthographic = true;
option.orthographic = true;
option.isFirstPersonView = false;
CameraTopView();
break;
case ViewMode.PerspectiveView: case ViewMode.PerspectiveView:
camera.orthographic = false; SetPerspectiveView();
option.orthographic = false;
option.isFirstPersonView = false;
CameraPerspectiveView();
break; break;
case ViewMode.FirstPersonView:
camera.orthographic = false; case ViewMode.TopView:
option.orthographic = false; SetOrthographicView();
option.isFirstPersonView = true;
CameraFirstPersonView();
break; break;
} }
LastPositioning();
onChangeViewMode?.Invoke(viewMode); onChangeViewMode?.Invoke(viewMode);
} }
public void CameraTopView() private void SetPerspectiveView()
{ {
var saveData = saveTargetPositions[ViewMode.TopView]; camera.orthographic = false;
option.maxDistance = 50f;
if (saveData == null) currentElevation = perspectiveState.elevation; //90 ¾È ¼¯ÀÓ
{ currentDistance = perspectiveState.distance;
nextPosition = new Vector3(52.3f, 47.3f, 209.4f); currentAzimuth = perspectiveState.azimuth;
option.currentElevation = 90f;
option.currentDistance = 35f;
option.currentAzimuth = 0f;
}
else
{
SetCameraData(viewMode);
}
LastPositioning(true); nextPosition = perspectiveState.pivotPosition;
} }
public void CameraFirstPersonView() private void SetOrthographicView()
{ {
var saveData = saveTargetPositions[ViewMode.FirstPersonView]; camera.orthographic = true;
if (saveData == null) currentElevation = orthoState.elevation;
{ currentDistance = orthoState.distance;
camera.transform.position = option.target.position; currentAzimuth = orthoState.azimuth;
option.currentDistance = 5f; camera.orthographicSize = orthoState.distance;
option.currentElevation = 0f;
option.currentAzimuth = 0f;
}
else
{
SetCameraData(viewMode);
}
LastPositioning(true); nextPosition = orthoState.pivotPosition;
} }
public void CameraPerspectiveView()
{
var saveData = saveTargetPositions[ViewMode.PerspectiveView];
option.maxDistance = 60f;
if (saveData == null)
{
option.currentDistance = option.originDistance;
option.currentAzimuth = option.originAzimuth;
option.currentElevation = option.originElevation;
}
else
{
SetCameraData(viewMode);
}
LastPositioning(true);
}
public void SetTargetPos(Vector3 pos) public void SetTargetPos(Vector3 pos)
{ {
nextPosition = pos; nextPosition = pos;
LastPositioning(true); LastPositioning();
} }
private void FindLookAtObject()
private void SaveViewMode(ViewMode mode)
{ {
switch(viewMode) switch (mode)
{ {
case ViewMode.PerspectiveView: case ViewMode.PerspectiveView:
PerspectiveViewCenterRay(); perspectiveState.elevation = currentElevation;
perspectiveState.distance = currentDistance;
perspectiveState.azimuth = currentAzimuth;
perspectiveState.pivotPosition = cameraPivot.transform.position;
break; break;
case ViewMode.FirstPersonView:
FirstPersonViewRay(); case ViewMode.TopView:
orthoState.elevation = 90f; // 90 or °íÁ¤°ª
orthoState.distance = currentDistance;
orthoState.azimuth = currentAzimuth;
orthoState.pivotPosition = cameraPivot.transform.position;
break; break;
} }
} }
private void PerspectiveViewCenterRay()
{
var dir = option.target.position - camera.transform.localPosition;
var distance = Vector3.Distance(option.target.position, camera.transform.localPosition);
var hits = Physics.RaycastAll(camera.transform.position, dir, distance);
//Debug.DrawRay(camera.transform.position, dir * distance, Color.blue);
onPerspectiveView?.Invoke(hits, option.target);
}
private void FirstPersonViewRay()
{
if (Physics.Raycast(camera.transform.position, transform.forward, out RaycastHit hit, Mathf.Infinity))
{
onFirstPersonViewRay?.Invoke(hit);
}
}
public void SaveTargetPosition(int floorIndex)
{
var cameraEntity = new CameraEntity();
cameraEntity.x = option.target.position.x;
cameraEntity.y = option.target.position.y;
cameraEntity.z = option.target.position.z;
cameraEntity.distance = option.currentDistance;
cameraEntity.azimuth = option.currentAzimuth;
cameraEntity.elevation = option.currentElevation;
cameraEntity.floorIndex = floorIndex;
saveTargetPositions[viewMode] = cameraEntity;
}
private void SetCameraData(ViewMode currentViewMode)
{
var cameraData = saveTargetPositions[currentViewMode];
nextPosition = new Vector3(cameraData.x, cameraData.y, cameraData.z);
option.currentDistance = cameraData.distance;
option.currentAzimuth = cameraData.azimuth;
option.currentElevation = cameraData.elevation;
}
} }
} }

View File

@@ -1,50 +0,0 @@
using System;
using UnityEngine;
namespace WI
{
[CreateAssetMenu(fileName = "OrbitalControllerOption", menuName = "GenericControllerOption/OrbitalControllerOption")]
public class OrbitalControllerOption : GenericControllerOption
{
[Header("Elevation")]
public float originElevation;
public float currentElevation;
public float elevationSensivity;
public float minElevation;
public float maxElevation;
[Header("Azimuth")]
public float originAzimuth;
public float currentAzimuth;
public float azimuthSensivity;
public float maxDistance;
public float minDistance;
public float moveClamper;
public float originDistance;
public Vector3 originTargetPos;
public Vector3 originTargetRot;
public float currentDistance;
public Transform target;
//public Camera outlineCamera;
public override void Apply(GenericController controller)
{
target = controller.FindSingle<OrbitalControllerTarget>().transform;
//outlineCamera = FindObjectOfType<OutlineCamera>().outlineCamera;
base.Apply(controller);
originTargetPos = target.position;
originTargetRot = target.eulerAngles;
currentAzimuth = originAzimuth;
currentDistance = originDistance;
currentElevation = originElevation;
//outlineCamera.orthographicSize = originDistance;
}
public override void OnAfterDeserialize()
{
base.OnAfterDeserialize();
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 0d55d555ae3a31a439ca5986c6199986
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,29 +1,21 @@
using System; using System;
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
namespace WI namespace WI
{ {
public class OrbitalControllerTarget : MonoBehaviour, ISingle public class OrbitalControllerTarget : MonoBehaviour
{ {
OrbitalController controller; OrbitalController controller;
OrbitalControllerOption option;
public bool alwaysActive = false;
public bool active = false;
public override void AfterAwake() public void Awake()
{ {
controller = FindSingle<OrbitalController>(); controller = FindAnyObjectByType<OrbitalController>();
option = controller.option;
} }
private void OnTriggerStay(Collider floorWall) private void OnTriggerStay(Collider floorWall)
{ {
if (controller.viewMode != ViewMode.FirstPersonView)
return;
SetPosToOutsideWall(floorWall); SetPosToOutsideWall(floorWall);
} }

View File

@@ -1,12 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace WI
{
public class OutlineCamera : MonoBehaviour
{
public Camera outlineCamera;
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: afa268d7e935a6844be5d4fabd0fed3d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,402 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
#if UNITY_EDITOR
using UnityEditor.Presets;
#endif
using UnityEngine;
using UnityEngine.EventSystems;
namespace WI
{
[DefaultExecutionOrder(int.MinValue)]
public class Raycaster : MonoBehaviour, ISingle
{
PointerEventData pointerEvent = new(EventSystem.current);
List<RaycastResult> uiRaycastResults = new();
RaycastHit[] hitInfo = new RaycastHit[16];
RaycastHit[] tempInfo;
HashSet<Type> typeLayers = new();
Dictionary<Type, Action<RaycastHit, Component>> onExitEvent = new();
Dictionary<Type, Action<RaycastHit, Component>> onStayEvent = new();
Dictionary<Type, Action<RaycastHit, Component>> onEnterEvent = new();
Dictionary<Type, Action<RaycastHit, Component>> onLeftClickEvent = new();
Dictionary<Type, Action<RaycastHit, Component>> onRightClickEvent = new();
Dictionary<Type, Action<RaycastHit, Component>> onLeftClickFirst = new();
Dictionary<Type, Action<RaycastHit, Component>> onRightClickFirst = new();
Dictionary<Type, Action<RaycastHit, Component>> onEnterFirst = new();
Dictionary<Type, Action<RaycastHit, Component>> onStayFirst = new();
Dictionary<Type, Action<RaycastHit, Component>> onExitFirst = new();
bool onLeftClick;
bool onRightClick;
Dictionary<Type, RaycastHit> firstHit = new();
Dictionary<Type, RaycastHit> tempFirstHit = new();
Dictionary<Transform, RaycastHit> fth = new();
int hitCount;
Camera cam;
public RaycastHit hit => hitInfo[0];
HashSet<Transform> hitTransform = new();
HashSet<Transform> tempHit = new();
Dictionary<Transform, RaycastHit> transformToHitinfo = new();
List<(Action<RaycastHit, Component>, RaycastHit, Component)> eventList = new();
public float uiHoverTime;
float uiHoverTimer;
#pragma warning disable IDE0044 // 읽기 전용 한정자 추가
#pragma warning disable CS0649 // 'Raycaster.onUIHoverEvent' 필드에는 할당되지 않으므로 항상 null 기본값을 사용합니다.
Action<RaycastResult> onUIHoverEvent;
#pragma warning restore CS0649
#pragma warning restore IDE0044
GameObject prevOnUI;
void Awake()
{
cam = Camera.main;
}
void Update()
{
UIRaycast();
PhysicsRaycast();
EventInvoking();
}
void EventInvoking()
{
foreach(var e in eventList)
{
e.Item1.Invoke(e.Item2, e.Item3);
}
eventList.Clear();
}
void UIRaycast()
{
pointerEvent.position = Input.mousePosition;
EventSystem.current.RaycastAll(pointerEvent, uiRaycastResults);
if(uiRaycastResults.Count != 0)
{
if (uiRaycastResults[0].gameObject == null)
{
return;
}
if (prevOnUI != uiRaycastResults[0].gameObject)
{
uiHoverTimer = 0f;
prevOnUI = uiRaycastResults[0].gameObject;
}
if (uiHoverTimer >= uiHoverTime)
{
onUIHoverEvent?.Invoke(uiRaycastResults[0]);
}
else
{
uiHoverTimer += Time.deltaTime;
}
}
else
{
prevOnUI = null;
}
}
void PhysicsRaycast()
{
onLeftClick = Input.GetMouseButtonDown(0);
onRightClick = Input.GetMouseButtonDown(1);
Rayfire();
SingleCasting();
MultiCasting();
}
void Rayfire()
{
var ray = cam.ScreenPointToRay(Input.mousePosition);
//Physics.Raycast(ray, out singleHit, Mathf.Infinity);
tempInfo = new RaycastHit[16];
hitCount = Physics.RaycastNonAlloc(ray, tempInfo, Mathf.Infinity);
hitInfo = SortingHitInfos(tempInfo);
}
public bool Casting(LayerMask layer, out RaycastHit hit)
{
hit = new RaycastHit();
if (hitCount == 0)
{
return false;
}
foreach (var h in hitInfo)
{
if (h.transform == null)
continue;
if ((layer.value >> h.transform.gameObject.layer) == 1)
{
hit = h;
return true;
}
}
return false;
}
void SingleCasting(in RaycastHit hitInfo)
{
fth.TryAdd(hitInfo.transform, hitInfo);
foreach (var tl in typeLayers)
{
SingleCasting(hitInfo, tl);
}
}
void SingleCasting(in RaycastHit hitInfo, Type tl)
{
if (tempFirstHit.ContainsKey(tl))
{
return;
}
if (!hitInfo.transform.TryGetComponent(tl, out var value))
return;
if (firstHit.Remove(tl, out var prev))
{
if (prev.transform == hitInfo.transform)
{
//Debug.Log($"OnStayFirst : {prev.transform.name}");
EventInvoke(onStayFirst, tl, hitInfo, value);
}
else
{
//Debug.Log($"OnExitFirst : {prev.transform.name}");
EventInvoke(onExitFirst, tl, prev, prev.transform.GetComponent(tl));
//Debug.Log($"OnEnterFirst : {hitInfo.transform.name}");
EventInvoke(onEnterFirst, tl, hitInfo, value);
fth.Remove(prev.transform);
}
}
else
{
//Debug.Log($"OnEnterFirst : {hitInfo.transform.name}");
EventInvoke(onEnterFirst, tl, hitInfo, value);
}
fth[hitInfo.transform] = hitInfo;
tempFirstHit.Add(tl, hitInfo);
}
void SingleCasting()
{
//fth.Clear();
tempFirstHit.Clear();
for (int i = 0; i < hitCount; ++i)
{
SingleCasting(hitInfo[i]);
}
FirstExitEvent();
FirstClickEvent();
}
void FirstClickEvent()
{
foreach (var p in tempFirstHit)
{
firstHit.Add(p.Key, p.Value);
if (onLeftClick)
{
EventInvoke(onLeftClickFirst, p.Key, p.Value, p.Value.transform.GetComponent(p.Key));
}
if (onRightClick)
{
EventInvoke(onRightClickFirst, p.Key, p.Value, p.Value.transform.GetComponent(p.Key));
}
}
}
void FirstExitEvent()
{
foreach (var f in firstHit)
{
//Debug.Log($"OnExitFirst :{f.Value.transform.name}");
if (f.Value.transform == null)
continue;
EventInvoke(onExitFirst, f.Key, f.Value, f.Value.transform.GetComponent(f.Key));
fth.Remove(f.Value.transform);
//tempFirstHit.Remove(f.Key);
}
firstHit.Clear();
}
RaycastHit[] SortingHitInfos(in RaycastHit[] hitInfo)
{
if (hitInfo[0].transform == null)
return null;
var sortHitInfo = hitInfo.Where(hi => hi.transform != null).OrderBy(hi => hi.distance).ToArray();
//var sortHitInfo = hitInfo.OrderBy(hi => hi.distance).ToArray();
return sortHitInfo;
}
void HitCheck(int hitIndex)
{
var ht = hitInfo[hitIndex].transform;
tempHit.Add(ht);
transformToHitinfo.TryAdd(ht, hitInfo[hitIndex]);
bool isStay = hitTransform.Remove(ht);
foreach (var tl in typeLayers)
{
if (!ht.TryGetComponent(tl, out var value))
continue;
if (onLeftClick)
{
EventInvoke(onLeftClickEvent, tl, hitInfo[hitIndex], value);
//Debug.Log($"OnClick {tl} {value}");
}
if (onRightClick)
{
EventInvoke(onRightClickEvent, tl, hitInfo[hitIndex], value);
}
if (!isStay)
{
//Debug.Log($"OnEnter {tl} {value}");
EventInvoke(onEnterEvent, tl, hitInfo[hitIndex], value);
}
else
{
EventInvoke(onStayEvent, tl, hitInfo[hitIndex], value);
//Debug.Log($"OnStay {tl} {value}");
}
}
}
void MultiCasting()
{
tempHit.Clear();
for (int i = 0; i < hitCount; ++i)
{
HitCheck(i);
}
foreach (var h in hitTransform)
{
if (h == null)
continue;
foreach (var tl in typeLayers)
{
if (!h.TryGetComponent(tl, out var value))
continue;
EventInvoke(onExitEvent, tl, transformToHitinfo[h], value);
}
transformToHitinfo.Remove(h);
}
hitTransform.Clear();
foreach (var p in tempHit)
{
hitTransform.Add(p);
}
}
void EventInvoke(Dictionary<Type, Action<RaycastHit, Component>> eventTable, Type layer, in RaycastHit hitInfo, Component value)
{
if (eventTable.TryGetValue(layer, out var action))
{
eventList.Add((action,hitInfo, value));
//action?.Invoke(hitInfo, value);
}
}
public bool IsFirstHit(Transform target)
{
if (hitInfo.Length == 0)
return false;
return hitInfo[0].transform == target;
}
public void AddTypeLayer(Type t)
{
typeLayers.Add(t);
typeLayers.RemoveWhere(t => t == null);
}
public void RemoveTypeLayer<T>()
{
typeLayers.Remove(typeof(T));
}
public void AddEvent_FirstEnter(Type layer, Action<RaycastHit, Component> action)
{
onEnterFirst.TryAdd(layer, null);
onEnterFirst[layer] += action;
}
public void AddEvent_FirstExit(Type layer, Action<RaycastHit, Component> action)
{
onExitFirst.TryAdd(layer, null);
onExitFirst[layer] += action;
}
public void AddEvent_FirstStay(Type layer, Action<RaycastHit, Component> action)
{
onStayFirst.TryAdd(layer, null);
onStayFirst[layer] += action;
}
public void AddEvent_FirstLeftClick(Type layer, Action<RaycastHit, Component> action)
{
onLeftClickFirst.TryAdd(layer, null);
onLeftClickFirst[layer] += action;
}
public void AddEvent_FirstRightClick(Type layer, Action<RaycastHit, Component> action)
{
onRightClickFirst.TryAdd(layer, null);
onRightClickFirst[layer] += action;
}
public void AddEvent_RightClick(Type layer, Action<RaycastHit, Component> action)
{
onRightClickEvent.TryAdd(layer, null);
onRightClickEvent[layer] += action;
}
public void AddEvent_Enter(Type layer, Action<RaycastHit, Component> action)
{
onEnterEvent.TryAdd(layer, null);
onEnterEvent[layer] += action;
}
public void AddEvent_Exit(Type layer, Action<RaycastHit, Component> action)
{
onExitEvent.TryAdd(layer, null);
onExitEvent[layer] += action;
}
public void AddEvent_Stay(Type layer, Action<RaycastHit, Component> action)
{
onStayEvent.TryAdd(layer, null);
onStayEvent[layer] += action;
}
public void AddEvent_LeftClick(Type layer, Action<RaycastHit, Component> action)
{
onLeftClickEvent.TryAdd(layer, null);
onLeftClickEvent[layer] += action;
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 73c8199685949fb4eb02e83a235ec68b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -542,11 +542,6 @@ MonoBehaviour:
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
--- !u!4 &33659229 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
m_PrefabInstance: {fileID: 1969209925}
m_PrefabAsset: {fileID: 0}
--- !u!1 &49187855 --- !u!1 &49187855
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -700,7 +695,7 @@ Transform:
- {fileID: 311806352} - {fileID: 311806352}
- {fileID: 1119818303} - {fileID: 1119818303}
- {fileID: 270955323} - {fileID: 270955323}
- {fileID: 33659229} - {fileID: 3992366463622774082}
- {fileID: 415074187} - {fileID: 415074187}
- {fileID: 716152919} - {fileID: 716152919}
- {fileID: 1936102453} - {fileID: 1936102453}
@@ -3474,6 +3469,17 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 208193137} m_GameObject: {fileID: 208193137}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &210712101 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6261162410268618183, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
m_PrefabInstance: {fileID: 8701733059700470084}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3364ac7fbd47c0049b73d3079868c38b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &215489148 --- !u!1 &215489148
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -6164,6 +6170,11 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 364709506} m_GameObject: {fileID: 364709506}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &367605669 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3143323585188192883, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
m_PrefabInstance: {fileID: 8701733059700470084}
m_PrefabAsset: {fileID: 0}
--- !u!1 &369755196 --- !u!1 &369755196
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -9213,6 +9224,17 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Padding: {x: -8, y: -5, z: -8, w: -5} m_Padding: {x: -8, y: -5, z: -8, w: -5}
m_Softness: {x: 0, y: 0} m_Softness: {x: 0, y: 0}
--- !u!114 &515764191 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4184018941781392851, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
m_PrefabInstance: {fileID: 8701733059700470084}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3364ac7fbd47c0049b73d3079868c38b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &516316033 --- !u!1 &516316033
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -14917,6 +14939,17 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 766238987} m_GameObject: {fileID: 766238987}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &774298016 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4765074342053365812, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
m_PrefabInstance: {fileID: 8701733059700470084}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3364ac7fbd47c0049b73d3079868c38b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &784038655 --- !u!1 &784038655
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -17726,6 +17759,17 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 5290342058106165413, guid: 1e2f1310fcc725c4a82bd8a7a783ca22, type: 3} m_CorrespondingSourceObject: {fileID: 5290342058106165413, guid: 1e2f1310fcc725c4a82bd8a7a783ca22, type: 3}
m_PrefabInstance: {fileID: 1837017872} m_PrefabInstance: {fileID: 1837017872}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!114 &900666749 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5901532726994830447, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
m_PrefabInstance: {fileID: 8701733059700470084}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3364ac7fbd47c0049b73d3079868c38b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &903456540 --- !u!1 &903456540
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -21355,8 +21399,6 @@ MonoBehaviour:
Button_ProductionProgress: {fileID: 0} Button_ProductionProgress: {fileID: 0}
Button_AssemblyProgress: {fileID: 0} Button_AssemblyProgress: {fileID: 0}
Button_FinalInspection: {fileID: 0} Button_FinalInspection: {fileID: 0}
Button_AssemblyProgressLine: {fileID: 0}
Button_MoldDepartment: {fileID: 0}
Button_Alrams: {fileID: 0} Button_Alrams: {fileID: 0}
Button_Setting: {fileID: 0} Button_Setting: {fileID: 0}
Button_Exit: {fileID: 0} Button_Exit: {fileID: 0}
@@ -25124,6 +25166,17 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1221147949} m_GameObject: {fileID: 1221147949}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &1233672940 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 290325765835358597, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
m_PrefabInstance: {fileID: 8701733059700470084}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3364ac7fbd47c0049b73d3079868c38b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1238470209 --- !u!1 &1238470209
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -33842,9 +33895,6 @@ MonoBehaviour:
panel_machinedeleteregistration: {fileID: 0} panel_machinedeleteregistration: {fileID: 0}
panel_machinecorrection: {fileID: 0} panel_machinecorrection: {fileID: 0}
dashboardPoint: {fileID: 0} dashboardPoint: {fileID: 0}
currentDashBoard: {fileID: 0}
isSimpleDashboardAcitve: 0
panel_controlsetting: {fileID: 0}
panel_protocolsetting: {fileID: 0} panel_protocolsetting: {fileID: 0}
--- !u!114 &1673135434 --- !u!114 &1673135434
MonoBehaviour: MonoBehaviour:
@@ -34046,6 +34096,17 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1678468758} m_GameObject: {fileID: 1678468758}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!114 &1681443528 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 8015710047439777487, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
m_PrefabInstance: {fileID: 8701733059700470084}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3364ac7fbd47c0049b73d3079868c38b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1684204578 --- !u!1 &1684204578
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -34843,55 +34904,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1711964009} m_GameObject: {fileID: 1711964009}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &1712232313 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4602595839876627761, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
m_PrefabInstance: {fileID: 1969209925}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1712232315
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1712232313}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 1
m_Antialiasing: 3
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_AllowHDROutput: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
m_TaaSettings:
m_Quality: 2
m_FrameInfluence: 0.100000024
m_JitterScale: 1
m_MipBias: 0
m_VarianceClampScale: 0.9
m_ContrastAdaptiveSharpening: 0.2
--- !u!1 &1714761417 --- !u!1 &1714761417
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -37694,7 +37706,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5774997430431792511, guid: b59b3195a2b1ed64ebe226010a38ae94, type: 3} - target: {fileID: 5774997430431792511, guid: b59b3195a2b1ed64ebe226010a38ae94, type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6187420705898449986, guid: b59b3195a2b1ed64ebe226010a38ae94, type: 3} - target: {fileID: 6187420705898449986, guid: b59b3195a2b1ed64ebe226010a38ae94, type: 3}
propertyPath: m_Pivot.x propertyPath: m_Pivot.x
@@ -37840,7 +37852,8 @@ PrefabInstance:
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 0.1836572 value: 0.1836572
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents:
- {fileID: 6780060098680629457, guid: b59b3195a2b1ed64ebe226010a38ae94, type: 3}
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
@@ -40167,239 +40180,6 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1001 &1969209925
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 49225333}
m_Modifications:
- target: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalPosition.x
value: -55.4
objectReference: {fileID: 0}
- target: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalPosition.y
value: 50
objectReference: {fileID: 0}
- target: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalPosition.z
value: 30.7
objectReference: {fileID: 0}
- target: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalRotation.w
value: 0.44578564
objectReference: {fileID: 0}
- target: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalRotation.x
value: 0.12810983
objectReference: {fileID: 0}
- target: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalRotation.y
value: 0.8514625
objectReference: {fileID: 0}
- target: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalRotation.z
value: -0.24469325
objectReference: {fileID: 0}
- target: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 32.067
objectReference: {fileID: 0}
- target: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 124.731
objectReference: {fileID: 0}
- target: {fileID: 135340969371884068, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1769739476192758786, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_HDR
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1769739476192758786, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_Depth
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1769739476192758786, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_AllowMSAA
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1769739476192758786, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: far clip plane
value: 200
objectReference: {fileID: 0}
- target: {fileID: 1769739476192758786, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_TargetTexture
value:
objectReference: {fileID: 0}
- target: {fileID: 1769739476192758786, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: near clip plane
value: 0.2
objectReference: {fileID: 0}
- target: {fileID: 1769739476192758786, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_OcclusionCulling
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1769739476192758786, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_CullingMask.m_Bits
value: 32247
objectReference: {fileID: 0}
- target: {fileID: 2097398073062650089, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_Size.x
value: 96.86835
objectReference: {fileID: 0}
- target: {fileID: 2097398073062650089, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_Size.z
value: 62.704876
objectReference: {fileID: 0}
- target: {fileID: 2097398073062650089, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2097398073062650089, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_Center.x
value: 8.683212
objectReference: {fileID: 0}
- target: {fileID: 2097398073062650089, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_Center.z
value: -0.14234161
objectReference: {fileID: 0}
- target: {fileID: 2656137905910655519, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2795261250788500754, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: radi
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2795261250788500754, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: yUpPos
value: 1.5
objectReference: {fileID: 0}
- target: {fileID: 2795261250788500754, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: runSpeed
value: 3
objectReference: {fileID: 0}
- target: {fileID: 2795261250788500754, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: nextPosition.x
value: 9.714996
objectReference: {fileID: 0}
- target: {fileID: 2795261250788500754, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: nextPosition.y
value: 57.3
objectReference: {fileID: 0}
- target: {fileID: 2795261250788500754, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: nextPosition.z
value: 236.9934
objectReference: {fileID: 0}
- target: {fileID: 3640034311448942995, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalPosition.x
value: -37.685005
objectReference: {fileID: 0}
- target: {fileID: 3640034311448942995, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalPosition.z
value: 29.893412
objectReference: {fileID: 0}
- target: {fileID: 4212222602616332980, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_CastShadows
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6477979063903699244, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: stopNaNs
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6477979063903699244, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: dithering
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6477979063903699244, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: antialiasing
value: 3
objectReference: {fileID: 0}
- target: {fileID: 6477979063903699244, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: volumeLayerMask.m_Bits
value: 2147483649
objectReference: {fileID: 0}
- target: {fileID: 6689677178373688372, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7888456699290281049, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7888456699290281049, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7888456699290281049, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7888456699290281049, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7888456699290281049, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7888456699290281049, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7888456699290281049, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7888456699290281049, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7888456699290281049, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7888456699290281049, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8457166540169997683, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9065749286782967344, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_Name
value: Controller
objectReference: {fileID: 0}
- target: {fileID: 9065749286782967344, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9069679373307880458, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: InitialModule.startColor.maxColor.b
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9069679373307880458, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: InitialModule.startColor.maxColor.g
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9069679373307880458, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
propertyPath: InitialModule.startColor.maxColor.r
value: 1
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 6477979063903699244, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 4602595839876627761, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
insertIndex: -1
addedObject: {fileID: 1712232315}
m_SourcePrefab: {fileID: 100100000, guid: e8aa14877be9b924882fcad9d88abe46, type: 3}
--- !u!1 &1971695965 --- !u!1 &1971695965
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -44930,6 +44710,21 @@ GameObject:
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 1
--- !u!4 &289514793767337717
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1322669169910222201}
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: 3992366463622774082}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &543450652765985303 stripped --- !u!4 &543450652765985303 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: 8063966845845817783, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3} m_CorrespondingSourceObject: {fileID: 8063966845845817783, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
@@ -44965,6 +44760,43 @@ MonoBehaviour:
m_FillOrigin: 0 m_FillOrigin: 0
m_UseSpriteMesh: 0 m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 4 m_PixelsPerUnitMultiplier: 4
--- !u!1 &673529244681525847
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6628738256313926463}
- component: {fileID: 3316918087339060068}
- component: {fileID: 7661166344626072402}
- component: {fileID: 6999404541576683528}
m_Layer: 10
m_Name: Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1322669169910222201
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 289514793767337717}
- component: {fileID: 2476445388581388070}
- component: {fileID: 4948563083304796563}
m_Layer: 0
m_Name: PRF_ControllerViewTarget
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1605505227343304781 --- !u!114 &1605505227343304781
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -45111,6 +44943,69 @@ PrefabInstance:
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fe2efe24ec12f0741a449954f91f3c35, type: 3} m_SourcePrefab: {fileID: 100100000, guid: fe2efe24ec12f0741a449954f91f3c35, type: 3}
--- !u!114 &2476445388581388070
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1322669169910222201}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eab1a07f8f5c6754a8f2a9789fb6b020, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!20 &3316918087339060068
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 673529244681525847}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!224 &3516895482578052139 --- !u!224 &3516895482578052139
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -45231,6 +45126,23 @@ PrefabInstance:
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 58b52bb498791ed40bfa7aff20e1f0e4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 58b52bb498791ed40bfa7aff20e1f0e4, type: 3}
--- !u!4 &3992366463622774082
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5428927936443857238}
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:
- {fileID: 289514793767337717}
- {fileID: 6628738256313926463}
m_Father: {fileID: 49225333}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!222 &4219095924724536526 --- !u!222 &4219095924724536526
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -45258,6 +45170,27 @@ GameObject:
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 0 m_IsActive: 0
--- !u!135 &4948563083304796563
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1322669169910222201}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Radius: 0.25
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &5257701773514832337 --- !u!114 &5257701773514832337
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -45288,6 +45221,47 @@ MonoBehaviour:
m_FillOrigin: 0 m_FillOrigin: 0
m_UseSpriteMesh: 0 m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1 m_PixelsPerUnitMultiplier: 1
--- !u!1 &5428927936443857238
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3992366463622774082}
- component: {fileID: 5428927936443857239}
m_Layer: 0
m_Name: Controller
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &5428927936443857239
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5428927936443857238}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fafd8d68ae7258c4485adb2fffef3373, type: 3}
m_Name:
m_EditorClassIdentifier:
viewMode: 1
moveSpeed: 5
rotateSpeed: 60
zoomSpeed: 100
maxElevation: 90
minElevation: 5
minDistance: 2
maxDistance: 60
currentElevation: 55
currentDistance: 30
currentAzimuth: 32
cameraPivot: {fileID: 0}
--- !u!224 &6011291902712399202 --- !u!224 &6011291902712399202
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -45307,6 +45281,21 @@ RectTransform:
m_AnchoredPosition: {x: -56.8, y: -52} m_AnchoredPosition: {x: -56.8, y: -52}
m_SizeDelta: {x: 30, y: 30} m_SizeDelta: {x: 30, y: 30}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!4 &6628738256313926463
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 673529244681525847}
serializedVersion: 2
m_LocalRotation: {x: 0.35355338, y: 0.35355338, z: -0.1464466, w: 0.8535535}
m_LocalPosition: {x: -45, y: 62.35534, z: -45}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3992366463622774082}
m_LocalEulerAnglesHint: {x: 45, y: 45, z: 0}
--- !u!224 &6655705348909782899 --- !u!224 &6655705348909782899
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -45335,6 +45324,50 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 5136685362653072439, guid: fe2efe24ec12f0741a449954f91f3c35, type: 3} m_CorrespondingSourceObject: {fileID: 5136685362653072439, guid: fe2efe24ec12f0741a449954f91f3c35, type: 3}
m_PrefabInstance: {fileID: 2387194483665702846} m_PrefabInstance: {fileID: 2387194483665702846}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!114 &6999404541576683528
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 673529244681525847}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 0
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_AllowHDROutput: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
m_TaaSettings:
m_Quality: 3
m_FrameInfluence: 0.1
m_JitterScale: 1
m_MipBias: 0
m_VarianceClampScale: 0.9
m_ContrastAdaptiveSharpening: 0
--- !u!222 &7069949033335198431 --- !u!222 &7069949033335198431
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -45371,6 +45404,29 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 140193031238434938} m_GameObject: {fileID: 140193031238434938}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!136 &7661166344626072402
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 673529244681525847}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Height: 1
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!224 &8012176388805653818 stripped --- !u!224 &8012176388805653818 stripped
RectTransform: RectTransform:
m_CorrespondingSourceObject: {fileID: 9014463343716695441, guid: 58b52bb498791ed40bfa7aff20e1f0e4, type: 3} m_CorrespondingSourceObject: {fileID: 9014463343716695441, guid: 58b52bb498791ed40bfa7aff20e1f0e4, type: 3}
@@ -45508,14 +45564,54 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 1818419964} m_TransformParent: {fileID: 1818419964}
m_Modifications: m_Modifications:
- target: {fileID: 260710473908205888, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1600303972707744018, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3} - target: {fileID: 1600303972707744018, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: Chunil value: Chunil
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2521218806508010177, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: floors.Array.size
value: 6
objectReference: {fileID: 0}
- target: {fileID: 2521218806508010177, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: 'floors.Array.data[0]'
value:
objectReference: {fileID: 774298016}
- target: {fileID: 2521218806508010177, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: 'floors.Array.data[1]'
value:
objectReference: {fileID: 515764191}
- target: {fileID: 2521218806508010177, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: 'floors.Array.data[2]'
value:
objectReference: {fileID: 900666749}
- target: {fileID: 2521218806508010177, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: 'floors.Array.data[3]'
value:
objectReference: {fileID: 210712101}
- target: {fileID: 2521218806508010177, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: 'floors.Array.data[4]'
value:
objectReference: {fileID: 1233672940}
- target: {fileID: 2521218806508010177, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: 'floors.Array.data[5]'
value:
objectReference: {fileID: 1681443528}
- target: {fileID: 3951875329995553383, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3} - target: {fileID: 3951875329995553383, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: -4.74 value: -4.74
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4765074342053365812, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: Ceiling
value:
objectReference: {fileID: 367605669}
- target: {fileID: 5901532726994830447, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: isEmptyFloor
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8063966845845817783, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3} - target: {fileID: 8063966845845817783, guid: 02de84299dbbd354fa8fe07b680d5d8c, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: -7.7 value: -7.7

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 1f68ff29096c80243ad9a2559d426c83 guid: 7631964abe958ba48a6accd98e930acc
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

View File

@@ -33,7 +33,7 @@ namespace CHN
private void SetThermostatUI() private void SetThermostatUI()
{ {
cam = FindSingle<OrbitalController>(); cam = FindSingle<OrbitalController>();
prefab_thermostatIcon = Resources.Load<UI_ThermostatIcon>("Prefabs/UI/PRF_UI_ThermostatIcon"); prefab_thermostatIcon = Resources.Load<UI_ThermostatIcon>("UI/Prefabs/PRF_UI_ThermostatIcon");
var building = FindSingle<Building>(); var building = FindSingle<Building>();
thermostats = building.floors.SelectMany(f => f.thermostats).ToArray(); thermostats = building.floors.SelectMany(f => f.thermostats).ToArray();
@@ -61,7 +61,7 @@ namespace CHN
foreach (var thermostat in thermostats) foreach (var thermostat in thermostats)
{ {
var thermostatPost = thermostat.centerPos; var thermostatPost = thermostat.centerPos;
var screenPos = cam.camera.WorldToScreenPoint(new Vector3(thermostatPost.x, thermostatPost.y + defaultNameHeight, thermostatPost.z)); var screenPos = Camera.main.WorldToScreenPoint(new Vector3(thermostatPost.x, thermostatPost.y + defaultNameHeight, thermostatPost.z));
thermostat.thermostatIcon.transform.position = screenPos; thermostat.thermostatIcon.transform.position = screenPos;
} }
@@ -70,7 +70,7 @@ namespace CHN
{ {
var layerMask = LayerMask.GetMask("Camera", "Floor Wall"); var layerMask = LayerMask.GetMask("Camera", "Floor Wall");
float t = Mathf.InverseLerp(cam.option.maxDistance, 0f, cam.option.currentDistance); float t = Mathf.InverseLerp(cam.maxDistance, 0f, cam.currentDistance);
float scale = Mathf.Lerp(minScale, maxScale, t); float scale = Mathf.Lerp(minScale, maxScale, t);
var newScale = new Vector3(scale, scale, scale); var newScale = new Vector3(scale, scale, scale);
@@ -83,7 +83,7 @@ namespace CHN
} }
bool IsScreenRange(Thermostat thermostat) bool IsScreenRange(Thermostat thermostat)
{ {
Vector3 viewPos = cam.camera.WorldToViewportPoint(thermostat.centerPos); Vector3 viewPos = Camera.main.WorldToViewportPoint(thermostat.centerPos);
if (viewPos.x >= 0 && viewPos.x <= 1 && viewPos.y >= 0 && viewPos.y <= 1 && viewPos.z > 0) if (viewPos.x >= 0 && viewPos.x <= 1 && viewPos.y >= 0 && viewPos.y <= 1 && viewPos.z > 0)
{ {
@@ -96,7 +96,7 @@ namespace CHN
var currentFloor = FindSingle<Building>().currentFloor; var currentFloor = FindSingle<Building>().currentFloor;
var thermostatInFloor = thermostat.GetComponentInParent<Floor>(); var thermostatInFloor = thermostat.GetComponentInParent<Floor>();
var dir = cam.camera.transform.position - thermostat.centerPos; var dir = Camera.main.transform.position - thermostat.centerPos;
var hit = new RaycastHit(); var hit = new RaycastHit();
if (thermostatInFloor != currentFloor) if (thermostatInFloor != currentFloor)

View File

@@ -29,7 +29,7 @@ public class Panel_AssemblyProduction : PanelBase, IDashboardUI
public Action onClose; public Action onClose;
public override void AfterAwake() public override void AfterAwake()
{ {
prf_statusContent = Resources.Load<UI_StatusContent>("Prefabs/UI/UI_StatusContent"); prf_statusContent = Resources.Load<UI_StatusContent>("UI/Prefabs/UI_StatusContent");
CloseButton.onClick.AddListener(OnClickCloseButton); CloseButton.onClick.AddListener(OnClickCloseButton);
SetDate(); SetDate();
Close(); Close();

View File

@@ -1,238 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using WI;
using UnityEngine.UI;
using TMPro;
namespace CHN
{
public class Panel_ControlSetting : SettingPanel
{
KeyCode[] keyCodes;
OrbitalController orbitalController;
private OptionManager optionManager;
private Dictionary<string, UI_MappingButton> controlButton = new Dictionary<string, UI_MappingButton>();
private Dictionary<string, string> initControlOptions = new Dictionary<string, string>();
private Dictionary<string, string> mappingControlOptions = new Dictionary<string, string>();
private Dictionary<string, UI_SliderInputField> controlInputFields = new Dictionary<string, UI_SliderInputField>();
private Dictionary<string, string> initSpeedOptions = new Dictionary<string, string>();
private Dictionary<string, string> mappingSpeedOptions = new Dictionary<string, string>();
public UI_MappingButton currentClickButton;
public bool isMappingButtonClick;
public float minMoveSpeed;
public float maxMoveSpeed;
public float minRotateSpeed;
public float maxRotateSpeed;
public float minZoomSpeed;
public float maxZoomSpeed;
public void InitOptionSetting()
{
keyCodes = (KeyCode[])Enum.GetValues(typeof(KeyCode));
orbitalController = FindSingle<OrbitalController>();
optionManager = FindSingle<OptionManager>();
var controlOption = optionManager.GetOption(orbitalController);
var mappingButtons = GetComponentsInChildren<UI_MappingButton>();
foreach (var mappingButton in mappingButtons)
{
mappingButton.SetMappingButton();
controlButton.Add(mappingButton.button.name, mappingButton);
initControlOptions.Add(mappingButton.button.name, controlOption[mappingButton.button.name]);
mappingButton.Value.SetText(controlOption[mappingButton.button.name]);
mappingButton.onClickButton += OnClickButton;
}
var inputFields = GetComponentsInChildren<UI_SliderInputField>();
foreach(var inputField in inputFields)
{
inputField.SetSliderInputField();
controlInputFields.Add(inputField.name, inputField);
initSpeedOptions.Add(inputField.name, controlOption[inputField.name]);
SliderValueWithInRanage(inputField.name);
inputField.SetText(controlOption[inputField.name]);
}
}
private void OnClickButton(UI_MappingButton currentButton)
{
if (currentClickButton != null)
{
currentClickButton.ReductionLine();
currentClickButton.isClick = false;
}
isMappingButtonClick = true;
currentClickButton = currentButton;
currentClickButton.isClick = true;
currentClickButton.ExpandLine();
}
private void Update()
{
if (!isMappingButtonClick)
return;
foreach (KeyCode keyCode in keyCodes)
{
if (IsMouseClick())
return;
if (Input.GetKeyDown(keyCode))
{
currentClickButton.Value.SetText(InputKeyCode(keyCode).ToString());
currentClickButton.Line.transform.localScale = new Vector3(0f,1f,1f);
currentClickButton.isClick = false;
isMappingButtonClick = false;
}
}
}
KeyCode InputKeyCode(KeyCode inputKeyCode)
{
foreach (var button in controlButton.Values)
{
var buttonText = button.Value;
if (buttonText.text == inputKeyCode.ToString())
{
return (KeyCode)Enum.Parse(typeof(KeyCode), currentClickButton.Value.text);
}
}
return inputKeyCode;
}
bool IsMouseClick()
{
bool isMouseClick = Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || Input.GetMouseButtonDown(2);
return isMouseClick;
}
public void SliderValueWithInRanage(string key)
{
float maxValue = 0;
float minValue = 0;
switch (key)
{
case "MoveSpeed":
maxValue = maxMoveSpeed;
minValue = minMoveSpeed;
break;
case "RotateSpeed":
maxValue = maxRotateSpeed;
minValue = minRotateSpeed;
break;
case "ZoomSpeed":
maxValue = maxZoomSpeed;
minValue = minRotateSpeed;
break;
}
controlInputFields[key].Slider.minValue = minValue;
controlInputFields[key].Slider.maxValue = maxValue;
}
public void AdjustTextValueWithinRange(string key)
{
float value = float.Parse(mappingSpeedOptions[key]);
float maxValue = 0;
float minValue = 0;
switch (key)
{
case "MoveSpeed":
maxValue = maxMoveSpeed;
minValue = minMoveSpeed;
break;
case "RotateSpeed":
maxValue = maxRotateSpeed;
minValue = minRotateSpeed;
break;
case "ZoomSpeed":
maxValue = maxZoomSpeed;
minValue = minRotateSpeed;
break;
}
float withinRangeValue = Mathf.Clamp(value, minValue, maxValue);
mappingSpeedOptions[key] = withinRangeValue.ToString();
controlInputFields[key].SetText(withinRangeValue.ToString());
}
internal override void Reset()
{
var optionManager = FindSingle<OptionManager>();
foreach (var key in initControlOptions.Keys)
{
controlButton[key].Value.text = initControlOptions[key];
}
optionManager.SetOptionValue(orbitalController, initControlOptions);
foreach (var key in initSpeedOptions.Keys)
{
controlInputFields[key].SetText(initSpeedOptions[key]);
}
optionManager.SetOptionValue(orbitalController, initSpeedOptions);
orbitalController.SetControllOptionValue();
}
internal override void Accept()
{
var optionManager = FindSingle<OptionManager>();
mappingControlOptions.Clear();
mappingSpeedOptions.Clear();
foreach (var controlButton in controlButton.Values)
{
mappingControlOptions.Add(controlButton.button.name, controlButton.Value.text);
}
optionManager.SetOptionValue(orbitalController, mappingControlOptions);
foreach (var controlInputField in controlInputFields.Values)
{
mappingSpeedOptions.Add(controlInputField.name, controlInputField.inputField.text);
AdjustTextValueWithinRange(controlInputField.name);
}
optionManager.SetOptionValue(orbitalController, mappingSpeedOptions);
orbitalController.SetControllOptionValue();
}
internal override void Open()
{
gameObject.SetActive(true);
}
internal override void Close()
{
isMappingButtonClick = false;
var controlOption = optionManager.GetOption(orbitalController);
foreach (var key in controlButton.Keys)
{
controlButton[key].Value.text = controlOption[key];
}
foreach (var key in controlInputFields.Keys)
{
controlInputFields[key].inputField.text = controlOption[key];
}
if (currentClickButton != null)
{
currentClickButton.Line.transform.localScale = new Vector3(0f, 1f, 1f);
currentClickButton.isClick = false;
}
gameObject.SetActive(false);
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 5ebbce523cfa4db48ac8f22eba9d7d27
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -29,7 +29,7 @@ public class Panel_FinalInspection : PanelBase, IDashboardUI
public Action onClose; public Action onClose;
public override void AfterAwake() public override void AfterAwake()
{ {
prf_statusContent = Resources.Load<UI_StatusContent>("Prefabs/UI/UI_StatusContent"); prf_statusContent = Resources.Load<UI_StatusContent>("UI/Prefabs/UI_StatusContent");
effect = FindSingle<Panel_Effect>(); effect = FindSingle<Panel_Effect>();
CloseButton.onClick.AddListener(OnClickCloseButton); CloseButton.onClick.AddListener(OnClickCloseButton);
SetDate(); SetDate();

View File

@@ -29,7 +29,7 @@ public class Panel_InjectionProduction : PanelBase, IDashboardUI
public Action onClose; public Action onClose;
public override void AfterAwake() public override void AfterAwake()
{ {
prf_statusContent = Resources.Load<UI_StatusContent>("Prefabs/UI/UI_StatusContent"); prf_statusContent = Resources.Load<UI_StatusContent>("UI/Prefabs/UI_StatusContent");
effect = FindSingle<Panel_Effect>(); effect = FindSingle<Panel_Effect>();
CloseButton.onClick.AddListener(OnClickCloseButton); CloseButton.onClick.AddListener(OnClickCloseButton);
SetDate(); SetDate();

View File

@@ -55,8 +55,8 @@ namespace CHN
if (gameObject.activeSelf) if (gameObject.activeSelf)
return; return;
ChangePanel<Panel_ControlSetting>(); ChangePanel<Panel_ProtocolSetting>();
ChangeButtonState(Button_Control); ChangeButtonState(Button_Protocol);
SetActive(true); SetActive(true);
transform.SetAsLastSibling(); transform.SetAsLastSibling();
@@ -109,8 +109,8 @@ namespace CHN
void OnClickButton_Control() void OnClickButton_Control()
{ {
ChangeButtonState(Button_Control); //ChangeButtonState(Button_Control);
ChangePanel<Panel_ControlSetting>(); //ChangePanel<Panel_ControlSetting>();
} }
void OnClickButton_Protocol() void OnClickButton_Protocol()

View File

@@ -25,7 +25,7 @@ public class Panel_WorkProgressStatus : PanelBase, IDashboardUI
public Action onClose; public Action onClose;
public override void AfterAwake() public override void AfterAwake()
{ {
prf_workStatusItem = Resources.Load<UI_WorkStatusItem>("Prefabs/UI/UI_WorkStatusItem"); prf_workStatusItem = Resources.Load<UI_WorkStatusItem>("UI/Prefabs/UI_WorkStatusItem");
CloseButton.onClick.AddListener(OnClickCloseButton); CloseButton.onClick.AddListener(OnClickCloseButton);
SetDate(); SetDate();
Close(); Close();

View File

@@ -35,7 +35,7 @@ public class UI_Calendar : UIBase
Button_PrevMonth.onClick.AddListener(OnClickPrevMonth); Button_PrevMonth.onClick.AddListener(OnClickPrevMonth);
Button_NextMonth.onClick.AddListener(OnClickNextMonth); Button_NextMonth.onClick.AddListener(OnClickNextMonth);
prefab_calendarItem = Resources.Load<GameObject>("Prefabs/UI/PRF_UI_CalendarItem"); prefab_calendarItem = Resources.Load<GameObject>("UI/Prefabs/PRF_UI_CalendarItem");
float sundayPosX = Text_Sunday.anchoredPosition.x; float sundayPosX = Text_Sunday.anchoredPosition.x;
float mondayPosX = Text_Monday.anchoredPosition.x; float mondayPosX = Text_Monday.anchoredPosition.x;
float space = mondayPosX - sundayPosX; float space = mondayPosX - sundayPosX;

View File

@@ -10,7 +10,7 @@ public class UI_StatusContent : MonoBehaviour
public override void AfterAwake() public override void AfterAwake()
{ {
prf_machineStatus = Resources.Load<UI_MachineStatus>("Prefabs/UI/UI_StatusItem"); prf_machineStatus = Resources.Load<UI_MachineStatus>("UI/Prefabs/UI_StatusItem");
} }
public void SetProductionStatusItem(List<CompleteInfo> machineInfos) public void SetProductionStatusItem(List<CompleteInfo> machineInfos)
{ {

View File

@@ -192,47 +192,47 @@ namespace CHN
#endregion #endregion
#region #region
public void MachineDataSetChange(Machine machine, HashSet<string> fields) //public void MachineDataSetChange(Machine machine, HashSet<string> fields)
{ //{
if (string.IsNullOrEmpty(machine.code)) // if (string.IsNullOrEmpty(machine.code))
return; // return;
var machineName = GapRemove(machine.code); // var machineName = GapRemove(machine.code);
var simpleField = includeFields[machineName]; // var simpleField = includeFields[machineName];
simpleField.simpleField = fields; // simpleField.simpleField = fields;
includeFields[machineName] = simpleField; // includeFields[machineName] = simpleField;
} //}
public void GetSimpleCompleteData(Machine machine) //public void GetSimpleCompleteData(Machine machine)
{ //{
if (string.IsNullOrEmpty(machine.code)) // if (string.IsNullOrEmpty(machine.code))
return; // return;
var machineName = GapRemove(machine.code); // var machineName = GapRemove(machine.code);
if (includeFields.ContainsKey(machineName)) // if (includeFields.ContainsKey(machineName))
{ // {
includeFields[machineName].machineInfo = mqttDataTable[machineName]; // includeFields[machineName].machineInfo = mqttDataTable[machineName];
includeFields[machineName].kpiDataInfo = kpiDataTable[machineName]; // includeFields[machineName].kpiDataInfo = kpiDataTable[machineName];
} // }
else // else
{ // {
var simpleTest = new MachineDataSet(); // var simpleTest = new MachineDataSet();
simpleTest.machineName = machineName; // simpleTest.machineName = machineName;
simpleTest.machineInfo = mqttDataTable[machineName]; // simpleTest.machineInfo = mqttDataTable[machineName];
simpleTest.kpiDataInfo = kpiDataTable[machineName]; // simpleTest.kpiDataInfo = kpiDataTable[machineName];
simpleTest.simpleField = samples; // simpleTest.simpleField = samples;
includeFields.Add(machineName, simpleTest); // includeFields.Add(machineName, simpleTest);
} // }
onSimpleInfo?.Invoke(machine, includeFields[machineName]); // onSimpleInfo?.Invoke(machine, includeFields[machineName]);
} //}
public void GetCompleteInfo(Machine machine) //public void GetCompleteInfo(Machine machine)
{ //{
if (string.IsNullOrEmpty(machine.code)) // if (string.IsNullOrEmpty(machine.code))
return; // return;
var machineName = GapRemove(machine.code); // var machineName = GapRemove(machine.code);
var simpleField = includeFields[machineName]; // var simpleField = includeFields[machineName];
onCompleteInfo?.Invoke(machine, simpleField); // onCompleteInfo?.Invoke(machine, simpleField);
} //}
#endregion #endregion
#region / #region /

View File

@@ -32,7 +32,6 @@ namespace CHN
var machineClickManager = FindSingle<MachineClickManager>(); var machineClickManager = FindSingle<MachineClickManager>();
controller.onChangeViewMode += topCanvas.panel_toolbar.SetChangeViewButtonState; controller.onChangeViewMode += topCanvas.panel_toolbar.SetChangeViewButtonState;
building.onChangeFloor += viewManager.ChangeViewWithFloorControl;
topCanvas.panel_toolbar.onClickCameraView += viewManager.ChangeViewWithButtonClick; topCanvas.panel_toolbar.onClickCameraView += viewManager.ChangeViewWithButtonClick;
topCanvas.panel_toolbar.onClickFloorControl += popupCanvas.panel_floorcontrol.SetActive; topCanvas.panel_toolbar.onClickFloorControl += popupCanvas.panel_floorcontrol.SetActive;
@@ -57,24 +56,24 @@ namespace CHN
popupCanvas.panel_library.onClickLabelButton += libraryManager.LibraryFiltering; popupCanvas.panel_library.onClickLabelButton += libraryManager.LibraryFiltering;
popupCanvas.panel_protocolsetting.onUpdateMachine += libraryManager.MatchingMachine; popupCanvas.panel_protocolsetting.onUpdateMachine += libraryManager.MatchingMachine;
popupCanvas.panel_library.onClickLibraryButton += popupCanvas.MachineDashBoardOpen; //popupCanvas.panel_library.onClickLibraryButton += popupCanvas.MachineDashBoardOpen;
popupCanvas.panel_library.onClickLibraryButton += highLightManager.ClickMachinToHighlight; popupCanvas.panel_library.onClickLibraryButton += highLightManager.ClickMachinToHighlight;
popupCanvas.panel_library.onClickLibraryButton += viewManager.SetTargetPosToMachine; popupCanvas.panel_library.onClickLibraryButton += viewManager.SetTargetPosToMachine;
popupCanvas.panel_library.onClickDeleteRegistration += popupCanvas.panel_machinedeleteregistration.SetData; popupCanvas.panel_library.onClickDeleteRegistration += popupCanvas.panel_machinedeleteregistration.SetData;
popupCanvas.panel_library.onClickCorrection += popupCanvas.panel_machinecorrection.SetData; popupCanvas.panel_library.onClickCorrection += popupCanvas.panel_machinecorrection.SetData;
popupCanvas.simpleView += datamanager.MachineDataSetChange; //popupCanvas.simpleView += datamanager.MachineDataSetChange;
popupCanvas.onClickSimple += datamanager.GetSimpleCompleteData; //popupCanvas.onClickSimple += datamanager.GetSimpleCompleteData;
popupCanvas.onClickDetail += datamanager.GetCompleteInfo; //popupCanvas.onClickDetail += datamanager.GetCompleteInfo;
popupCanvas.onOpenDashboard += popupCanvas.panel_completealramhistory.Close; //popupCanvas.onOpenDashboard += popupCanvas.panel_completealramhistory.Close;
popupCanvas.onCloseDashBoard += highLightManager.ResetAllHighLighter; //popupCanvas.onCloseDashBoard += highLightManager.ResetAllHighLighter;
popupCanvas.panel_machinedata.onCloseDashboard += highLightManager.ResetAllHighLighter; popupCanvas.panel_machinedata.onCloseDashboard += highLightManager.ResetAllHighLighter;
popupCanvas.panel_completealramhistory.onClickAlram += completeTimeManager.MachineCorrespondingToAlarm; popupCanvas.panel_completealramhistory.onClickAlram += completeTimeManager.MachineCorrespondingToAlarm;
//popupCanvas.panel_completealramhistory.onCheckAlarmData += completeTimeManager.CheckCompleteTimeAlarm; //popupCanvas.panel_completealramhistory.onCheckAlarmData += completeTimeManager.CheckCompleteTimeAlarm;
//popupCanvas.panel_completealramhistory.onCheckAlarm += topCanvas.panel_toptoolbar.SetAlarmCount; //popupCanvas.panel_completealramhistory.onCheckAlarm += topCanvas.panel_toptoolbar.SetAlarmCount;
popupCanvas.panel_completealramhistory.onOpen += popupCanvas.CurrentDashoboardClose; //popupCanvas.panel_completealramhistory.onOpen += popupCanvas.CurrentDashoboardClose;
popupCanvas.panel_totalproduction.onSelected += popupCanvas.SetChangedProductionPanel; popupCanvas.panel_totalproduction.onSelected += popupCanvas.SetChangedProductionPanel;
popupCanvas.panel_assemblyproduction.onSelected += popupCanvas.SetChangedProductionPanel; popupCanvas.panel_assemblyproduction.onSelected += popupCanvas.SetChangedProductionPanel;
@@ -104,8 +103,8 @@ namespace CHN
datamanager.onFinalInspectionData += popupCanvas.panel_finalinspection.SetProductionStatus; datamanager.onFinalInspectionData += popupCanvas.panel_finalinspection.SetProductionStatus;
datamanager.onWorkShopInfo += popupCanvas.panel_workprogressstatus.SetWorkProgressStatus; datamanager.onWorkShopInfo += popupCanvas.panel_workprogressstatus.SetWorkProgressStatus;
datamanager.onSimpleInfo += popupCanvas.SimpleView; //datamanager.onSimpleInfo += popupCanvas.SimpleView;
datamanager.onCompleteInfo += popupCanvas.DetailView; //datamanager.onCompleteInfo += popupCanvas.DetailView;
datamanager.onKPIInfo += machineUIManager.SetMachineKPI; datamanager.onKPIInfo += machineUIManager.SetMachineKPI;
datamanager.onKPIInfo += popupCanvas.panel_totalproduction.SetMachineEffectiveness; datamanager.onKPIInfo += popupCanvas.panel_totalproduction.SetMachineEffectiveness;
datamanager.onSetThermostatData += popupCanvas.panel_thermostatcontrol.SetData; datamanager.onSetThermostatData += popupCanvas.panel_thermostatcontrol.SetData;
@@ -122,31 +121,30 @@ namespace CHN
mqttManager.onWorkshopData += popupCanvas.panel_totalproduction.SetWorkProgressStatus; mqttManager.onWorkshopData += popupCanvas.panel_totalproduction.SetWorkProgressStatus;
mqttManager.onThermostatData += datamanager.SetThermostatDataList; mqttManager.onThermostatData += datamanager.SetThermostatDataList;
completeTimeManager.onActiveHighLighter += popupCanvas.MachineDashBoardOpen; //completeTimeManager.onActiveHighLighter += popupCanvas.MachineDashBoardOpen;
completeTimeManager.onActiveHighLighter += highLightManager.ClickMachinToHighlight; completeTimeManager.onActiveHighLighter += highLightManager.ClickMachinToHighlight;
completeTimeManager.onActiveHighLighter += viewManager.SetTargetPosToMachine; completeTimeManager.onActiveHighLighter += viewManager.SetTargetPosToMachine;
httpManager.onMachineKPIData += datamanager.UpdateKPIData; httpManager.onMachineKPIData += datamanager.UpdateKPIData;
machineUIManager.onClickKPIToMachine += popupCanvas.MachineDashBoardOpen; //machineUIManager.onClickKPIToMachine += popupCanvas.MachineDashBoardOpen;
machineUIManager.onClickKPIToMachine += highLightManager.ClickMachinToHighlight; machineUIManager.onClickKPIToMachine += highLightManager.ClickMachinToHighlight;
machineUIManager.onClickKPIToData += popupCanvas.panel_machinedata.SetMachineData; machineUIManager.onClickKPIToData += popupCanvas.panel_machinedata.SetMachineData;
machineUIManager.onClickKPIToData += popupCanvas.panel_detaildashboard.SetDetailDashBoardData; machineUIManager.onClickKPIToData += popupCanvas.panel_detaildashboard.SetDetailDashBoardData;
thermostatIconManager.onClickThermostatIcon += popupCanvas.panel_thermostatcontrol.SettingThermostatData; thermostatIconManager.onClickThermostatIcon += popupCanvas.panel_thermostatcontrol.SettingThermostatData;
machineClickManager.onLeftClickMachine += popupCanvas.MachineDashBoardOpen; //machineClickManager.onLeftClickMachine += popupCanvas.MachineDashBoardOpen;
machineClickManager.onLeftClickMachine += highLightManager.ClickMachinToHighlight; machineClickManager.onLeftClickMachine += highLightManager.ClickMachinToHighlight;
machineClickManager.onLeftClickArea += highLightManager.ClickArea; machineClickManager.onLeftClickArea += highLightManager.ClickArea;
optionManager.onCompletedLoadOption += popupCanvas.panel_controlsetting.InitOptionSetting;
optionManager.onCompletedLoadOption += popupCanvas.panel_protocolsetting.InitOptionSetting; optionManager.onCompletedLoadOption += popupCanvas.panel_protocolsetting.InitOptionSetting;
optionManager.LoadOption(); optionManager.LoadOption();
} }
private void SceneReLoad() private void SceneReLoad()
{ {
controller.option.isFirstPersonView = false; //controller.option.isFirstPersonView = false;
SceneManager.LoadScene(SceneManager.GetActiveScene().name); SceneManager.LoadScene(SceneManager.GetActiveScene().name);
} }
} }

View File

@@ -49,13 +49,10 @@ namespace CHN
return; return;
} }
if (controller.IsClickUI)
return;
LayerMask exceptionLayer = LayerMask.GetMask("Floor", "Ground"); LayerMask exceptionLayer = LayerMask.GetMask("Floor", "Ground");
LayerMask layerMask = floorLayers & ~exceptionLayer; LayerMask layerMask = floorLayers & ~exceptionLayer;
Ray ray = controller.camera.ScreenPointToRay(Input.mousePosition); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
hitInfo = Physics.RaycastAll(ray, Mathf.Infinity, layerMask); hitInfo = Physics.RaycastAll(ray, Mathf.Infinity, layerMask);
if (hitInfo.Length == 0) if (hitInfo.Length == 0)
@@ -82,15 +79,10 @@ namespace CHN
{ {
bool leftClick = Input.GetMouseButtonDown(0); bool leftClick = Input.GetMouseButtonDown(0);
if (controller.IsClickUI)
{
return;
}
LayerMask exceptionLayer = LayerMask.GetMask("Machine"); LayerMask exceptionLayer = LayerMask.GetMask("Machine");
LayerMask layerMask = floorLayers & ~exceptionLayer; LayerMask layerMask = floorLayers & ~exceptionLayer;
var ray = controller.camera.ScreenPointToRay(Input.mousePosition); var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
hitInfo = Physics.RaycastAll(ray, Mathf.Infinity, layerMask); hitInfo = Physics.RaycastAll(ray, Mathf.Infinity, layerMask);
if (hitInfo.Length == 0) if (hitInfo.Length == 0)

View File

@@ -34,19 +34,19 @@ namespace CHN
[Range(0.1f, 2f)] public float scaleClamp; [Range(0.1f, 2f)] public float scaleClamp;
private List<RectTransform> activeUIElements = new(); private List<RectTransform> activeUIElements = new();
private Vector3[] worldCorners = new Vector3[4]; // 개선사항: GC 방지용 미리 할당 private Vector3[] worldCorners = new Vector3[4]; // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: GC <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20≯<EFBFBD> <20>Ҵ<EFBFBD>
private void Start() private void Start()
{ {
cam = FindSingle<OrbitalController>(); // 개선사항: Start에서 한 번만 호출하여 캐싱 cam = FindSingle<OrbitalController>(); // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Start<72><74><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> ȣ<><C8A3><EFBFBD>Ͽ<EFBFBD> ij<><C4B3>
building = FindSingle<Building>(); building = FindSingle<Building>();
// 주기적으로 무거운 연산을 실행 (매 프레임 X) // <EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ſ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> X)
StartCoroutine(UpdateLoop()); StartCoroutine(UpdateLoop());
} }
private System.Collections.IEnumerator UpdateLoop() private System.Collections.IEnumerator UpdateLoop()
{ {
var wait = new WaitForSeconds(updateInterval); // 개선사항: 매 프레임 실행하던 로직을 updateInterval마다 실행하도록 변경 var wait = new WaitForSeconds(updateInterval); // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> updateInterval<61><6C><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD> <20><><EFBFBD><EFBFBD>
while (true) while (true)
{ {
Profiler.BeginSample("MachineKPI_TotalUpdate"); Profiler.BeginSample("MachineKPI_TotalUpdate");
@@ -56,14 +56,14 @@ namespace CHN
GroupOverlappingUIElements(); GroupOverlappingUIElements();
} }
Profiler.EndSample(); Profiler.EndSample();
yield return wait; // 개선사항: 루프 밖에서 딱 한번 생성하여 캐싱해둔 것을 재사용 -> 메모리 할당 0 yield return wait; // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD> <20>ۿ<EFBFBD><DBBF><EFBFBD> <20><> <20>ѹ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> ij<><C4B3><EFBFBD>ص<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> -> <20>޸<EFBFBD> <20>Ҵ<EFBFBD> 0
} }
} }
#region Machine #region Machine
public void SetMachineKPI(List<MachineDataSet> machineData) public void SetMachineKPI(List<MachineDataSet> machineData)
{ {
prefab_MachineKPI = Resources.Load<UI_MachineKPI>("Prefabs/UI/PRF_UI_MachineKPI"); prefab_MachineKPI = Resources.Load<UI_MachineKPI>("UI/Prefabs/PRF_UI_MachineKPI");
machines = building.floors.SelectMany(f => f.machines).ToArray(); machines = building.floors.SelectMany(f => f.machines).ToArray();
Clear(); Clear();
@@ -99,9 +99,9 @@ namespace CHN
private void UpdateMachineVisibilityAndScale() private void UpdateMachineVisibilityAndScale()
{ {
// 개선사항: 기존 RangeDetection 함수 -> 코루틴 안에서 실행되는 가시성 업데이트 루프에 포함 // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD> RangeDetection <EFBFBD>Լ<EFBFBD> -> <EFBFBD>ڷ<EFBFBD>ƾ <20>ȿ<EFBFBD><C8BF><EFBFBD> <20><><EFBFBD><EFBFBD>Ǵ<EFBFBD> <20><><EFBFBD>ü<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
int layerMask = LayerMask.GetMask("Camera", "Floor Wall"); int layerMask = LayerMask.GetMask("Camera", "Floor Wall");
float t = Mathf.InverseLerp(cam.option.maxDistance, 0f, cam.option.currentDistance); float t = Mathf.InverseLerp(cam.maxDistance, 0f, cam.currentDistance);
float scaleValue = Mathf.Lerp(minScale, maxScale, t); float scaleValue = Mathf.Lerp(minScale, maxScale, t);
Vector3 newScale = new Vector3(scaleValue, scaleValue, scaleValue); Vector3 newScale = new Vector3(scaleValue, scaleValue, scaleValue);
@@ -116,8 +116,8 @@ namespace CHN
{ {
machine.machineKPI.Active(); machine.machineKPI.Active();
machine.machineKPI.transform.localScale = newScale; machine.machineKPI.transform.localScale = newScale;
// 월드 좌표를 스크린 좌표로 변환하여 1차 배치 // <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ǥ<EFBFBD><C7A5> <20><>ũ<EFBFBD><C5A9> <20><>ǥ<EFBFBD><C7A5> <20><>ȯ<EFBFBD>Ͽ<EFBFBD> 1<><31> <20><>ġ
Vector3 screenPos = cam.camera.WorldToScreenPoint(machine.centerPos + Vector3.up * defaultNameHeight); Vector3 screenPos = Camera.main.WorldToScreenPoint(machine.centerPos + Vector3.up * defaultNameHeight);
machine.machineKPI.transform.position = screenPos; machine.machineKPI.transform.position = screenPos;
activeUIElements.Add(machine.machineKPI.rectTransform); activeUIElements.Add(machine.machineKPI.rectTransform);
} }
@@ -130,17 +130,17 @@ namespace CHN
private bool IsMachineVisible(Machine machine, Floor currentFloor, int layerMask) private bool IsMachineVisible(Machine machine, Floor currentFloor, int layerMask)
{ {
// 개선사항: 가장 가벼운 연산부터 수행 -> 실패 시 바로 리턴하도록 (조기 리턴) // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> -> <20><><EFBFBD><EFBFBD> <20><> <20>ٷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD> (<28><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)
// 층 검사 (기존 MachineKPIsActive 함수) // <EFBFBD><EFBFBD> <20>˻<EFBFBD> (<28><><EFBFBD><EFBFBD> MachineKPIsActive <EFBFBD>Լ<EFBFBD>)
if (machine.GetComponentInParent<Floor>() != currentFloor) return false; if (machine.GetComponentInParent<Floor>() != currentFloor) return false;
// 화면 안에 있는지 검사 (기존 IsScreenRange 함수) // ȭ<EFBFBD><EFBFBD> <20>ȿ<EFBFBD> <20>ִ<EFBFBD><D6B4><EFBFBD> <20>˻<EFBFBD> (<28><><EFBFBD><EFBFBD> IsScreenRange <EFBFBD>Լ<EFBFBD>)
Vector3 viewPos = cam.camera.WorldToViewportPoint(machine.centerPos); Vector3 viewPos = Camera.main.WorldToViewportPoint(machine.centerPos);
if (!(viewPos.x >= 0 && viewPos.x <= 1 && viewPos.y >= 0 && viewPos.y <= 1 && viewPos.z > 0)) return false; if (!(viewPos.x >= 0 && viewPos.x <= 1 && viewPos.y >= 0 && viewPos.y <= 1 && viewPos.z > 0)) return false;
// 레이캐스트 (기존 MachineKPIsActive 함수) // <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD>Ʈ (<28><><EFBFBD><EFBFBD> MachineKPIsActive <EFBFBD>Լ<EFBFBD>)
Vector3 dir = cam.camera.transform.position - machine.centerPos; Vector3 dir = Camera.main.transform.position - machine.centerPos;
if (Physics.Raycast(machine.centerPos, dir, out RaycastHit hit, Mathf.Infinity, layerMask)) if (Physics.Raycast(machine.centerPos, dir, out RaycastHit hit, Mathf.Infinity, layerMask))
{ {
return hit.collider.gameObject.layer == LayerMask.NameToLayer("Camera"); return hit.collider.gameObject.layer == LayerMask.NameToLayer("Camera");
@@ -154,11 +154,11 @@ namespace CHN
{ {
if (activeUIElements.Count == 0) return; if (activeUIElements.Count == 0) return;
// 개선사항: uncheckedElements.Where(...) 같은 할당 연산 제거 -> 복잡한 그룹 계산 없이 정렬 // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: uncheckedElements.Where(...) <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ҵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> -> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>׷<EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
// 정렬: Y좌표 기준으로 정렬하여 아래서부터 쌓음 (LINQ 대신 List.Sort로 할당 방지) // <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Y<><59>ǥ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> <20>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (LINQ <EFBFBD><EFBFBD><EFBFBD> List.Sort<EFBFBD><EFBFBD> <20>Ҵ<EFBFBD> <20><><EFBFBD><EFBFBD>)
activeUIElements.Sort((a, b) => a.position.y.CompareTo(b.position.y)); activeUIElements.Sort((a, b) => a.position.y.CompareTo(b.position.y));
// 단순화된 중첩 방지 로직 (그리드나 그룹핑 대신 순차적 체크) // <EFBFBD>ܼ<EFBFBD>ȭ<EFBFBD><EFBFBD> <20><>ø <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28>׸<EFBFBD><D7B8><20>׷<EFBFBD><D7B7><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ)
for (int i = 0; i < activeUIElements.Count; i++) for (int i = 0; i < activeUIElements.Count; i++)
{ {
for (int j = i + 1; j < activeUIElements.Count; j++) for (int j = i + 1; j < activeUIElements.Count; j++)
@@ -168,7 +168,7 @@ namespace CHN
if (AreRectsOverlapping(rectA, rectB)) if (AreRectsOverlapping(rectA, rectB))
{ {
// 겹치면 B를 A 위로 올림 // <EFBFBD><EFBFBD>ġ<EFBFBD><EFBFBD> B<><42> A <20><><EFBFBD><EFBFBD> <20>ø<EFBFBD>
float offset = rectA.rect.height * rectA.lossyScale.y; float offset = rectA.rect.height * rectA.lossyScale.y;
rectB.position = new Vector3(rectB.position.x, rectA.position.y + offset, rectB.position.z); rectB.position = new Vector3(rectB.position.x, rectA.position.y + offset, rectB.position.z);
} }
@@ -181,7 +181,7 @@ namespace CHN
} }
private Rect GetWorldRect(RectTransform rectTransform) private Rect GetWorldRect(RectTransform rectTransform)
{ {
rectTransform.GetWorldCorners(worldCorners); // 개선사항: worldCorners를 멤버 변수로 캐싱 -> GetWorldRect 호출 시마다 발생하는 배열 생성 막음 rectTransform.GetWorldCorners(worldCorners); // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: worldCorners<EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ij<><C4B3> -> GetWorldRect ȣ<><C8A3> <20>ø<EFBFBD><C3B8><EFBFBD> <20>߻<EFBFBD><DFBB>ϴ<EFBFBD> <20><20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
return new Rect(worldCorners[0], worldCorners[2] - worldCorners[0]); return new Rect(worldCorners[0], worldCorners[2] - worldCorners[0]);
} }

View File

@@ -20,10 +20,6 @@ public class ViewManager : MonoBehaviour, ISingle
public void ChangeViewWithButtonClick(ViewMode mode) public void ChangeViewWithButtonClick(ViewMode mode)
{ {
preViewMode = controller.viewMode; preViewMode = controller.viewMode;
var preViewModeData = new CameraEntity();
preViewModeData.distance = controller.option.currentDistance;
preViewModeData.azimuth = controller.option.currentAzimuth;
preViewModeData.elevation = controller.option.currentElevation;
controller.SetViewMode(mode); controller.SetViewMode(mode);
@@ -36,86 +32,18 @@ public class ViewManager : MonoBehaviour, ISingle
case ViewMode.TopView: case ViewMode.TopView:
SetTopView(); SetTopView();
break; break;
case ViewMode.FirstPersonView:
SetFirstPersonView(preViewMode, preViewModeData);
break;
} }
controller.LastPositioning(true); controller.LastPositioning();
} }
private void SetPerPerspectiveView() private void SetPerPerspectiveView()
{ {
if(controller.saveTargetPositions[ViewMode.PerspectiveView] == null) controller.SetViewMode(ViewMode.PerspectiveView);
{ building.SetAllFloorExternalState();
var perspectivePos = controller.option.target.position;
var newPos = new Vector3(perspectivePos.x, building.currentFloor.StartPoint.position.y, perspectivePos.z);
controller.nextPosition = newPos;
building.SetAllFloorExternalState();
}
else
{
building.SetAllFloorExternalState();
var floorIndex = controller.saveTargetPositions[ViewMode.PerspectiveView].floorIndex;
var slider = FindSingle<Canvas_Popup>().panel_floorcontrol;
slider.ChangeValueFromOutside(floorIndex);
}
} }
private void SetTopView() private void SetTopView()
{ {
if (controller.saveTargetPositions[ViewMode.TopView] == null) controller.SetViewMode(ViewMode.TopView);
{ building.SetAllFloorExternalState();
var pos = controller.nextPosition;
pos.y = building.currentFloor.StartPoint.position.y;
controller.nextPosition = pos;
building.SetAllFloorExternalState();
}
else
{
building.SetAllFloorExternalState();
var floorIndex = controller.saveTargetPositions[ViewMode.TopView].floorIndex;
var slider = FindSingle<Canvas_Popup>().panel_floorcontrol;
slider.ChangeValueFromOutside(floorIndex);
}
}
private void SetFirstPersonView(ViewMode preViewMode, CameraEntity preViewModeData)
{
if (building.currentFloor.isEmptyFloor)
{
controller.SetViewMode(preViewMode);
controller.option.currentDistance = preViewModeData.distance;
controller.option.currentAzimuth = preViewModeData.azimuth;
controller.option.currentElevation = preViewModeData.elevation;
return;
}
if (controller.saveTargetPositions[ViewMode.FirstPersonView] == null)
{
building.SetCurrentFloorInternalState();
var pos = controller.option.target.position;
var startPoint = building.currentFloor.StartPoint.transform;
if (building.currentFloor.FloorContainsPoint(pos))
{
var tourModePos = new Vector3(pos.x, startPoint.position.y, pos.z);
startPoint.position = tourModePos;
}
controller.nextPosition = startPoint.position;
CheckHitWall();
}
else
{
building.SetCurrentFloorInternalState();
var floorIndex = controller.saveTargetPositions[ViewMode.FirstPersonView].floorIndex;
var slider = FindSingle<Canvas_Popup>().panel_floorcontrol;
slider.ChangeValueFromOutside(floorIndex);
}
} }
public void SetTargetPosToMachine(Machine machine) public void SetTargetPosToMachine(Machine machine)
@@ -139,73 +67,9 @@ public class ViewManager : MonoBehaviour, ISingle
var slider = FindSingle<Canvas_Popup>().panel_floorcontrol; var slider = FindSingle<Canvas_Popup>().panel_floorcontrol;
slider.ChangeValueFromOutside(changeFloor); slider.ChangeValueFromOutside(changeFloor);
controller.option.currentAzimuth = machine.focusAzimuth; controller.currentAzimuth = machine.focusAzimuth;
controller.option.currentElevation = machine.focusElevation; controller.currentElevation = machine.focusElevation;
controller.option.currentDistance = machine.focusDistance; controller.currentDistance = machine.focusDistance;
controller.SetTargetPos(centerPos); controller.SetTargetPos(centerPos);
} }
public void ChangeViewWithFloorControl(Floor currentFloor, Vector3 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.nextPosition = building.currentFloor.StartPoint.position;
}
}
}
building.SetAllFloorExternalState();
if (!controller.option.isFirstPersonView)
return;
currentFloor.SetInternalState();
controller.LastPositioning(true);
}
private void CheckHitWall()
{
var targetPosition = controller.option.target.position;
if (!IsPositionBlocked(targetPosition))
return;
Vector3[] directions = { Vector3.forward, Vector3.back, Vector3.left, Vector3.right };
var foundFreeSpot = false;
for (int attempt = 0; attempt < maxPushAttempts && !foundFreeSpot; attempt++)
{
foreach (var dir in directions)
{
var candidatePos = targetPosition + dir * pushOutDistance * attempt;
if (!IsPositionBlocked(candidatePos))
{
targetPosition = candidatePos;
foundFreeSpot = true;
break;
}
}
}
if (!foundFreeSpot)
{
targetPosition = building.currentFloor.StartPoint.position;
}
controller.nextPosition = targetPosition;
}
bool IsPositionBlocked(Vector3 position)
{
return Physics.CheckSphere(position, checkRadius, wallLayer);
}
} }

View File

@@ -28,7 +28,6 @@ namespace CHN
SetAllFloorExternalState(); SetAllFloorExternalState();
} }
public void SetTopFloor(int index) public void SetTopFloor(int index)
{ {
for (int i = 0; i < floors.Count; ++i) for (int i = 0; i < floors.Count; ++i)
@@ -39,11 +38,9 @@ namespace CHN
currentFloor = floors[index]; currentFloor = floors[index];
var pos = controller.option.target.position; var pos = controller.cameraPivot.transform.position;
pos.y = currentFloor.StartPoint.position.y; pos.y = currentFloor.StartPoint.position.y;
controller.SetTargetPos(pos); controller.SetTargetPos(pos);
onChangeFloor?.Invoke(currentFloor, pos);
} }
public Floor GetFloor(int index) public Floor GetFloor(int index)
@@ -65,42 +62,10 @@ namespace CHN
{ {
floor.SetExternalState(); floor.SetExternalState();
} }
currentFloor.TopSurfaces.SetActive(true);
}
public void ActiveBuliding() if (currentFloor.TopSurfaces != null)
{
foreach(var floor in floors)
{ {
floor.ActiveFloor(); currentFloor.TopSurfaces.SetActive(true);
}
}
public void DeactiveBuliding()
{
foreach (var floor in floors)
{
floor.DeactiveFloor();
}
}
public void SetActiveWalls(bool isOn)
{
foreach (var floor in floors)
{
floor.SetActiveWall(isOn);
}
}
public void SetActiveGrounds(bool isOn)
{
foreach (var floor in floors)
{
floor.SetActiveGround(isOn);
}
}
public void SetActiveDecos(bool isOn)
{
foreach (var floor in floors)
{
floor.SetActiveDeco(isOn);
} }
} }
} }

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using WI;
namespace CHN namespace CHN
{ {
@@ -20,11 +21,14 @@ namespace CHN
public GameObject FloorGroundCollider; public GameObject FloorGroundCollider;
public GameObject Ceiling; public GameObject Ceiling;
private void Start() private void Awake()
{ {
if(StartPoint == null) if(StartPoint == null)
{ {
StartPoint.transform.position = new Vector3(1, 1, 1); StartPoint = new GameObject(nameof(StartPoint)).transform;
StartPoint.SetParent(transform);
StartPoint.transform.position = transform.GetMeshGroupCenter();
} }
} }
@@ -50,58 +54,28 @@ namespace CHN
public void SetInternalState() public void SetInternalState()
{ {
if(Ceiling == null) if(Ceiling == null)
{
return; return;
}
Ceiling.SetActive(true); Ceiling.SetActive(true);
if (TopSurfaces == null)
return;
TopSurfaces.SetActive(false); TopSurfaces.SetActive(false);
} }
public void SetExternalState() public void SetExternalState()
{ {
if(TopSurfaces == null) if (TopSurfaces == null)
{
return; return;
}
TopSurfaces.SetActive(false); TopSurfaces.SetActive(false);
if (Ceiling == null)
return;
Ceiling.SetActive(false); Ceiling.SetActive(false);
} }
public void ActiveFloor()
{
SetActiveWall(true);
SetActiveGround(true);
SetActiveDeco(true);
}
public void DeactiveFloor()
{
SetActiveWall(false);
SetActiveGround(false);
SetActiveDeco(false);
}
public void SetActiveWall(bool isOn)
{
if (Walls == null)
return;
Walls.SetActive(isOn);
}
public void SetActiveGround(bool isOn)
{
if (Grounds == null)
return;
Grounds.SetActive(isOn);
}
public void SetActiveDeco(bool isOn)
{
if (Decos == null)
return;
Decos.SetActive(isOn);
}
} }
} }

View File

@@ -70,10 +70,16 @@ namespace CHN
public void ActiveHighLighter() public void ActiveHighLighter()
{ {
if (highLighter == null)
return;
highLighter.gameObject.SetActive(true); highLighter.gameObject.SetActive(true);
} }
public void DeactiveHighLighter() public void DeactiveHighLighter()
{ {
if (highLighter == null)
return;
highLighter.gameObject.SetActive(false); highLighter.gameObject.SetActive(false);
} }

View File

@@ -34,41 +34,41 @@ namespace CHN
//public Panel_MachineDashBoard panel_machinedashboard; //public Panel_MachineDashBoard panel_machinedashboard;
public RectTransform dashboardPoint; public RectTransform dashboardPoint;
private Dictionary<Machine, Panel_MachineDashBoard> machineDashboardTable = new(); //private Dictionary<Machine, Panel_MachineDashBoard> machineDashboardTable = new();
public Action<Machine> onClickSimple; //public Action<Machine> onClickSimple;
public Action<Machine> onClickDetail; //public Action<Machine> onClickDetail;
public Action<Machine,HashSet<string>> simpleView; //public Action<Machine,HashSet<string>> simpleView;
public Action onCloseDashBoard; //public Action onCloseDashBoard;
public Panel_MachineDashBoard currentDashBoard; //public Panel_MachineDashBoard currentDashBoard;
public Action onOpenDashboard; //public Action onOpenDashboard;
public bool isSimpleDashboardAcitve; //public bool isSimpleDashboardAcitve;
public void ActiveSimpleDashBoard() //public void ActiveSimpleDashBoard()
{ //{
isSimpleDashboardAcitve = true; // isSimpleDashboardAcitve = true;
} //}
public void DeactiveSimpleDashBoard() //public void DeactiveSimpleDashBoard()
{ //{
isSimpleDashboardAcitve = false; // isSimpleDashboardAcitve = false;
} //}
public override void AfterAwake() public override void AfterAwake()
{ {
var asset = Resources.Load<Panel_MachineDashBoard>("Prefabs/UI/PRF_Panel_MachineDashBoard"); //var asset = Resources.Load<Panel_MachineDashBoard>("Prefabs/UI/PRF_Panel_MachineDashBoard");
var machines = FindObjectsByType<Machine>(FindObjectsSortMode.None); //var machines = FindObjectsByType<Machine>(FindObjectsSortMode.None);
foreach (var machine in machines) //foreach (var machine in machines)
{ //{
var dashboard = Instantiate<Panel_MachineDashBoard>(asset, transform); // var dashboard = Instantiate<Panel_MachineDashBoard>(asset, transform);
dashboard.Close(); // dashboard.Close();
dashboard.simpleView += simpleView; // dashboard.simpleView += simpleView;
machineDashboardTable.Add(machine, dashboard); // machineDashboardTable.Add(machine, dashboard);
dashboard.onClickSimple += onClickSimple; // dashboard.onClickSimple += onClickSimple;
dashboard.onClickDetail += onClickDetail; // dashboard.onClickDetail += onClickDetail;
dashboard.onClose += onCloseDashBoard; // dashboard.onClose += onCloseDashBoard;
} //}
productionPanels.Add(panel_assemblyproduction); productionPanels.Add(panel_assemblyproduction);
productionPanels.Add(panel_injectionproduction); productionPanels.Add(panel_injectionproduction);
productionPanels.Add(panel_workprogressstatus); productionPanels.Add(panel_workprogressstatus);
@@ -79,47 +79,46 @@ namespace CHN
popupPanels.RemoveAll(item => productionPanels.Contains(item as IDashboardUI)); popupPanels.RemoveAll(item => productionPanels.Contains(item as IDashboardUI));
} }
public void MachineDashBoardOpen(Machine clickMachine) //public void MachineDashBoardOpen(Machine clickMachine)
{ //{
if (!isSimpleDashboardAcitve) // if (!isSimpleDashboardAcitve)
return; // return;
if (currentDashBoard != null) // if (currentDashBoard != null)
{ // {
currentDashBoard.SetActive(false); // currentDashBoard.SetActive(false);
} // }
currentDashBoard = machineDashboardTable[clickMachine]; // currentDashBoard = machineDashboardTable[clickMachine];
currentDashBoard.OpenFromMachine(clickMachine); // currentDashBoard.OpenFromMachine(clickMachine);
SetDashBoardPosition(); // SetDashBoardPosition();
onOpenDashboard?.Invoke(); // onOpenDashboard?.Invoke();
} //}
public void SimpleView(Machine machine, MachineDataSet data) //public void SimpleView(Machine machine, MachineDataSet data)
{ //{
machineDashboardTable[machine].SimpleInfoView(data); // machineDashboardTable[machine].SimpleInfoView(data);
} //}
public void DetailView(Machine machine, MachineDataSet data) //public void DetailView(Machine machine, MachineDataSet data)
{ //{
machineDashboardTable[machine].DetailInfoView(machine, data); // machineDashboardTable[machine].DetailInfoView(machine, data);
} //}
public void CurrentDashoboardClose() //public void CurrentDashoboardClose()
{ //{
if (currentDashBoard != null) // if (currentDashBoard != null)
{ // {
currentDashBoard.Clear(); // currentDashBoard.Clear();
currentDashBoard.SetActive(false); // currentDashBoard.SetActive(false);
} // }
} //}
public void SetDashBoardPosition() //public void SetDashBoardPosition()
{ //{
currentDashBoard.transform.position = dashboardPoint.transform.position; // currentDashBoard.transform.position = dashboardPoint.transform.position;
currentDashBoard.transform.SetAsLastSibling(); // currentDashBoard.transform.SetAsLastSibling();
} //}
public Panel_ControlSetting panel_controlsetting;
public Panel_ProtocolSetting panel_protocolsetting; public Panel_ProtocolSetting panel_protocolsetting;
public void SetChangedProductionPanel(PanelBase newPanel) public void SetChangedProductionPanel(PanelBase newPanel)

View File

@@ -26,7 +26,7 @@ namespace CHN
public override void AfterAwake() public override void AfterAwake()
{ {
prefab_completeTimeAlarmInfo = Resources.Load<UI_CompleteTimeAlarmInfo>("Prefabs/UI/PRF_UI_CompleteTimeAlramInfo"); prefab_completeTimeAlarmInfo = Resources.Load<UI_CompleteTimeAlarmInfo>("UI/Prefabs/PRF_UI_CompleteTimeAlramInfo");
Button_Close.onClick.AddListener(Close); Button_Close.onClick.AddListener(Close);
notCheckAlramList.Clear(); notCheckAlramList.Clear();
completeInfoList.Clear(); completeInfoList.Clear();

View File

@@ -68,8 +68,8 @@ public class Panel_DetailDashBoard : PanelBase
public void SetDetailDashBoardData(MachineDataSet data, Machine machine) public void SetDetailDashBoardData(MachineDataSet data, Machine machine)
{ {
var canvas_popup = FindSingle<Canvas_Popup>(); var canvas_popup = FindSingle<Canvas_Popup>();
if (canvas_popup.isSimpleDashboardAcitve) //if (canvas_popup.isSimpleDashboardAcitve)
return; // return;
SetTextData(data, machine); SetTextData(data, machine);
SetSliderData(data); SetSliderData(data);

View File

@@ -18,7 +18,7 @@ namespace CHN
public override void AfterStart() public override void AfterStart()
{ {
prefab_floorButton = Resources.Load<UI_FloorButton>("Prefabs/UI/PRF_UI_FloorButton"); prefab_floorButton = Resources.Load<UI_FloorButton>("UI/Prefabs/PRF_UI_FloorButton");
SettingButtons(5); SettingButtons(5);
SetActive(false); SetActive(false);
} }

View File

@@ -44,8 +44,8 @@ namespace CHN
public override void AfterAwake() public override void AfterAwake()
{ {
dataOrder = Resources.Load<TextAsset>("DataOrder").text; dataOrder = Resources.Load<TextAsset>("DataOrder").text;
prf_LibraryButton = Resources.Load<UI_LibraryButton>("Prefabs/UI/PRF_UI_LibraryButton"); prf_LibraryButton = Resources.Load<UI_LibraryButton>("UI/Prefabs/PRF_UI_LibraryButton");
prf_FilterToggle = Resources.Load<UI_FilterButton>("Prefabs/UI/PRF_UI_FilterButton"); prf_FilterToggle = Resources.Load<UI_FilterButton>("UI/Prefabs/PRF_UI_FilterButton");
Button_Active.onClick.AddListener(OnClickActiveButton); Button_Active.onClick.AddListener(OnClickActiveButton);
originPos = rectTransform.anchoredPosition; originPos = rectTransform.anchoredPosition;

View File

@@ -42,7 +42,7 @@ namespace CHN
private Button currentTabButton; private Button currentTabButton;
public override void AfterAwake() public override void AfterAwake()
{ {
prf_InfoItem = Resources.Load<UI_MachineInfoItem>("Prefabs/UI/PRF_UI_MachineInfoItem"); prf_InfoItem = Resources.Load<UI_MachineInfoItem>("UI/Prefabs/PRF_UI_MachineInfoItem");
Button_Close.onClick.AddListener(Close); Button_Close.onClick.AddListener(Close);
Button_Simple.onClick.AddListener(OnClickSimple); Button_Simple.onClick.AddListener(OnClickSimple);
Button_Detail.onClick.AddListener(OnClickDetail); Button_Detail.onClick.AddListener(OnClickDetail);

View File

@@ -15,8 +15,6 @@ namespace CHN
public Button Button_ProductionProgress; public Button Button_ProductionProgress;
public Button Button_AssemblyProgress; public Button Button_AssemblyProgress;
public Button Button_FinalInspection; public Button Button_FinalInspection;
public Button Button_AssemblyProgressLine;
public Button Button_MoldDepartment;
public Button Button_Alrams; public Button Button_Alrams;
public Button Button_Setting; public Button Button_Setting;
public Button Button_Exit; public Button Button_Exit;
@@ -27,8 +25,6 @@ namespace CHN
public Action onClickProductionProgress; public Action onClickProductionProgress;
public Action onClickAssemblyProgress; public Action onClickAssemblyProgress;
public Action onClickFinalInspection; public Action onClickFinalInspection;
public Action onClickAssemblyProgressLine;
public Action onClickMoldDepartment;
public Action onClickAlarms; public Action onClickAlarms;
public Action onClickSetting; public Action onClickSetting;
public Action onClickExit; public Action onClickExit;
@@ -47,8 +43,6 @@ namespace CHN
Button_ProductionProgress.onClick.AddListener(OnClickProductionProgress); Button_ProductionProgress.onClick.AddListener(OnClickProductionProgress);
Button_AssemblyProgress.onClick.AddListener(OnClickAssemblyProgress); Button_AssemblyProgress.onClick.AddListener(OnClickAssemblyProgress);
Button_FinalInspection.onClick.AddListener(OnClickFinalInspection); Button_FinalInspection.onClick.AddListener(OnClickFinalInspection);
Button_AssemblyProgressLine.onClick.AddListener(OnClickAssemblyProgressLine);
Button_MoldDepartment.onClick.AddListener(OnClickMoldDepartment);
Button_Alrams.onClick.AddListener(OnClickAlrams); Button_Alrams.onClick.AddListener(OnClickAlrams);
Button_Setting.onClick.AddListener(OnClickSetting); Button_Setting.onClick.AddListener(OnClickSetting);
Button_Exit.onClick.AddListener(OnClickExit); Button_Exit.onClick.AddListener(OnClickExit);
@@ -104,20 +98,6 @@ namespace CHN
onClickFinalInspection?.Invoke(); onClickFinalInspection?.Invoke();
} }
private void OnClickAssemblyProgressLine()
{
if (isClickable)
return;
onClickAssemblyProgressLine?.Invoke();
}
private void OnClickMoldDepartment()
{
if (isClickable)
return;
onClickMoldDepartment?.Invoke();
}
private void OnClickAlrams() private void OnClickAlrams()
{ {
if (isClickable) if (isClickable)

View File

@@ -60,8 +60,8 @@ public class Panel_TotalProduction : PanelBase, IDashboardUI
public override void AfterAwake() public override void AfterAwake()
{ {
prf_statusContent = Resources.Load<UI_MachineStatusContent>("Prefabs/UI/PRF_UI_MachineStatusContent"); prf_statusContent = Resources.Load<UI_MachineStatusContent>("UI/Prefabs/PRF_UI_MachineStatusContent");
prf_effectivenessContent = Resources.Load<UI_MachineEffectivenessContent>("Prefabs/UI/PRF_UI_MachineEffectivenessContent"); prf_effectivenessContent = Resources.Load<UI_MachineEffectivenessContent>("UI/Prefabs/PRF_UI_MachineEffectivenessContent");
WorkProgressContent = transform.GetComponentInChildren<UI_WorkProgressContent>(true); WorkProgressContent = transform.GetComponentInChildren<UI_WorkProgressContent>(true);
effect = FindSingle<Panel_Effect>(); effect = FindSingle<Panel_Effect>();
Button_Close.onClick.AddListener(OnClickCloseButton); Button_Close.onClick.AddListener(OnClickCloseButton);

View File

@@ -13,7 +13,7 @@ public class UI_MachineEffectivenessContent : UIBase
public override void AfterAwake() public override void AfterAwake()
{ {
prf_machineEffectiveness = Resources.Load<UI_MachineEffectivenessItem>("Prefabs/UI/PRF_UI_MachineEffectivenessItem"); prf_machineEffectiveness = Resources.Load<UI_MachineEffectivenessItem>("UI/Prefabs/PRF_UI_MachineEffectivenessItem");
} }
public void SetProductionStatusItem(List<MachineDataSet> machineDataSets, MachineType type) public void SetProductionStatusItem(List<MachineDataSet> machineDataSets, MachineType type)

View File

@@ -11,7 +11,7 @@ public class UI_MachineStatusContent : UIBase
public override void AfterAwake() public override void AfterAwake()
{ {
prf_machineStatus = Resources.Load<UI_MachineStatusItem>("Prefabs/UI/PRF_UI_MachineStatusItem"); prf_machineStatus = Resources.Load<UI_MachineStatusItem>("UI/Prefabs/PRF_UI_MachineStatusItem");
} }
public void SetProductionStatusItem(List<CompleteInfo> machineInfos, MachineType type) public void SetProductionStatusItem(List<CompleteInfo> machineInfos, MachineType type)

View File

@@ -927,7 +927,7 @@ PlayerSettings:
qnxGraphicConfPath: qnxGraphicConfPath:
apiCompatibilityLevel: 3 apiCompatibilityLevel: 3
captureStartupLogs: {} captureStartupLogs: {}
activeInputHandler: 1 activeInputHandler: 2
windowsGamepadBackendHint: 0 windowsGamepadBackendHint: 0
cloudProjectId: 8c7e7d7c-2455-4864-ae12-b89709ce93db cloudProjectId: 8c7e7d7c-2455-4864-ae12-b89709ce93db
framebufferDepthMemorylessMode: 0 framebufferDepthMemorylessMode: 0