Grabbing object and initial flying locomotion

This commit is contained in:
joonasp 2022-03-09 21:37:11 +02:00
parent 813cd0c451
commit dc0cc4cd32
4 changed files with 779 additions and 635 deletions

View File

@ -1,8 +1,8 @@
fileFormatVersion: 2
guid: 7c884420a5dfbaa4db9afe42d366b843
timeCreated: 1575711200
licenseType: Store
guid: 60ce99a0af04f934190ce18ee4f567b6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,34 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FlyWand : MonoBehaviour
{
private GameObject player;
private bool isFlying;
private void Awake()
{
player = GameObject.FindGameObjectWithTag("Player");
isFlying = false;
}
private void Update()
{
if (isFlying)
{
player.transform.position += transform.up * 0.5f;
}
}
public void EnableFly()
{
isFlying = true;
}
public void DisableFly()
{
isFlying = false;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ee8103568a01d804d89cb1fc1dff91eb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff