mirror of
https://projects.caleb-brown.dev/UDRI-XRT/UDRIGEEKCup2024.git
synced 2025-01-22 07:08:51 -05:00
Auto stash before merge of "AR-Controls" and "origin/development"
This commit is contained in:
parent
a6c2ed783a
commit
01ed438924
30
Assets/GolfControls/BallPhysics.cs
Normal file
30
Assets/GolfControls/BallPhysics.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using UnityAtoms.BaseAtoms;
|
||||
using UnityEngine;
|
||||
|
||||
namespace GolfControls
|
||||
{
|
||||
public class BallPhysics : MonoBehaviour
|
||||
{
|
||||
private float baseDrag;
|
||||
private float baseAngularDrag;
|
||||
|
||||
private Rigidbody body;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
body = gameObject.GetComponent<Rigidbody>();
|
||||
baseDrag = body.drag;
|
||||
baseAngularDrag = body.angularDrag;
|
||||
}
|
||||
|
||||
private void OnCollisionEnter(Collision other)
|
||||
{
|
||||
PhysicsTerrain terrain = other.gameObject.GetComponent<PhysicsTerrain>();
|
||||
if (terrain == null) return;
|
||||
body.drag = baseDrag + terrain.drag;
|
||||
body.angularDrag = baseAngularDrag + terrain.angularDrag;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/GolfControls/BallPhysics.cs.meta
Normal file
11
Assets/GolfControls/BallPhysics.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 472c31289d980c5498f312ff638077fe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
10
Assets/GolfControls/PhysicsTerrain.cs
Normal file
10
Assets/GolfControls/PhysicsTerrain.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace GolfControls
|
||||
{
|
||||
public class PhysicsTerrain : MonoBehaviour
|
||||
{
|
||||
public float drag;
|
||||
public float angularDrag;
|
||||
}
|
||||
}
|
11
Assets/GolfControls/PhysicsTerrain.cs.meta
Normal file
11
Assets/GolfControls/PhysicsTerrain.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e3bff1da8d1f8f4d9e469f0274c2aff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -960,6 +960,7 @@ GameObject:
|
||||
- component: {fileID: 371693855}
|
||||
- component: {fileID: 371693854}
|
||||
- component: {fileID: 371693853}
|
||||
- component: {fileID: 371693857}
|
||||
m_Layer: 0
|
||||
m_Name: GreensCube
|
||||
m_TagString: Untagged
|
||||
@ -1053,6 +1054,20 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1895921797}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &371693857
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 371693851}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6e3bff1da8d1f8f4d9e469f0274c2aff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
drag: 0.1
|
||||
angularDrag: 0.1
|
||||
--- !u!1 &434066455
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2031,6 +2046,7 @@ GameObject:
|
||||
- component: {fileID: 1507380961}
|
||||
- component: {fileID: 1507380960}
|
||||
- component: {fileID: 1507380959}
|
||||
- component: {fileID: 1507380963}
|
||||
m_Layer: 0
|
||||
m_Name: FairwayCube
|
||||
m_TagString: Untagged
|
||||
@ -2241,6 +2257,7 @@ GameObject:
|
||||
- component: {fileID: 1752515855}
|
||||
- component: {fileID: 1752515854}
|
||||
- component: {fileID: 1752515853}
|
||||
- component: {fileID: 1752515857}
|
||||
m_Layer: 0
|
||||
m_Name: RoughCube
|
||||
m_TagString: Untagged
|
||||
@ -2334,6 +2351,20 @@ Transform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1895921797}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1752515857
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1752515851}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6e3bff1da8d1f8f4d9e469f0274c2aff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
drag: 0.2
|
||||
angularDrag: 5
|
||||
--- !u!1 &1780702392
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -2572,7 +2603,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1807783553}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c2fadf230d1919748a9aa21d40f74619, type: 3}
|
||||
m_Name:
|
||||
@ -2782,7 +2813,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!114 &1867824958
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -4326,6 +4357,7 @@ GameObject:
|
||||
- component: {fileID: 3921340267877587735}
|
||||
- component: {fileID: 8741305066849015581}
|
||||
- component: {fileID: 8741305066849015582}
|
||||
- component: {fileID: 8741305066849015583}
|
||||
m_Layer: 0
|
||||
m_Name: TestGolfBall
|
||||
m_TagString: Untagged
|
||||
@ -4564,6 +4596,18 @@ MonoBehaviour:
|
||||
isMovingVariable: {fileID: 11400000, guid: 838a13f5fd312c94398e49cfc36e34ad, type: 2}
|
||||
inHoleVariable: {fileID: 11400000, guid: 3b0e06d0a76bceb4296c54d02f0d34a4, type: 2}
|
||||
baseForce: 200
|
||||
--- !u!114 &8741305066849015583
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7237674694152796921}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 472c31289d980c5498f312ff638077fe, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!224 &8967829807584265088
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
Loading…
Reference in New Issue
Block a user