changed rot speed

This commit is contained in:
Mausham
2025-12-15 18:23:07 -08:00
parent f4c55dec05
commit 5a95751da2
4 changed files with 38 additions and 21 deletions

View File

@@ -10807,7 +10807,7 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_RaycastPadding: {x: -250, y: 0, z: -250, w: -800}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
@@ -11223,7 +11223,7 @@ Transform:
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -0.7}
m_LocalScale: {x: 0.15, y: 0.15, z: 0.15}
m_LocalScale: {x: 0.12, y: 0.12, z: 0.12}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 185655300}
@@ -13369,7 +13369,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &1613812280
RectTransform:
m_ObjectHideFlags: 0
@@ -13728,7 +13728,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 393df497de02fce4399040e619446397, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::PlatformManager
rotSpeed: 5
rotSpeed: 8
--- !u!1 &1942266448
GameObject:
m_ObjectHideFlags: 0

View File

@@ -8,6 +8,7 @@ public class PlatformManager : MonoBehaviour,IPlatformManager
private float yPos = 0f;
public float rotSpeed = 5f;
private float rotAmount;
private void Start()
{
@@ -23,7 +24,10 @@ public class PlatformManager : MonoBehaviour,IPlatformManager
{
inputReader.OnDragValueChanged -= HandleDrag;
}
private void LateUpdate()
{
transform.Rotate(Vector3.up * rotAmount);
}
void ShowPlatforms()
{
foreach (var platform in pool.All)
@@ -43,16 +47,17 @@ public class PlatformManager : MonoBehaviour,IPlatformManager
private void HandleDrag(Vector2 drag)
{
float rotAmount = -drag.normalized.x * rotSpeed;
rotAmount = -drag.normalized.x * rotSpeed;
#if UNITY_EDITOR || UNITY_STANDALONE
if (!inputReader.isMouseButtonPressed) return;
transform.Rotate(Vector3.up * rotAmount);
//#if UNITY_EDITOR || UNITY_STANDALONE
// if (!inputReader.isMouseButtonPressed) return;
// transform.Rotate(Vector3.up * rotAmount);
#elif UNITY_IOS || UNITY_ANDROID
transform.Rotate(Vector3.up * rotAmount);
//#elif UNITY_IOS || UNITY_ANDROID
// transform.Rotate(Vector3.up * rotAmount * DPI);
#endif
//#endif
//transform.Rotate(Vector3.up * rotAmount);
}
}