Added Dohya
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a48864b1aa616c246988c7434e7eecf9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f594e396b140b5408642e9fe8b6e3e1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1d8ffbb70dc716646abe11dba492a567
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Audio/Music/synthtrack.wav
|
||||
uploadId: 373385
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2de937b859f59354db74282032b23fa9
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Audio/Music/upbeatfuture.wav
|
||||
uploadId: 373385
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55a23cd45502337439bd4cc90ad31684
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bea37e2f1d9209440aac9a3d03a16787
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Audio/SFX/Fan_St.wav
|
||||
uploadId: 373385
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e11a3f731847f0448845ec6c60b679ba
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Audio/SFX/background_rumble.wav
|
||||
uploadId: 373385
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec5ec348a6635df45b23a70c45d3ae7a
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Audio/SFX/enginestart.wav
|
||||
uploadId: 373385
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 263f8aaa01d5d0041b082b7b69d9ca02
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Audio/SFX/footstep.wav
|
||||
uploadId: 373385
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10dbe0d3efc047c49ade2a16910ba3d5
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Audio/SFX/pressure_release_01.wav
|
||||
uploadId: 373385
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6429ef6fc932abf48bd557105f587cfb
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Audio/SFX/pressure_release_02.wav
|
||||
uploadId: 373385
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eecbbe738858027488ed9a7a0c2a5df1
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Audio/SFX/siren.wav
|
||||
uploadId: 373385
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fae646e294e83b8429734823243ff0c9
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Audio/SFX/wompwomp.wav
|
||||
uploadId: 373385
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a072680649fea4544960d94cd5550b10
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd66ea861ab218e418eba62af64e64db
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0be4b2b0e43ef14fa086ef8d382537c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 112000000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Scene/Lighting Data/LightingData.asset
|
||||
uploadId: 373385
|
||||
Binary file not shown.
@@ -0,0 +1,96 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b9327fe293c1f824d945fde7b14c2095
|
||||
TextureImporter:
|
||||
fileIDToRecycleName:
|
||||
8900000: generatedCubemap
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 1
|
||||
seamlessCubemap: 1
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 2
|
||||
aniso: 0
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 2
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 100
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Scene/Lighting Data/ReflectionProbe-0.exr
|
||||
uploadId: 373385
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04ba57353b4f0284686265d3d150c23c
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Scene/SciFi_Warehouse.unity
|
||||
uploadId: 373385
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ee6cbbfcba665948b316fb4578612ba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class LightFlicker : MonoBehaviour
|
||||
{
|
||||
public float maximumDim;
|
||||
public float maximumBoost;
|
||||
public float speed;
|
||||
public float strength;
|
||||
|
||||
private bool noFlicker;
|
||||
private Light source;
|
||||
private float initialIntensity;
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
maximumDim = 0.2f;
|
||||
maximumBoost = 0.2f;
|
||||
speed = 0.1f;
|
||||
strength = 250;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
source = GetComponent<Light>();
|
||||
initialIntensity = source.intensity;
|
||||
StartCoroutine(Flicker());
|
||||
}
|
||||
|
||||
|
||||
private IEnumerator Flicker()
|
||||
{
|
||||
while (!noFlicker)
|
||||
{
|
||||
source.intensity = Mathf.Lerp(source.intensity, Random.Range(initialIntensity - maximumDim, initialIntensity + maximumBoost), strength * Time.deltaTime);
|
||||
yield return new WaitForSeconds(speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1560e0c42f6e77d429c1440b33c57ccc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Scripts/LightFlicker.cs
|
||||
uploadId: 373385
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MouseComponent : MonoBehaviour
|
||||
{
|
||||
public float mouseSensitivity = 100f;
|
||||
public Transform playerBody;
|
||||
float xRotation = 0f;
|
||||
|
||||
void Start()
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime;
|
||||
float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;
|
||||
xRotation -= mouseY;
|
||||
xRotation = Mathf.Clamp(xRotation, -90, 90f);
|
||||
transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);
|
||||
playerBody.Rotate(Vector3.up * mouseX);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bd920a6d4c8a664f87d50801bfee470
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Scripts/MouseComponent.cs
|
||||
uploadId: 373385
|
||||
@@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class PlayRandomSound : MonoBehaviour {
|
||||
|
||||
public AudioSource randomSound;
|
||||
public AudioClip[] audioSources;
|
||||
|
||||
public int clipDelay = 5;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
StartAudio ();
|
||||
}
|
||||
|
||||
|
||||
void StartAudio()
|
||||
{
|
||||
Invoke ("RandomSoundness", clipDelay);
|
||||
}
|
||||
|
||||
void RandomSoundness()
|
||||
{
|
||||
randomSound.clip = audioSources[Random.Range(0, audioSources.Length)];
|
||||
randomSound.Play ();
|
||||
StartAudio ();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa804e3faf03f6e4c8bcc4681f3077fc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Scripts/PlayRandomSound.cs
|
||||
uploadId: 373385
|
||||
@@ -0,0 +1,60 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerMovement : MonoBehaviour
|
||||
{
|
||||
|
||||
public CharacterController controller;
|
||||
public float speed = 8f;
|
||||
public float gravity = -9.81f;
|
||||
public float jumpHeight = 3f;
|
||||
public Transform groundCheck;
|
||||
public float groundDistance = 0.4f;
|
||||
public LayerMask groundMask;
|
||||
Vector3 velocity;
|
||||
bool isGrounded;
|
||||
|
||||
|
||||
public AudioClip footStepSound;
|
||||
public float footStepDelay;
|
||||
|
||||
private float nextFootstep = 0;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask);
|
||||
|
||||
if (isGrounded && velocity.y <0)
|
||||
{
|
||||
velocity.y = -2f;
|
||||
}
|
||||
|
||||
float x = Input.GetAxis("Horizontal");
|
||||
float z = Input.GetAxis("Vertical");
|
||||
|
||||
Vector3 motion = transform.right * x + transform.forward * z;
|
||||
controller.Move(motion * speed * Time.deltaTime);
|
||||
|
||||
if(Input.GetButtonDown("Jump") && isGrounded)
|
||||
{
|
||||
velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity);
|
||||
}
|
||||
|
||||
velocity.y += gravity * Time.deltaTime;
|
||||
controller.Move(velocity * Time.deltaTime);
|
||||
|
||||
if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.W) && isGrounded)
|
||||
{
|
||||
nextFootstep -= Time.deltaTime;
|
||||
if (nextFootstep <= 0)
|
||||
{
|
||||
GetComponent<AudioSource>().PlayOneShot(footStepSound, 0.7f);
|
||||
nextFootstep += footStepDelay;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ab0fc542e6aa6e48bf61987d199042b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Scripts/PlayerMovement.cs
|
||||
uploadId: 373385
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PushPhysics : MonoBehaviour
|
||||
{
|
||||
// this script pushes all rigidbodies that the character touches
|
||||
float pushPower = 2.0f;
|
||||
void OnControllerColliderHit(ControllerColliderHit hit)
|
||||
{
|
||||
Rigidbody body = hit.collider.attachedRigidbody;
|
||||
|
||||
// no rigidbody
|
||||
if (body == null || body.isKinematic)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// We dont want to push objects below us
|
||||
if (hit.moveDirection.y < -0.3)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate push direction from move direction,
|
||||
// we only push objects to the sides never up and down
|
||||
Vector3 pushDir = new Vector3(hit.moveDirection.x, 0, hit.moveDirection.z);
|
||||
|
||||
// If you know how fast your character is trying to move,
|
||||
// then you can also multiply the push velocity by that.
|
||||
|
||||
// Apply the push
|
||||
body.linearVelocity = pushDir * pushPower;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0b3d149154e23543992bf2ff78e15ad
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 159280
|
||||
packageName: Sci-Fi Construction Kit (Modular)
|
||||
packageVersion: 1.1.0
|
||||
assetPath: Assets/SciFi Warehouse Kit/Demo/Scripts/PushPhysics.cs
|
||||
uploadId: 373385
|
||||
Reference in New Issue
Block a user