Commit f7835182 authored by 杨泽宇's avatar 杨泽宇

更新射箭小游戏

parent f4dc446a
...@@ -909,6 +909,307 @@ CanvasRenderer: ...@@ -909,6 +909,307 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 68603283} m_GameObject: {fileID: 68603283}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1001 &70674779
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 619892579208741393, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_Name
value: "\u7BAD (1)"
objectReference: {fileID: 0}
- target: {fileID: 619892579208741393, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_TagString
value: Arrow
objectReference: {fileID: 0}
- target: {fileID: 3246696904699261664, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalPosition.z
value: 0.55
objectReference: {fileID: 0}
- target: {fileID: 3246696904699261664, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.w
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3246696904699261664, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3246696904699261664, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3246696904699261664, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3246696904699261664, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_RootOrder
value: 12
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalPosition.x
value: 0.89
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalPosition.y
value: 1.312
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
--- !u!1 &70674780 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 619892579208741393, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
m_PrefabInstance: {fileID: 70674779}
m_PrefabAsset: {fileID: 0}
--- !u!4 &70674781 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
m_PrefabInstance: {fileID: 70674779}
m_PrefabAsset: {fileID: 0}
--- !u!114 &70674782
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 70674780}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a5c80d12c595e834eaf04fc07ee37b38, type: 3}
m_Name:
m_EditorClassIdentifier:
arrowPrefab: {fileID: 70674780}
arrowTrigger: {fileID: 509487382}
arrowBack: {fileID: 808179263}
arrowHeading: {x: 0, y: 0, z: 0}
waitingToShoot: 0
--- !u!114 &70674783
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 70674780}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ad34abafad169848a38072baa96cdb2, type: 3}
m_Name:
m_EditorClassIdentifier:
m_InteractionManager: {fileID: 2145635461}
m_Colliders: []
m_InteractionLayerMask:
serializedVersion: 2
m_Bits: 4294967295
m_InteractionLayers:
m_Bits: 1
m_DistanceCalculationMode: 1
m_SelectMode: 0
m_CustomReticle: {fileID: 0}
m_AllowGazeInteraction: 0
m_AllowGazeSelect: 0
m_OverrideGazeTimeToSelect: 0
m_GazeTimeToSelect: 0.5
m_OverrideTimeToAutoDeselectGaze: 0
m_TimeToAutoDeselectGaze: 3
m_AllowGazeAssistance: 0
m_FirstHoverEntered:
m_PersistentCalls:
m_Calls: []
m_LastHoverExited:
m_PersistentCalls:
m_Calls: []
m_HoverEntered:
m_PersistentCalls:
m_Calls: []
m_HoverExited:
m_PersistentCalls:
m_Calls: []
m_FirstSelectEntered:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 70674782}
m_TargetAssemblyTypeName: ArrowController, Assembly-CSharp
m_MethodName: GrabArrow
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_LastSelectExited:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 70674782}
m_TargetAssemblyTypeName: ArrowController, Assembly-CSharp
m_MethodName: ReleaseArrow
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_SelectEntered:
m_PersistentCalls:
m_Calls: []
m_SelectExited:
m_PersistentCalls:
m_Calls: []
m_Activated:
m_PersistentCalls:
m_Calls: []
m_Deactivated:
m_PersistentCalls:
m_Calls: []
m_StartingHoverFilters: []
m_StartingSelectFilters: []
m_StartingInteractionStrengthFilters: []
m_OnFirstHoverEntered:
m_PersistentCalls:
m_Calls: []
m_OnLastHoverExited:
m_PersistentCalls:
m_Calls: []
m_OnHoverEntered:
m_PersistentCalls:
m_Calls: []
m_OnHoverExited:
m_PersistentCalls:
m_Calls: []
m_OnSelectEntered:
m_PersistentCalls:
m_Calls: []
m_OnSelectExited:
m_PersistentCalls:
m_Calls: []
m_OnSelectCanceled:
m_PersistentCalls:
m_Calls: []
m_OnActivate:
m_PersistentCalls:
m_Calls: []
m_OnDeactivate:
m_PersistentCalls:
m_Calls: []
m_AttachTransform: {fileID: 792908729}
m_SecondaryAttachTransform: {fileID: 792908729}
m_UseDynamicAttach: 0
m_MatchAttachPosition: 1
m_MatchAttachRotation: 1
m_SnapToColliderVolume: 1
m_ReinitializeDynamicAttachEverySingleGrab: 1
m_AttachEaseInTime: 0.15
m_MovementType: 2
m_VelocityDamping: 1
m_VelocityScale: 1
m_AngularVelocityDamping: 1
m_AngularVelocityScale: 1
m_TrackPosition: 1
m_SmoothPosition: 0
m_SmoothPositionAmount: 5
m_TightenPosition: 0.5
m_TrackRotation: 1
m_SmoothRotation: 0
m_SmoothRotationAmount: 5
m_TightenRotation: 0.5
m_ThrowOnDetach: 1
m_ThrowSmoothingDuration: 0.25
m_ThrowSmoothingCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_ThrowVelocityScale: 1.5
m_ThrowAngularVelocityScale: 1
m_ForceGravityOnDetach: 0
m_RetainTransformParent: 1
m_AttachPointCompatibilityMode: 0
m_StartingSingleGrabTransformers: []
m_StartingMultipleGrabTransformers: []
m_AddDefaultGrabTransformers: 1
--- !u!136 &70674784
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 70674780}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.06
m_Height: 0.76
m_Direction: 2
m_Center: {x: 0, y: 0, z: 0.12}
--- !u!54 &70674785
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 70674780}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 126
m_CollisionDetection: 2
--- !u!1 &72353806 --- !u!1 &72353806
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -4954,7 +5255,7 @@ PrefabInstance: ...@@ -4954,7 +5255,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7503499472696683429, guid: cb79a93b562dcd1469eb5b5aa463b6f9, type: 3} - target: {fileID: 7503499472696683429, guid: cb79a93b562dcd1469eb5b5aa463b6f9, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 12 value: 13
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 7503499472696683429, guid: cb79a93b562dcd1469eb5b5aa463b6f9, type: 3} - target: {fileID: 7503499472696683429, guid: cb79a93b562dcd1469eb5b5aa463b6f9, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
...@@ -5989,6 +6290,37 @@ RectTransform: ...@@ -5989,6 +6290,37 @@ RectTransform:
m_AnchoredPosition: {x: -463, y: 287} m_AnchoredPosition: {x: -463, y: 287}
m_SizeDelta: {x: 235.3, y: 50} m_SizeDelta: {x: 235.3, y: 50}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &792908728
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 792908729}
m_Layer: 0
m_Name: Attach
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &792908729
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 792908728}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.351}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 70674781}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &801263421 --- !u!1 &801263421
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -6101,9 +6433,6 @@ MonoBehaviour: ...@@ -6101,9 +6433,6 @@ MonoBehaviour:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_LastSelectExited: m_LastSelectExited:
m_PersistentCalls:
m_Calls: []
m_SelectEntered:
m_PersistentCalls: m_PersistentCalls:
m_Calls: m_Calls:
- m_Target: {fileID: 675323634} - m_Target: {fileID: 675323634}
...@@ -6118,6 +6447,9 @@ MonoBehaviour: ...@@ -6118,6 +6447,9 @@ MonoBehaviour:
m_StringArgument: m_StringArgument:
m_BoolArgument: 0 m_BoolArgument: 0
m_CallState: 2 m_CallState: 2
m_SelectEntered:
m_PersistentCalls:
m_Calls: []
m_SelectExited: m_SelectExited:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
...@@ -14781,7 +15113,7 @@ Transform: ...@@ -14781,7 +15113,7 @@ Transform:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1716900057} m_GameObject: {fileID: 1716900057}
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: 0} 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
...@@ -17551,63 +17883,6 @@ Transform: ...@@ -17551,63 +17883,6 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 11 m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!1001 &2014147294
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 619892579208741393, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_Name
value: "\u7BAD"
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_RootOrder
value: 13
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalPosition.y
value: 0.952
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalPosition.z
value: 1.152
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4452497413181212913, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f0be1cf98bccf194d81d6f33e8b157fd, type: 3}
--- !u!1 &2038476288 --- !u!1 &2038476288
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -8,7 +8,7 @@ public class ArrowController : MonoBehaviour ...@@ -8,7 +8,7 @@ public class ArrowController : MonoBehaviour
// Start is called before the first frame update // Start is called before the first frame update
public GameObject arrowPrefab; public GameObject arrowPrefab;
public GameObject arrowPlace; //public GameObject arrowPlace;
public GameObject arrowTrigger; public GameObject arrowTrigger;
public GameObject arrowBack; public GameObject arrowBack;
public Vector3 arrowHeading; public Vector3 arrowHeading;
...@@ -16,9 +16,7 @@ public class ArrowController : MonoBehaviour ...@@ -16,9 +16,7 @@ public class ArrowController : MonoBehaviour
public bool waitingToShoot = false; public bool waitingToShoot = false;
void Start() void Start()
{ {
arrowPlace = GameObject.Find("XR Interaction Setup/XR Origin (XR Rig)/Camera Offset/Main Camera/ArrowPlace"); //arrowPlace = GameObject.Find("XR Interaction Setup/XR Origin (XR Rig)/Camera Offset/Main Camera/ArrowPlace");
arrowTrigger = GameObject.Find("Bow/ArrowTrigger");
arrowBack = GameObject.Find("Bow/String/Notch");
} }
// Update is called once per frame // Update is called once per frame
...@@ -35,9 +33,8 @@ public class ArrowController : MonoBehaviour ...@@ -35,9 +33,8 @@ public class ArrowController : MonoBehaviour
public void GrabArrow() public void GrabArrow()
{ {
//GameObject arrow = Instantiate(arrowPrefab, arrowPlace.transform.position, arrowPlace.transform.rotation);
GameObject arrow = Instantiate(arrowPrefab, arrowPlace.transform.position, arrowPlace.transform.rotation); //arrow.transform.parent = GameObject.Find("XR Interaction Setup/XR Origin (XR Rig)/Camera Offset/Main Camera").transform;
arrow.transform.parent = GameObject.Find("XR Interaction Setup/XR Origin (XR Rig)/Camera Offset/Main Camera").transform;
} }
public void ReleaseArrow() public void ReleaseArrow()
......
...@@ -28,7 +28,7 @@ public class BowController : MonoBehaviour ...@@ -28,7 +28,7 @@ public class BowController : MonoBehaviour
public void ReleaseString() public void ReleaseString()
{ {
Debug.Log("ReleaseString"); //Debug.Log("ReleaseString");
stringMiddlePoint.transform.position = (stringStartPoint.transform.position + stringEndPoint.transform.position + new Vector3(0, 0.07f, 0)) / 2; stringMiddlePoint.transform.position = (stringStartPoint.transform.position + stringEndPoint.transform.position + new Vector3(0, 0.07f, 0)) / 2;
stringMiddlePoint.GetComponent<Rigidbody>().velocity = new Vector3(0, 0, 0); stringMiddlePoint.GetComponent<Rigidbody>().velocity = new Vector3(0, 0, 0);
stringMiddlePoint.GetComponent<Rigidbody>().angularVelocity = new Vector3(0, 0, 0); stringMiddlePoint.GetComponent<Rigidbody>().angularVelocity = new Vector3(0, 0, 0);
......
...@@ -36,6 +36,7 @@ public class PullMeasurer : XRBaseInteractable ...@@ -36,6 +36,7 @@ public class PullMeasurer : XRBaseInteractable
// 计算新的拉伸程度,并返回它在空间中的位置 // 计算新的拉伸程度,并返回它在空间中的位置
PullAmount = CalculatePull(interactorPosition); PullAmount = CalculatePull(interactorPosition);
} }
private float CalculatePull(Vector3 pullPosition) private float CalculatePull(Vector3 pullPosition)
......
...@@ -9,6 +9,8 @@ TagManager: ...@@ -9,6 +9,8 @@ TagManager:
- Destroyer - Destroyer
- MiniWorldCamera - MiniWorldCamera
- Water - Water
- Arrow
- ArrowTip
layers: layers:
- Default - Default
- TransparentFX - TransparentFX
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment