XR interaction toolkit holsters, flying with physics
This commit is contained in:
parent
ab4fc2f635
commit
f48d160bd3
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1b694a336b7a2ad4694aebbfcf58a48c
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 16595acc1c95e1843870f6d5ed6b3ad8
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -7,7 +7,9 @@ public class FlyWand : MonoBehaviour
|
||||||
private GameObject player;
|
private GameObject player;
|
||||||
private bool isFlying;
|
private bool isFlying;
|
||||||
|
|
||||||
|
public ParticleSystem particles;
|
||||||
public float flySpeed = 10f;
|
public float flySpeed = 10f;
|
||||||
|
public float testForce;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
|
@ -20,17 +22,21 @@ public class FlyWand : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (isFlying)
|
if (isFlying)
|
||||||
{
|
{
|
||||||
player.transform.position += transform.up * flySpeed * Time.deltaTime;
|
//player.transform.position += transform.up * flySpeed * Time.deltaTime;
|
||||||
|
player.GetComponent<Rigidbody>().AddForce(-transform.up * testForce * Time.deltaTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void EnableFly()
|
public void EnableFly()
|
||||||
{
|
{
|
||||||
isFlying = true;
|
isFlying = true;
|
||||||
|
particles.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DisableFly()
|
public void DisableFly()
|
||||||
{
|
{
|
||||||
isFlying = false;
|
isFlying = false;
|
||||||
|
particles.Stop();
|
||||||
|
particles.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class Holster : MonoBehaviour
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 6c2dedcaf08188c4b9c5204f37045ea6
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue