Reduced nausea
This commit is contained in:
@@ -153,7 +153,13 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 2895addc317815345b19503bab859a6a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EnemyPrefab: {fileID: 345795220292517504, guid: ec4a924a38b208240b281bd7983b07b7, type: 3}
|
||||
m_OrbitalPosition:
|
||||
m_AttachedRing: 0
|
||||
m_DistanceFromCentre: 0
|
||||
m_DistanceAlongRadius: 0
|
||||
m_ObjectRadius: 0
|
||||
m_Behaviour: {fileID: 0}
|
||||
m_SpinSpeed: 0
|
||||
--- !u!4 &104400498
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -306,7 +312,7 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
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, y: 0, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
@@ -423,6 +429,7 @@ MonoBehaviour:
|
||||
m_DistanceSpeed: 0.6
|
||||
m_GapDistance: 1
|
||||
m_RingPrefab: {fileID: 8276642441649562681, guid: 2b69b065f2beade4d91167a23508e29e, type: 3}
|
||||
m_EnemyPrefab: {fileID: 345795220292517504, guid: ec4a924a38b208240b281bd7983b07b7, type: 3}
|
||||
--- !u!4 &1827131557
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -443,5 +450,5 @@ SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 1827131557}
|
||||
- {fileID: 519420032}
|
||||
- {fileID: 104400498}
|
||||
- {fileID: 519420032}
|
||||
|
||||
@@ -32,19 +32,19 @@ MonoBehaviour:
|
||||
value: 1
|
||||
intensity:
|
||||
overrideState: 1
|
||||
value: 6
|
||||
value: 15
|
||||
threshold:
|
||||
overrideState: 1
|
||||
value: 0.4
|
||||
softKnee:
|
||||
overrideState: 1
|
||||
value: 0.067
|
||||
value: 0.5
|
||||
clamp:
|
||||
overrideState: 1
|
||||
value: 1
|
||||
diffusion:
|
||||
overrideState: 1
|
||||
value: 5
|
||||
value: 3
|
||||
anamorphicRatio:
|
||||
overrideState: 1
|
||||
value: 0
|
||||
|
||||
@@ -5,7 +5,10 @@ public class EnemyController : OrbitalPositionBehaviour
|
||||
protected override void OnStart()
|
||||
{
|
||||
transform.position = new Vector3(0, 0, -200f);
|
||||
m_OrbitalPosition.m_RadiusDistance = 0.2f;
|
||||
|
||||
m_OrbitalPosition.m_DistanceAlongRadius = Random.Range(0f, Mathf.PI * 2f);
|
||||
m_OrbitalPosition.m_ObjectRadius = 0.2f;
|
||||
m_OrbitalPosition.m_SpinSpeed = 0.7f;
|
||||
}
|
||||
|
||||
public override void OnReachCentre()
|
||||
|
||||
@@ -16,5 +16,8 @@ public class GlobalOrbitalSettings : MonoBehaviour
|
||||
[SerializeField] GameObject m_RingPrefab;
|
||||
public static GameObject RingPrefab => Instance.m_RingPrefab;
|
||||
|
||||
[SerializeField] GameObject m_EnemyPrefab;
|
||||
public static GameObject EnemyPrefab => Instance.m_EnemyPrefab;
|
||||
|
||||
void Start() => Instance = this;
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class OrbitalPosition
|
||||
[System.Serializable] public class OrbitalPosition
|
||||
{
|
||||
public int m_AttachedRing;
|
||||
public float m_DistanceFromCentre;
|
||||
public float m_RadiusDistance;
|
||||
public float m_DistanceAlongRadius;
|
||||
public float m_ObjectRadius = 0.1f;
|
||||
|
||||
public OrbitalPositionBehaviour m_Behaviour;
|
||||
public readonly Transform m_Owner;
|
||||
|
||||
public int m_SpinSpeed = 1;
|
||||
public float m_SpinSpeed = 1f;
|
||||
|
||||
public OrbitalPosition(GameObject owner)
|
||||
{
|
||||
@@ -21,8 +21,8 @@ public class OrbitalPosition
|
||||
|
||||
public Vector3 TranslateToVec3() => new
|
||||
(
|
||||
x: m_DistanceFromCentre * Mathf.Cos(m_RadiusDistance),
|
||||
y: m_DistanceFromCentre * Mathf.Sin(m_RadiusDistance)
|
||||
x: m_DistanceFromCentre * Mathf.Cos(m_DistanceAlongRadius),
|
||||
y: m_DistanceFromCentre * Mathf.Sin(m_DistanceAlongRadius)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
|
||||
float distance = m_Distances[orbitalPosition.m_AttachedRing];
|
||||
orbitalPosition.m_DistanceFromCentre = distance;
|
||||
orbitalPosition.m_RadiusDistance = (orbitalPosition.m_RadiusDistance + Time.deltaTime * GlobalOrbitalSettings.RadiusSpeed) % (Mathf.PI * 2);
|
||||
orbitalPosition.m_DistanceAlongRadius = (orbitalPosition.m_DistanceAlongRadius + Time.deltaTime * GlobalOrbitalSettings.RadiusSpeed * orbitalPosition.m_SpinSpeed) % (Mathf.PI * 2);
|
||||
|
||||
orbitalPosition.m_Owner.position = orbitalPosition.TranslateToVec3();
|
||||
}
|
||||
@@ -155,6 +155,9 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
m_PlayerOrbitalPosition.m_Behaviour.OnCollision(orbital.m_Behaviour);
|
||||
}
|
||||
}
|
||||
|
||||
if (Random.Range(0, 20) == 0)
|
||||
Instantiate(GlobalOrbitalSettings.EnemyPrefab);
|
||||
}
|
||||
|
||||
public static void RegisterOrbitalPositionInstance(OrbitalPosition newInstance) =>
|
||||
@@ -166,7 +169,7 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
|
||||
public abstract class OrbitalPositionBehaviour : MonoBehaviour
|
||||
{
|
||||
protected OrbitalPosition m_OrbitalPosition;
|
||||
[SerializeField] protected OrbitalPosition m_OrbitalPosition;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
@@ -2,12 +2,12 @@ using UnityEngine;
|
||||
|
||||
public class PlayerController : OrbitalPositionBehaviour
|
||||
{
|
||||
public GameObject m_EnemyPrefab;
|
||||
|
||||
protected override void OnStart()
|
||||
{
|
||||
GlobalOrbitalPositionManager.SetPlayer(m_OrbitalPosition);
|
||||
m_OrbitalPosition.m_RadiusDistance = 0.4f;
|
||||
|
||||
m_OrbitalPosition.m_ObjectRadius = 0.4f;
|
||||
m_OrbitalPosition.m_SpinSpeed = 0.05f;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
@@ -16,11 +16,6 @@ public class PlayerController : OrbitalPositionBehaviour
|
||||
{
|
||||
m_OrbitalPosition.m_AttachedRing += 1;
|
||||
}
|
||||
|
||||
if (Input.GetKey(KeyCode.E))
|
||||
{
|
||||
Instantiate(m_EnemyPrefab);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCollision(OrbitalPositionBehaviour other)
|
||||
|
||||
Reference in New Issue
Block a user