iT DONTY WORK KDJMGHDFSJHFG

This commit is contained in:
Pasha Bibko
2025-04-02 07:55:08 +01:00
parent 70a71a06e5
commit 140cbd646f
5 changed files with 297 additions and 21 deletions

View File

@@ -47,7 +47,9 @@ MonoBehaviour:
m_OtherPortal: {fileID: 0} m_OtherPortal: {fileID: 0}
m_CameraPrefab: {fileID: 1179287573507601862, guid: 1a28b9e152b1d3d419d1881ea498fcbf, type: 3} m_CameraPrefab: {fileID: 1179287573507601862, guid: 1a28b9e152b1d3d419d1881ea498fcbf, type: 3}
m_PortalRenderer: {fileID: 4162196787169641245} m_PortalRenderer: {fileID: 4162196787169641245}
m_CapturePoint: {fileID: 7913558143758367436} m_PlayerPoint: {fileID: 6158405577604730568}
m_Pos: {fileID: 8037706452414992202}
m_Rot: {fileID: 7913558143758367436}
--- !u!1 &1109503274534853756 --- !u!1 &1109503274534853756
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -58,7 +60,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 7913558143758367436} - component: {fileID: 7913558143758367436}
m_Layer: 0 m_Layer: 0
m_Name: CapturePoint m_Name: Rot
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@@ -72,8 +74,40 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109503274534853756} m_GameObject: {fileID: 1109503274534853756}
serializedVersion: 2 serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.20281735, y: 3.2786098, z: 13.835168} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8037706452414992202}
m_Father: {fileID: 3117384245817137028}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2957412639318883996
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6158405577604730568}
m_Layer: 0
m_Name: PlayerPos
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6158405577604730568
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2957412639318883996}
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_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@@ -162,6 +196,37 @@ MeshRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0} m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &4970227605924577730
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8037706452414992202}
m_Layer: 0
m_Name: Pos
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8037706452414992202
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4970227605924577730}
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: 7913558143758367436}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5834152528747782185 --- !u!1 &5834152528747782185
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -194,5 +259,6 @@ Transform:
- {fileID: 6525768614182165007} - {fileID: 6525768614182165007}
- {fileID: 2772991262862259612} - {fileID: 2772991262862259612}
- {fileID: 7913558143758367436} - {fileID: 7913558143758367436}
- {fileID: 6158405577604730568}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -348,7 +348,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: 10 value: 10.000004
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
@@ -356,7 +356,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: 1 value: 0.7071068
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalRotation.x propertyPath: m_LocalRotation.x
@@ -364,7 +364,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: 0 value: -0.7071068
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
@@ -376,7 +376,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalEulerAnglesHint.y propertyPath: m_LocalEulerAnglesHint.y
value: 0 value: -90
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
@@ -390,6 +390,10 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Portal value: Portal
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8672533918032425654, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalPosition.z
value: 10
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
@@ -6525,7 +6529,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: 0.7071068 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalRotation.x propertyPath: m_LocalRotation.x
@@ -6533,7 +6537,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: 0.7071068 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
@@ -6545,7 +6549,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalEulerAnglesHint.y propertyPath: m_LocalEulerAnglesHint.y
value: 90 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3} - target: {fileID: 3117384245817137028, guid: c41b43046138ded45bddaab8e10d4cf0, type: 3}
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z

View File

@@ -8,7 +8,7 @@ public class PortalCamera : MonoBehaviour
// Private members // // Private members //
PortalManager m_DisplayPortal; public PortalManager m_DisplayPortal;
PortalManager m_CapturePortal; PortalManager m_CapturePortal;
RenderTexture m_RenderTexture; RenderTexture m_RenderTexture;
@@ -43,8 +43,9 @@ public class PortalCamera : MonoBehaviour
// Update is called every frame // Update is called every frame
void Update() void Update()
{ {
// Calculates the player distance from where the portal will be rendererd Vector3 offset = m_CapturePortal.PlayerOffset();
Vector3 offset = CameraController.Instance().transform.position - m_DisplayPortal.pos; transform.parent.position = offset;
transform.parent.position = m_CapturePortal.TranslateOffset(offset);
transform.parent.position = m_CapturePortal.TranslateOffsetToSpace(m_DisplayPortal.PlayerOffset(), Vector3.zero);
} }
} }

View File

@@ -1,4 +1,3 @@
using System.ComponentModel;
using UnityEngine; using UnityEngine;
public class PortalManager : MonoBehaviour public class PortalManager : MonoBehaviour
@@ -9,7 +8,11 @@ public class PortalManager : MonoBehaviour
[Header("Set References")] [Header("Set References")]
[SerializeField] GameObject m_CameraPrefab; [SerializeField] GameObject m_CameraPrefab;
[SerializeField] MeshRenderer m_PortalRenderer; [SerializeField] MeshRenderer m_PortalRenderer;
[SerializeField] Transform m_CapturePoint;
[Header("Points")]
[SerializeField] Transform m_PlayerPoint;
[SerializeField] Transform m_Pos;
[SerializeField] Transform m_Rot;
PortalManager m_OtherManager; PortalManager m_OtherManager;
PortalCamera m_PortalCamera; PortalCamera m_PortalCamera;
@@ -19,6 +22,10 @@ public class PortalManager : MonoBehaviour
public Vector3 pos => transform.parent.position; public Vector3 pos => transform.parent.position;
public Quaternion rot => transform.parent.rotation; public Quaternion rot => transform.parent.rotation;
public void SetPos(Vector3 v) => transform.parent.position = v;
public Vector3 PlayerOffset() => m_PlayerPoint.position;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
@@ -37,9 +44,18 @@ public class PortalManager : MonoBehaviour
// Initialises the camera so it renders to the portal and not the screen // Initialises the camera so it renders to the portal and not the screen
m_PortalCamera.InitCamera(m_PortalRenderer, this); m_PortalCamera.InitCamera(m_PortalRenderer, this);
} }
public Vector3 TranslateOffset(Vector3 offset)
// Updates is called every frame
void Update()
{ {
m_CapturePoint.localPosition = offset; m_PlayerPoint.position = CameraController.Instance().transform.position;
return m_CapturePoint.position; }
public Vector3 TranslateOffsetToSpace(Vector3 pos, Vector3 euler)
{
m_Rot.localEulerAngles = euler;
m_Pos.localPosition = pos;
return m_Pos.position;
} }
} }

View File

@@ -283,7 +283,196 @@ PlayerSettings:
AndroidValidateAppBundleSize: 1 AndroidValidateAppBundleSize: 1
AndroidAppBundleSizeToValidate: 150 AndroidAppBundleSizeToValidate: 150
m_BuildTargetIcons: [] m_BuildTargetIcons: []
m_BuildTargetPlatformIcons: [] m_BuildTargetPlatformIcons:
- m_BuildTarget: iPhone
m_Icons:
- m_Textures: []
m_Width: 180
m_Height: 180
m_Kind: 0
m_SubKind: iPhone
- m_Textures: []
m_Width: 120
m_Height: 120
m_Kind: 0
m_SubKind: iPhone
- m_Textures: []
m_Width: 167
m_Height: 167
m_Kind: 0
m_SubKind: iPad
- m_Textures: []
m_Width: 152
m_Height: 152
m_Kind: 0
m_SubKind: iPad
- m_Textures: []
m_Width: 76
m_Height: 76
m_Kind: 0
m_SubKind: iPad
- m_Textures: []
m_Width: 120
m_Height: 120
m_Kind: 3
m_SubKind: iPhone
- m_Textures: []
m_Width: 80
m_Height: 80
m_Kind: 3
m_SubKind: iPhone
- m_Textures: []
m_Width: 80
m_Height: 80
m_Kind: 3
m_SubKind: iPad
- m_Textures: []
m_Width: 40
m_Height: 40
m_Kind: 3
m_SubKind: iPad
- m_Textures: []
m_Width: 87
m_Height: 87
m_Kind: 1
m_SubKind: iPhone
- m_Textures: []
m_Width: 58
m_Height: 58
m_Kind: 1
m_SubKind: iPhone
- m_Textures: []
m_Width: 29
m_Height: 29
m_Kind: 1
m_SubKind: iPhone
- m_Textures: []
m_Width: 58
m_Height: 58
m_Kind: 1
m_SubKind: iPad
- m_Textures: []
m_Width: 29
m_Height: 29
m_Kind: 1
m_SubKind: iPad
- m_Textures: []
m_Width: 60
m_Height: 60
m_Kind: 2
m_SubKind: iPhone
- m_Textures: []
m_Width: 40
m_Height: 40
m_Kind: 2
m_SubKind: iPhone
- m_Textures: []
m_Width: 40
m_Height: 40
m_Kind: 2
m_SubKind: iPad
- m_Textures: []
m_Width: 20
m_Height: 20
m_Kind: 2
m_SubKind: iPad
- m_Textures: []
m_Width: 1024
m_Height: 1024
m_Kind: 4
m_SubKind: App Store
- m_BuildTarget: Android
m_Icons:
- m_Textures: []
m_Width: 432
m_Height: 432
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 324
m_Height: 324
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 216
m_Height: 216
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 162
m_Height: 162
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 108
m_Height: 108
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 81
m_Height: 81
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 192
m_Height: 192
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 144
m_Height: 144
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 96
m_Height: 96
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 72
m_Height: 72
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 48
m_Height: 48
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 36
m_Height: 36
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 192
m_Height: 192
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 144
m_Height: 144
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 96
m_Height: 96
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 72
m_Height: 72
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 48
m_Height: 48
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 36
m_Height: 36
m_Kind: 0
m_SubKind:
m_BuildTargetBatching: m_BuildTargetBatching:
- m_BuildTarget: Standalone - m_BuildTarget: Standalone
m_StaticBatching: 1 m_StaticBatching: 1