diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/Walls/XCameraWall.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/Walls/XCameraWall.cs')
-rw-r--r-- | Client/Assets/Scripts/Walls/XCameraWall.cs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/Walls/XCameraWall.cs b/Client/Assets/Scripts/Walls/XCameraWall.cs new file mode 100644 index 00000000..75485b68 --- /dev/null +++ b/Client/Assets/Scripts/Walls/XCameraWall.cs @@ -0,0 +1,50 @@ +using UnityEngine;
+using XUtliPoolLib;
+
+[ExecuteInEditMode]
+public class XCameraWall : XWall
+{
+ public XCameraWall Associated = null;
+ public XCurve Curve = null;
+
+ public bool BeginWith = false;
+ public float Angle = 0;
+ public bool VerticalOnly = false;
+ public float VerticalShiftAngle = 0;
+
+ protected override void OnTriggered()
+ {
+ float sector = Vector3.Angle(transform.forward, Associated.transform.forward);
+ Vector3 rotate = transform.rotation.eulerAngles; rotate.y = 0;
+ Vector3 dir = Quaternion.AngleAxis(rotate.z, transform.forward) * XCommon.singleton.HorizontalRotateVetor3(transform.forward, 90, true);
+
+ if (_forward_collision)
+ {
+ if (!VerticalOnly)
+ {
+ if (BeginWith)
+ {
+ _interface.CameraWallEnter(Curve.Curve, transform.parent.transform.position, dir, sector, Angle, Associated.Angle, BeginWith);
+ }
+ else
+ _interface.CameraWallExit(Angle);
+ }
+
+ _interface.CameraWallVertical(VerticalShiftAngle);
+ }
+ else
+ {
+ if (!VerticalOnly)
+ {
+ if (BeginWith)
+ _interface.CameraWallExit(Angle);
+ else
+ {
+ _interface.CameraWallEnter(Curve.Curve, transform.parent.transform.position, dir, sector, Angle, Associated.Angle, BeginWith);
+ }
+ }
+
+ _interface.CameraWallVertical(-VerticalShiftAngle);
+ }
+ }
+}
|