XR interaction toolkit holsters, flying with physics

This commit is contained in:
joonasp 2022-03-10 17:25:29 +02:00
parent ab4fc2f635
commit f48d160bd3
7 changed files with 5677 additions and 514 deletions

View File

@ -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

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 16595acc1c95e1843870f6d5ed6b3ad8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -7,7 +7,9 @@ public class FlyWand : MonoBehaviour
private GameObject player;
private bool isFlying;
public ParticleSystem particles;
public float flySpeed = 10f;
public float testForce;
private void Awake()
{
@ -20,17 +22,21 @@ public class FlyWand : MonoBehaviour
{
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()
{
isFlying = true;
particles.Play();
}
public void DisableFly()
{
isFlying = false;
particles.Stop();
particles.Clear();
}
}

View File

@ -1,10 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Holster : MonoBehaviour
{
}

View File

@ -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