oompa loompa3

1 merge request!5Merge from develop into master
Showing with 247 additions and 26 deletions
+247 -26
......@@ -17,6 +17,7 @@ GameObject:
- component: {fileID: 8465204698793991341}
- component: {fileID: 6388392211831621975}
- component: {fileID: 8842308692343450372}
- component: {fileID: -7233594277474418132}
m_Layer: 0
m_Name: Military target
m_TagString: Untagged
......@@ -215,3 +216,100 @@ CapsuleCollider:
m_Height: 0.04350917
m_Direction: 0
m_Center: {x: 0, y: 0.0010344908, z: -0.050325178}
--- !u!82 &-7233594277474418132
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1501084758933746}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: ff4fdc7ab5a5c42499bb7bc35fee3d95, type: 3}
m_Resource: {fileID: 8300000, guid: ff4fdc7ab5a5c42499bb7bc35fee3d95, type: 3}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
......@@ -101,6 +101,7 @@ GameObject:
- component: {fileID: 5222480561851549995}
- component: {fileID: 8107286817448585809}
- component: {fileID: 2476642138429827811}
- component: {fileID: 243895279731729523}
m_Layer: 0
m_Name: SciFiHandGun
m_TagString: Untagged
......@@ -259,10 +260,8 @@ MonoBehaviour:
bulletPref: {fileID: 3331702494713981315, guid: 36b5fc592ca54ef4eb66fff8acabd33b,
type: 3}
spawnPoint: {fileID: 4681773637070317307}
targetTransform1: {fileID: 0}
targetTransform2: {fileID: 0}
targetTransform3: {fileID: 0}
fireSpeed: 5
fireSpeed: 15
cooldown: 0.33
--- !u!114 &8107286817448585809
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -369,6 +368,103 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
interactable: {fileID: 0}
--- !u!82 &243895279731729523
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 315305389486338692}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: c9de1306d5ae8734c9390f15ed8de576, type: 3}
m_Resource: {fileID: 8300000, guid: c9de1306d5ae8734c9390f15ed8de576, type: 3}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1 &315330575868828356
GameObject:
m_ObjectHideFlags: 0
......
......@@ -14,10 +14,9 @@ public class GunController : MonoBehaviour
public GameObject bulletPref;
public Transform spawnPoint;
public Transform targetTransform1;
public Transform targetTransform2;
public Transform targetTransform3;
public float fireSpeed = 20f;
public float cooldown = 1f;
private bool govno = true;
private new Rigidbody rigidbody;
private SteamVR_Action_Boolean fire = SteamVR_Input.GetAction<SteamVR_Action_Boolean>("InteractUI");
......@@ -36,27 +35,23 @@ private void FireBullet()
Rigidbody bulletRigidbody = spawnedBullet.GetComponent<Rigidbody>();
bulletRigidbody.velocity = spawnPoint.forward * fireSpeed;
Destroy(spawnedBullet, 5f);
/*
RaycastHit hitInfo;
bool hitTarget = Physics.Raycast(spawnPoint.position, spawnPoint.forward, out hitInfo);
if (hitTarget && hitInfo.collider.gameObject == targetTransform1.gameObject || hitInfo.collider.gameObject == targetTransform2.gameObject || hitInfo.collider.gameObject == targetTransform3.gameObject)
{
Debug.Log("Hit!");
// Add visual or audio feedback for successful hit
}
else
{
Debug.Log("Miss!");
// Add visual or audio feedback for missed shot
}*/
gameObject.GetComponent<AudioSource>().Play();
}
public void Update()
{
if (interactable.attachedToHand && fire.GetStateDown(SteamVR_Input_Sources.Any))
if (interactable.attachedToHand && fire.GetStateDown(SteamVR_Input_Sources.Any) && govno)
{
FireBullet();
StartCoroutine(InteractCooldown());
}
}
IEnumerator InteractCooldown()
{
govno = false;
yield return new WaitForSeconds(cooldown);
govno = true;
}
}
\ No newline at end of file
......@@ -38,6 +38,7 @@ void Update()
void OnTriggerEnter(Collider other)
{
gameController.GetComponent<PiuPau>().score++;
gameObject.GetComponent<AudioSource>().Play();
Destroy(other.gameObject);
}
}
File added
fileFormatVersion: 2
guid: ff4fdc7ab5a5c42499bb7bc35fee3d95
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
......@@ -5183,7 +5183,7 @@ PrefabInstance:
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
propertyPath: speed
value: 0
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
......@@ -23236,7 +23236,7 @@ PrefabInstance:
- target: {fileID: 8745766183664996578, guid: 66ac0b1e95ffa0343bba1da256f83d8a,
type: 3}
propertyPath: m_LocalPosition.x
value: 209.344
value: 218.187
objectReference: {fileID: 0}
- target: {fileID: 8745766183664996578, guid: 66ac0b1e95ffa0343bba1da256f83d8a,
type: 3}
......@@ -23246,7 +23246,7 @@ PrefabInstance:
- target: {fileID: 8745766183664996578, guid: 66ac0b1e95ffa0343bba1da256f83d8a,
type: 3}
propertyPath: m_LocalPosition.z
value: 41.244
value: 45.112
objectReference: {fileID: 0}
- target: {fileID: 8745766183664996578, guid: 66ac0b1e95ffa0343bba1da256f83d8a,
type: 3}
......@@ -44644,7 +44644,7 @@ PrefabInstance:
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
propertyPath: speed
value: 0
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
......@@ -56271,7 +56271,7 @@ PrefabInstance:
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
propertyPath: speed
value: 0
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3209501944184153647, guid: 9437be881ad682348bd31aa228922027,
type: 3}
......@@ -3,6 +3,11 @@
// Purpose: Player interface used to query HMD transforms and VR hands
//
//=============================================================================
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Player interface used to query HMD transforms and VR hands
//
//=============================================================================
using UnityEngine;
using System.Collections;
......
Supports Markdown
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