Grabbing object and initial flying locomotion
This commit is contained in:
parent
813cd0c451
commit
dc0cc4cd32
|
@ -1,8 +1,8 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 7c884420a5dfbaa4db9afe42d366b843
|
guid: 60ce99a0af04f934190ce18ee4f567b6
|
||||||
timeCreated: 1575711200
|
folderAsset: yes
|
||||||
licenseType: Store
|
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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
Loading…
Reference in New Issue