Updated oculus stuff

This commit is contained in:
Chris Midkiff
2018-10-09 20:59:57 -04:00
parent 1e7362c19f
commit 9b7f63739e
957 changed files with 128988 additions and 588 deletions

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 95cc228aec2d4f444916a448645ca7ef
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,118 @@
/************************************************************************************
Filename : OculusSpatializerUserParamsEditor.cs
Content : This script adds editor functionality to OculusSpatializerUserParams script.
Created : December 14, 2015
Authors : Peter Giokaris
Copyright : Copyright 2015 Oculus VR, Inc. All Rights reserved.
Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License");
you may not use the Oculus VR Rift SDK except in compliance with the License,
which is provided at the time of installation or download, or which
otherwise accompanies this software in either electronic or hard copy form.
You may obtain a copy of the License at
http://www.oculusvr.com/licenses/LICENSE-3.1
Unless required by applicable law or agreed to in writing, the Oculus VR SDK
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
************************************************************************************/
#define CUSTOM_LAYOUT
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
[CustomEditor(typeof(ONSPAudioSource))]
public class OculusSpatializerUserParamsEditor : Editor
{
// target component
private ONSPAudioSource m_Component;
// highlight color
// Color HColor = Color.green;
// OnEnable
void OnEnable()
{
m_Component = (ONSPAudioSource)target;
}
// OnDestroy
void OnDestroy()
{
}
// OnInspectorGUI
public override void OnInspectorGUI()
{
GUI.color = Color.white;
Undo.RecordObject(m_Component, "OculusSpatializerUserParams");
{
#if CUSTOM_LAYOUT
m_Component.EnableSpatialization = EditorGUILayout.Toggle("Spatialization Enabled", m_Component.EnableSpatialization);
m_Component.EnableRfl = EditorGUILayout.Toggle("Reflections Enabled", m_Component.EnableRfl);
m_Component.Gain = EditorGUILayout.FloatField("Gain", m_Component.Gain);
Separator();
Label ("OCULUS ATTENUATION");
m_Component.UseInvSqr = EditorGUILayout.Toggle("Enabled", m_Component.UseInvSqr);
Label ("");
Label("RANGE (0.0 - 1000000.0 meters)");
m_Component.Near = EditorGUILayout.FloatField("Minimum", m_Component.Near);
m_Component.Far = EditorGUILayout.FloatField("Maximum", m_Component.Far);
Label("");
Label("VOLUMETRIC RADIUS (0.0 - 1000.0 meters)");
m_Component.VolumetricRadius = EditorGUILayout.FloatField("Radius", m_Component.VolumetricRadius);
Separator();
/*
// Reference GUI Layout fields
m_Component.VerticalFOV = EditorGUILayout.FloatField("Vertical FOV", m_Component.VerticalFOV);
m_Component.NeckPosition = EditorGUILayout.Vector3Field("Neck Position", m_Component.NeckPosition);
m_Component.UsePlayerEyeHeight = EditorGUILayout.Toggle ("Use Player Eye Height", m_Component.UsePlayerEeHeight);
m_Component.FollowOrientation = EditorGUILayout.ObjectField("Follow Orientation",
m_Component.FollowOrientation,
typeof(Transform), true) as Transform;
m_Component.BackgroundColor = EditorGUILayout.ColorField("Background Color", m_Component.BackgroundColor);
OVREditorGUIUtility.Separator();
*/
#else
DrawDefaultInspector ();
#endif
}
if (GUI.changed)
{
EditorUtility.SetDirty(m_Component);
}
}
// Utilities, move out of here (or copy over to other editor script)
// Separator
void Separator()
{
GUI.color = new Color(1, 1, 1, 0.25f);
GUILayout.Box("", "HorizontalSlider", GUILayout.Height(16));
GUI.color = Color.white;
}
// Label
void Label(string label)
{
EditorGUILayout.LabelField (label);
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: cb850b86de9091d4db4595959c56f954
timeCreated: 1442269815
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,99 @@
using UnityEditor;
using UnityEngine;
using System.Runtime.InteropServices;
public class OculusSpatializerReflectionCustomGUI : IAudioEffectPluginGUI
{
public override string Name
{
get { return "OculusSpatializerReflection"; }
}
public override string Description
{
get { return "Reflection parameters for Oculus Spatializer"; }
}
public override string Vendor
{
get { return "Oculus"; }
}
public override bool OnGUI(IAudioEffectPlugin plugin)
{
float fval = 0.0f;
bool bval = false;
Separator();
Label ("GLOBAL SCALE (0.00001 - 10000.0)");
plugin.GetFloatParameter("GScale", out fval);
plugin.SetFloatParameter("GScale", EditorGUILayout.FloatField(" ", Mathf.Clamp (fval, 0.00001f, 10000.0f)));
Separator();
// Treat these floats as bools in the inspector
plugin.GetFloatParameter("E.Rflt On", out fval);
bval = (fval == 0.0f) ? false : true;
bval = EditorGUILayout.Toggle("Reflections Engine On", bval);
plugin.SetFloatParameter("E.Rflt On", (bval == false) ? 0.0f : 1.0f);
plugin.GetFloatParameter("E.Rflt Rev On", out fval);
bval = (fval == 0.0f) ? false : true;
bval = EditorGUILayout.Toggle("Late Reverberation", bval);
plugin.SetFloatParameter("E.Rflt Rev On", (bval == false) ? 0.0f : 1.0f);
Separator();
Label("ROOM DIMENSIONS (meters)");
Label("");
plugin.GetFloatParameter("Room X", out fval);
plugin.SetFloatParameter("Room X", EditorGUILayout.Slider("Width", fval, 1.0f, 200.0f));
plugin.GetFloatParameter("Room Y", out fval);
plugin.SetFloatParameter("Room Y", EditorGUILayout.Slider("Height", fval, 1.0f, 200.0f));
plugin.GetFloatParameter("Room Z", out fval);
plugin.SetFloatParameter("Room Z", EditorGUILayout.Slider("Length", fval, 1.0f, 200.0f));
Separator();
Label("WALL REFLECTION COEFFICIENTS (0.0 - 0.97)");
Label("");
plugin.GetFloatParameter("Left", out fval);
plugin.SetFloatParameter("Left", EditorGUILayout.Slider("Left", fval, 0.0f, 0.97f));
plugin.GetFloatParameter("Right", out fval);
plugin.SetFloatParameter("Right", EditorGUILayout.Slider("Right", fval, 0.0f, 0.97f));
plugin.GetFloatParameter("Up", out fval);
plugin.SetFloatParameter("Up", EditorGUILayout.Slider("Up", fval, 0.0f, 0.97f));
plugin.GetFloatParameter("Down", out fval);
plugin.SetFloatParameter("Down", EditorGUILayout.Slider("Down", fval, 0.0f, 0.97f));
plugin.GetFloatParameter("Behind", out fval);
plugin.SetFloatParameter("Behind", EditorGUILayout.Slider("Back", fval, 0.0f, 0.97f));
plugin.GetFloatParameter("Front", out fval);
plugin.SetFloatParameter("Front", EditorGUILayout.Slider("Front", fval, 0.0f, 0.97f));
Separator();
Label("SHARED REVERB ATTENUATION RANGE (1.0 - 10000.0 meters)");
Label("");
plugin.GetFloatParameter("Shared Rev Min", out fval);
plugin.SetFloatParameter("Shared Rev Min", EditorGUILayout.Slider("Minimum", fval, 1.0f, 10000.0f));
plugin.GetFloatParameter("Shared Rev Max", out fval);
plugin.SetFloatParameter("Shared Rev Max", EditorGUILayout.Slider("Maximum", fval, 1.0f, 10000.0f));
// We will override the controls with our own, so return false
return false;
}
// Separator
void Separator()
{
GUI.color = new Color(1, 1, 1, 0.25f);
GUILayout.Box("", "HorizontalSlider", GUILayout.Height(16));
GUI.color = Color.white;
}
// Label
void Label(string label)
{
EditorGUILayout.LabelField (label);
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: db551baa938b4714490ee011b5541447
timeCreated: 1444752157
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1848f8942953b93448e73777a2056eb1
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a1ec0b585f1ff1141a7aff27b3051ecd
folderAsset: yes
timeCreated: 1441297332
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,34 @@
fileFormatVersion: 2
guid: ca6850cf135e6b14991097c6f08c62fe
timeCreated: 1444263923
licenseType: Store
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 1
isOverridable: 0
platformData:
data:
first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,109 @@
fileFormatVersion: 2
guid: d870fcfa1434e94408b4ff98ff17de30
folderAsset: yes
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 1
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXIntel: 0
Exclude OSXIntel64: 0
Exclude OSXUniversal: 0
Exclude Win: 1
Exclude Win64: 1
- first:
'': Editor
second:
enabled: 0
settings:
CPU: AnyCPU
OS: OSX
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: OSX
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d64bafd940c2d664c8fbecbdbeec25f6
folderAsset: yes
timeCreated: 1536271777
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>AudioPluginOculusSpatializer</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string></string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>1.0.3</string>
<key>CFBundleName</key>
<string></string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.3</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string></string>
</dict>
</plist>

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 32546f9d6eec92f4a86b9cd5558272f4
timeCreated: 1536271777
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1d0abb3b49cec804087c23b24aee1f54
folderAsset: yes
timeCreated: 1536271777
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c28d61cb689d4e042b6fcb73a2f0f5db
timeCreated: 1536271777
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 4580af6e50e07ae488b25fcb2be5df1a
folderAsset: yes
timeCreated: 1425156097
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,164 @@
fileFormatVersion: 2
guid: f13a06860e06aa543972e7be3648d789
timeCreated: 1444263923
licenseType: Store
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 1
isOverridable: 0
platformData:
data:
first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXIntel: 0
Exclude OSXIntel64: 1
Exclude OSXUniversal: 1
Exclude Win: 0
Exclude Win64: 1
data:
first:
'': Editor
second:
enabled: 0
settings:
CPU: x86
OS: Windows
data:
first:
'': WP8
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
data:
first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86
DefaultValueInitialized: true
OS: Windows
data:
first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
data:
first:
Samsung TV: SamsungTV
second:
enabled: 0
settings:
STV_MODEL: STANDARD_13
data:
first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: x86
data:
first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
data:
first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
data:
first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 343fc33c608b24949823391a40345245
folderAsset: yes
timeCreated: 1425156097
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,164 @@
fileFormatVersion: 2
guid: 4d6d87624a1d1a44494e90521dfef431
timeCreated: 1444263923
licenseType: Store
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 1
isOverridable: 0
platformData:
data:
first:
'': Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux: 1
Exclude Linux64: 0
Exclude LinuxUniversal: 1
Exclude OSXIntel: 1
Exclude OSXIntel64: 0
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 0
data:
first:
'': Editor
second:
enabled: 0
settings:
CPU: x86_64
OS: Windows
data:
first:
'': WP8
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
data:
first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
data:
first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Samsung TV: SamsungTV
second:
enabled: 0
settings:
STV_MODEL: STANDARD_13
data:
first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: x86_64
data:
first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86_64
data:
first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
data:
first:
iPhone: iOS
second:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 01192ee1c2d9d204ea8a4172eef60cd0
folderAsset: yes
timeCreated: 1424053913
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 305999d68a83b7d438df1bb704b6bc06
timeCreated: 1442947197
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 8231a80b351751f4ab1a5258c53a67a4
folderAsset: yes
timeCreated: 1440803521
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 54216e9ed42974e30967824b7f0b2806
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2314ce3a3eecf4816bad3c9eca4de2e1
NativeFormatImporter:
mainObjectFileID: -1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,358 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400000}
- 33: {fileID: 3300000}
- 23: {fileID: 2300000}
m_Layer: 0
m_Name: Graphics
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1002 &100001
EditorExtensionImpl:
serializedVersion: 6
--- !u!1 &100002
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400002}
- 143: {fileID: 14300000}
- 114: {fileID: 11400000}
- 114: {fileID: 11400002}
- 114: {fileID: 11400004}
m_Layer: 0
m_Name: First Person Controller
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1002 &100003
EditorExtensionImpl:
serializedVersion: 6
--- !u!1 &100004
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400004}
- 20: {fileID: 2000000}
- 92: {fileID: 9200000}
- 124: {fileID: 12400000}
- 114: {fileID: 11400006}
- 81: {fileID: 8100000}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1002 &100005
EditorExtensionImpl:
serializedVersion: 6
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: -0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: .400000006, y: .5, z: .400000006}
m_Children: []
m_Father: {fileID: 400002}
m_RootOrder: 0
--- !u!1002 &400001
EditorExtensionImpl:
serializedVersion: 6
--- !u!4 &400002
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -30.7649231, y: 3.25786257, z: -74.3138885}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 400000}
- {fileID: 400004}
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1002 &400003
EditorExtensionImpl:
serializedVersion: 6
--- !u!4 &400004
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: .907083511, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 400002}
m_RootOrder: 1
--- !u!1002 &400005
EditorExtensionImpl:
serializedVersion: 6
--- !u!20 &2000000
Camera:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: .19166474, g: .301966369, b: .474509805, a: 1}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: .300000012
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 100
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_HDR: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: .0219999999
--- !u!1002 &2000001
EditorExtensionImpl:
serializedVersion: 6
--- !u!23 &2300000
Renderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!1002 &2300001
EditorExtensionImpl:
serializedVersion: 6
--- !u!33 &3300000
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Mesh: {fileID: 10205, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1002 &3300001
EditorExtensionImpl:
serializedVersion: 6
--- !u!81 &8100000
AudioListener:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Enabled: 1
--- !u!1002 &8100001
EditorExtensionImpl:
serializedVersion: 6
--- !u!92 &9200000
Behaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Enabled: 1
--- !u!1002 &9200001
EditorExtensionImpl:
serializedVersion: 6
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68ec2fe99d1108b9d0006a298d76c639, type: 3}
m_Name:
m_EditorClassIdentifier:
axes: 1
sensitivityX: 15
sensitivityY: 0
minimumX: -360
maximumX: 360
minimumY: 0
maximumY: 0
--- !u!1002 &11400001
EditorExtensionImpl:
serializedVersion: 6
--- !u!114 &11400002
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ab79d7f243824f5d9826bd83522c8df, type: 3}
m_Name:
m_EditorClassIdentifier:
canControl: 1
useFixedUpdate: 1
movement:
maxForwardSpeed: 6
maxSidewaysSpeed: 6
maxBackwardsSpeed: 6
slopeSpeedMultiplier:
serializedVersion: 2
m_Curve:
- time: -90
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 90
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
maxGroundAcceleration: 20
maxAirAcceleration: 15
gravity: 20
maxFallSpeed: 20
jumping:
enabled: 1
baseHeight: 1
extraHeight: 1
perpAmount: 0
steepPerpAmount: .5
movingPlatform:
enabled: 1
movementTransfer: 2
sliding:
enabled: 1
slidingSpeed: 10
sidewaysControl: 1
speedControl: .400000006
--- !u!1002 &11400003
EditorExtensionImpl:
serializedVersion: 6
--- !u!114 &11400004
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 60bca8f58a0b8478e946e6e86658cb29, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1002 &11400005
EditorExtensionImpl:
serializedVersion: 6
--- !u!114 &11400006
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68ec2fe99d1108b9d0006a298d76c639, type: 3}
m_Name:
m_EditorClassIdentifier:
axes: 2
sensitivityX: 10
sensitivityY: 10
minimumX: 0
maximumX: 360
minimumY: -60
maximumY: 60
--- !u!1002 &11400007
EditorExtensionImpl:
serializedVersion: 6
--- !u!124 &12400000
Behaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Enabled: 1
--- !u!1002 &12400001
EditorExtensionImpl:
serializedVersion: 6
--- !u!143 &14300000
CharacterController:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002}
serializedVersion: 2
m_Height: 2
m_Radius: .400000006
m_SlopeLimit: 45
m_StepOffset: .400000006
m_SkinWidth: .0500000007
m_MinMoveDistance: 0
m_Center: {x: 0, y: 0, z: 0}
--- !u!1002 &14300001
EditorExtensionImpl:
serializedVersion: 6
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100002}
m_IsPrefabParent: 1
m_IsExploded: 1
--- !u!1002 &100100001
EditorExtensionImpl:
serializedVersion: 6

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9d4133d5d30b644bd87802a347eaccbe
NativeFormatImporter:
mainObjectFileID: -1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7e0b0a994d8934541a387e092630b5db
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c81df2918c80c054ca3d436e62090893
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,313 @@
fileFormatVersion: 2
guid: 449b48f7eb5d87a4baaa5fb73f875a59
ModelImporter:
serializedVersion: 19
fileIDToRecycleName:
100000: Bip001 R Finger1
100002: Bip001 R Finger21
100004: Bip001 R Finger11
100006: Bip001 R Finger02
100010: Bip001 R Finger12
100012: Bip001 R Finger41
100014: Bip001 R Finger4
100018: Bip001 R Finger32
100020: Bip001 R Finger31
100022: Bip001 R Finger3
100026: hip_adjustment_bone_right
100028: Bip001 R Finger42
100032: hip_adjustment_bone_left
100034: Bip001 R Finger2
100036: Bip001 R Finger22
100040: Bip001 R UpperArm
100042: Bip001 R Forearm
100044: Bip001 R Finger0
100046: Bip001 R Finger01
100052: //RootNode
100054: Bip001 R Clavicle
100058: Bip001 L Finger3
100060: Bip001 L Finger31
100062: Bip001 L Finger32
100066: Bip001 L Finger4
100068: Bip001 L Finger41
100070: Bip001 L Finger42
100074: Bip001 L Finger22
100076: Bip001 L Finger02
100080: Bip001 L Finger1
100082: Bip001 L Finger11
100084: Bip001 L Finger12
100088: Bip001 L Finger2
100090: Bip001 L Finger21
100092: Bip001 L Finger0
100094: Bip001 L Finger01
100096: Bip001 L Forearm
100098: Bip001 L UpperArm
100100: Bip001 L Clavicle
100102: construction_worker
100104: Bip001 R Toe0
100106: Bip001 R Foot
100108: Bip001 R Calf
100110: Bip001 R Thigh
100112: Bip001 L Toe0
100114: Bip001 L Foot
100116: Bip001 L Calf
100118: Bip001 L Thigh
100120: helmet_bone
100124: Bip001 Head
100126: wrench
100128: Bip001 R Hand
100130: Bip001 L Hand
100132: Bip001 Neck
100134: Bip001 Spine1
100136: Bip001 Spine
100138: Bip001 Pelvis
100140: Bip001
400000: Bip001 R Finger1
400002: Bip001 R Finger21
400004: Bip001 R Finger11
400006: Bip001 R Finger02
400010: Bip001 R Finger12
400012: Bip001 R Finger41
400014: Bip001 R Finger4
400018: Bip001 R Finger32
400020: Bip001 R Finger31
400022: Bip001 R Finger3
400026: hip_adjustment_bone_right
400028: Bip001 R Finger42
400032: hip_adjustment_bone_left
400034: Bip001 R Finger2
400036: Bip001 R Finger22
400040: Bip001 R UpperArm
400042: Bip001 R Forearm
400044: Bip001 R Finger0
400046: Bip001 R Finger01
400052: //RootNode
400054: Bip001 R Clavicle
400058: Bip001 L Finger3
400060: Bip001 L Finger31
400062: Bip001 L Finger32
400066: Bip001 L Finger4
400068: Bip001 L Finger41
400070: Bip001 L Finger42
400074: Bip001 L Finger22
400076: Bip001 L Finger02
400080: Bip001 L Finger1
400082: Bip001 L Finger11
400084: Bip001 L Finger12
400088: Bip001 L Finger2
400090: Bip001 L Finger21
400092: Bip001 L Finger0
400094: Bip001 L Finger01
400096: Bip001 L Forearm
400098: Bip001 L UpperArm
400100: Bip001 L Clavicle
400102: construction_worker
400104: Bip001 R Toe0
400106: Bip001 R Foot
400108: Bip001 R Calf
400110: Bip001 R Thigh
400112: Bip001 L Toe0
400114: Bip001 L Foot
400116: Bip001 L Calf
400118: Bip001 L Thigh
400120: helmet_bone
400124: Bip001 Head
400126: wrench
400128: Bip001 R Hand
400130: Bip001 L Hand
400132: Bip001 Neck
400134: Bip001 Spine1
400136: Bip001 Spine
400138: Bip001 Pelvis
400140: Bip001
2300000: wrench
3300000: wrench
4300000: construction_worker
4300002: wrench
7400012: idle
7400014: run
7400016: walk
7400018: jump_pose
11100000: //RootNode
13700000: Bip001 Pelvis
materials:
importMaterials: 1
materialName: 3
materialSearch: 1
animations:
legacyGenerateAnimations: 3
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
animationCompression: 0
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
clipAnimations:
- serializedVersion: 16
name: idle
takeName:
firstFrame: 2
lastFrame: 62
wrapMode: 2
orientationOffsetY: 0
level: 0
cycleOffset: 0
loop: 0
hasAdditiveReferencePose: 0
loopTime: 0
loopBlend: 0
loopBlendOrientation: 0
loopBlendPositionY: 0
loopBlendPositionXZ: 0
keepOriginalOrientation: 0
keepOriginalPositionY: 1
keepOriginalPositionXZ: 0
heightFromFeet: 0
mirror: 0
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
curves: []
events: []
transformMask: []
maskType: 0
maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0
- serializedVersion: 16
name: run
takeName:
firstFrame: 65
lastFrame: 81
wrapMode: 2
orientationOffsetY: 0
level: 0
cycleOffset: 0
loop: 0
hasAdditiveReferencePose: 0
loopTime: 0
loopBlend: 0
loopBlendOrientation: 0
loopBlendPositionY: 0
loopBlendPositionXZ: 0
keepOriginalOrientation: 0
keepOriginalPositionY: 1
keepOriginalPositionXZ: 0
heightFromFeet: 0
mirror: 0
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
curves: []
events: []
transformMask: []
maskType: 0
maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0
- serializedVersion: 16
name: walk
takeName:
firstFrame: 84
lastFrame: 116
wrapMode: 2
orientationOffsetY: 0
level: 0
cycleOffset: 0
loop: 0
hasAdditiveReferencePose: 0
loopTime: 0
loopBlend: 0
loopBlendOrientation: 0
loopBlendPositionY: 0
loopBlendPositionXZ: 0
keepOriginalOrientation: 0
keepOriginalPositionY: 1
keepOriginalPositionXZ: 0
heightFromFeet: 0
mirror: 0
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
curves: []
events: []
transformMask: []
maskType: 0
maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0
- serializedVersion: 16
name: jump_pose
takeName:
firstFrame: 118
lastFrame: 123
wrapMode: 0
orientationOffsetY: 0
level: 0
cycleOffset: 0
loop: 0
hasAdditiveReferencePose: 0
loopTime: 0
loopBlend: 0
loopBlendOrientation: 0
loopBlendPositionY: 0
loopBlendPositionXZ: 0
keepOriginalOrientation: 0
keepOriginalPositionY: 1
keepOriginalPositionXZ: 0
heightFromFeet: 0
mirror: 0
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
curves: []
events: []
transformMask: []
maskType: 0
maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 0.01
meshCompression: 0
addColliders: 0
importBlendShapes: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 4
importAnimation: 1
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 0
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 1
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e53c8c3dcc4ff59438bc9e86cb45c3f6
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,46 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: constructor_done
m_Shader: {fileID: 4, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 97b050d43ac7c4d2b9f6cbb587650761, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 2800000, guid: 531c14f8d5cdc4e5baa83ee6e16f783a, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Shininess
second: .078125
m_Colors:
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _SpecColor
second: {r: .5, g: .5, b: .5, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ca49380a71a2bb64c830d06bd421b9d1
NativeFormatImporter:
mainObjectFileID: -1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b365e6042890d4b1987423ed6bb8a08c
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,66 @@
fileFormatVersion: 2
guid: 97b050d43ac7c4d2b9f6cbb587650761
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f781c091d1c8647c380d5230adfaee54
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,587 @@
#pragma strict
#pragma implicit
#pragma downcast
// Does this script currently respond to input?
var canControl : boolean = true;
var useFixedUpdate : boolean = true;
// For the next variables, @System.NonSerialized tells Unity to not serialize the variable or show it in the inspector view.
// Very handy for organization!
// The current global direction we want the character to move in.
@System.NonSerialized
var inputMoveDirection : Vector3 = Vector3.zero;
// Is the jump button held down? We use this interface instead of checking
// for the jump button directly so this script can also be used by AIs.
@System.NonSerialized
var inputJump : boolean = false;
class CharacterMotorMovement {
// The maximum horizontal speed when moving
var maxForwardSpeed : float = 10.0;
var maxSidewaysSpeed : float = 10.0;
var maxBackwardsSpeed : float = 10.0;
// Curve for multiplying speed based on slope (negative = downwards)
var slopeSpeedMultiplier : AnimationCurve = AnimationCurve(Keyframe(-90, 1), Keyframe(0, 1), Keyframe(90, 0));
// How fast does the character change speeds? Higher is faster.
var maxGroundAcceleration : float = 30.0;
var maxAirAcceleration : float = 20.0;
// The gravity for the character
var gravity : float = 10.0;
var maxFallSpeed : float = 20.0;
// For the next variables, @System.NonSerialized tells Unity to not serialize the variable or show it in the inspector view.
// Very handy for organization!
// The last collision flags returned from controller.Move
@System.NonSerialized
var collisionFlags : CollisionFlags;
// We will keep track of the character's current velocity,
@System.NonSerialized
var velocity : Vector3;
// This keeps track of our current velocity while we're not grounded
@System.NonSerialized
var frameVelocity : Vector3 = Vector3.zero;
@System.NonSerialized
var hitPoint : Vector3 = Vector3.zero;
@System.NonSerialized
var lastHitPoint : Vector3 = Vector3(Mathf.Infinity, 0, 0);
}
var movement : CharacterMotorMovement = CharacterMotorMovement();
enum MovementTransferOnJump {
None, // The jump is not affected by velocity of floor at all.
InitTransfer, // Jump gets its initial velocity from the floor, then gradualy comes to a stop.
PermaTransfer, // Jump gets its initial velocity from the floor, and keeps that velocity until landing.
PermaLocked // Jump is relative to the movement of the last touched floor and will move together with that floor.
}
// We will contain all the jumping related variables in one helper class for clarity.
class CharacterMotorJumping {
// Can the character jump?
var enabled : boolean = true;
// How high do we jump when pressing jump and letting go immediately
var baseHeight : float = 1.0;
// We add extraHeight units (meters) on top when holding the button down longer while jumping
var extraHeight : float = 4.1;
// How much does the character jump out perpendicular to the surface on walkable surfaces?
// 0 means a fully vertical jump and 1 means fully perpendicular.
var perpAmount : float = 0.0;
// How much does the character jump out perpendicular to the surface on too steep surfaces?
// 0 means a fully vertical jump and 1 means fully perpendicular.
var steepPerpAmount : float = 0.5;
// For the next variables, @System.NonSerialized tells Unity to not serialize the variable or show it in the inspector view.
// Very handy for organization!
// Are we jumping? (Initiated with jump button and not grounded yet)
// To see if we are just in the air (initiated by jumping OR falling) see the grounded variable.
@System.NonSerialized
var jumping : boolean = false;
@System.NonSerialized
var holdingJumpButton : boolean = false;
// the time we jumped at (Used to determine for how long to apply extra jump power after jumping.)
@System.NonSerialized
var lastStartTime : float = 0.0;
@System.NonSerialized
var lastButtonDownTime : float = -100;
@System.NonSerialized
var jumpDir : Vector3 = Vector3.up;
}
var jumping : CharacterMotorJumping = CharacterMotorJumping();
class CharacterMotorMovingPlatform {
var enabled : boolean = true;
var movementTransfer : MovementTransferOnJump = MovementTransferOnJump.PermaTransfer;
@System.NonSerialized
var hitPlatform : Transform;
@System.NonSerialized
var activePlatform : Transform;
@System.NonSerialized
var activeLocalPoint : Vector3;
@System.NonSerialized
var activeGlobalPoint : Vector3;
@System.NonSerialized
var activeLocalRotation : Quaternion;
@System.NonSerialized
var activeGlobalRotation : Quaternion;
@System.NonSerialized
var lastMatrix : Matrix4x4;
@System.NonSerialized
var platformVelocity : Vector3;
@System.NonSerialized
var newPlatform : boolean;
}
var movingPlatform : CharacterMotorMovingPlatform = CharacterMotorMovingPlatform();
class CharacterMotorSliding {
// Does the character slide on too steep surfaces?
var enabled : boolean = true;
// How fast does the character slide on steep surfaces?
var slidingSpeed : float = 15;
// How much can the player control the sliding direction?
// If the value is 0.5 the player can slide sideways with half the speed of the downwards sliding speed.
var sidewaysControl : float = 1.0;
// How much can the player influence the sliding speed?
// If the value is 0.5 the player can speed the sliding up to 150% or slow it down to 50%.
var speedControl : float = 0.4;
}
var sliding : CharacterMotorSliding = CharacterMotorSliding();
@System.NonSerialized
var grounded : boolean = true;
@System.NonSerialized
var groundNormal : Vector3 = Vector3.zero;
private var lastGroundNormal : Vector3 = Vector3.zero;
private var tr : Transform;
private var controller : CharacterController;
function Awake () {
controller = GetComponent (CharacterController);
tr = transform;
}
private function UpdateFunction () {
// We copy the actual velocity into a temporary variable that we can manipulate.
var velocity : Vector3 = movement.velocity;
// Update velocity based on input
velocity = ApplyInputVelocityChange(velocity);
// Apply gravity and jumping force
velocity = ApplyGravityAndJumping (velocity);
// Moving platform support
var moveDistance : Vector3 = Vector3.zero;
if (MoveWithPlatform()) {
var newGlobalPoint : Vector3 = movingPlatform.activePlatform.TransformPoint(movingPlatform.activeLocalPoint);
moveDistance = (newGlobalPoint - movingPlatform.activeGlobalPoint);
if (moveDistance != Vector3.zero)
controller.Move(moveDistance);
// Support moving platform rotation as well:
var newGlobalRotation : Quaternion = movingPlatform.activePlatform.rotation * movingPlatform.activeLocalRotation;
var rotationDiff : Quaternion = newGlobalRotation * Quaternion.Inverse(movingPlatform.activeGlobalRotation);
var yRotation = rotationDiff.eulerAngles.y;
if (yRotation != 0) {
// Prevent rotation of the local up vector
tr.Rotate(0, yRotation, 0);
}
}
// Save lastPosition for velocity calculation.
var lastPosition : Vector3 = tr.position;
// We always want the movement to be framerate independent. Multiplying by Time.deltaTime does this.
var currentMovementOffset : Vector3 = velocity * Time.deltaTime;
// Find out how much we need to push towards the ground to avoid loosing grouning
// when walking down a step or over a sharp change in slope.
var pushDownOffset : float = Mathf.Max(controller.stepOffset, Vector3(currentMovementOffset.x, 0, currentMovementOffset.z).magnitude);
if (grounded)
currentMovementOffset -= pushDownOffset * Vector3.up;
// Reset variables that will be set by collision function
movingPlatform.hitPlatform = null;
groundNormal = Vector3.zero;
// Move our character!
movement.collisionFlags = controller.Move (currentMovementOffset);
movement.lastHitPoint = movement.hitPoint;
lastGroundNormal = groundNormal;
if (movingPlatform.enabled && movingPlatform.activePlatform != movingPlatform.hitPlatform) {
if (movingPlatform.hitPlatform != null) {
movingPlatform.activePlatform = movingPlatform.hitPlatform;
movingPlatform.lastMatrix = movingPlatform.hitPlatform.localToWorldMatrix;
movingPlatform.newPlatform = true;
}
}
// Calculate the velocity based on the current and previous position.
// This means our velocity will only be the amount the character actually moved as a result of collisions.
var oldHVelocity : Vector3 = new Vector3(velocity.x, 0, velocity.z);
movement.velocity = (tr.position - lastPosition) / Time.deltaTime;
var newHVelocity : Vector3 = new Vector3(movement.velocity.x, 0, movement.velocity.z);
// The CharacterController can be moved in unwanted directions when colliding with things.
// We want to prevent this from influencing the recorded velocity.
if (oldHVelocity == Vector3.zero) {
movement.velocity = new Vector3(0, movement.velocity.y, 0);
}
else {
var projectedNewVelocity : float = Vector3.Dot(newHVelocity, oldHVelocity) / oldHVelocity.sqrMagnitude;
movement.velocity = oldHVelocity * Mathf.Clamp01(projectedNewVelocity) + movement.velocity.y * Vector3.up;
}
if (movement.velocity.y < velocity.y - 0.001) {
if (movement.velocity.y < 0) {
// Something is forcing the CharacterController down faster than it should.
// Ignore this
movement.velocity.y = velocity.y;
}
else {
// The upwards movement of the CharacterController has been blocked.
// This is treated like a ceiling collision - stop further jumping here.
jumping.holdingJumpButton = false;
}
}
// We were grounded but just loosed grounding
if (grounded && !IsGroundedTest()) {
grounded = false;
// Apply inertia from platform
if (movingPlatform.enabled &&
(movingPlatform.movementTransfer == MovementTransferOnJump.InitTransfer ||
movingPlatform.movementTransfer == MovementTransferOnJump.PermaTransfer)
) {
movement.frameVelocity = movingPlatform.platformVelocity;
movement.velocity += movingPlatform.platformVelocity;
}
SendMessage("OnFall", SendMessageOptions.DontRequireReceiver);
// We pushed the character down to ensure it would stay on the ground if there was any.
// But there wasn't so now we cancel the downwards offset to make the fall smoother.
tr.position += pushDownOffset * Vector3.up;
}
// We were not grounded but just landed on something
else if (!grounded && IsGroundedTest()) {
grounded = true;
jumping.jumping = false;
SubtractNewPlatformVelocity();
SendMessage("OnLand", SendMessageOptions.DontRequireReceiver);
}
// Moving platforms support
if (MoveWithPlatform()) {
// Use the center of the lower half sphere of the capsule as reference point.
// This works best when the character is standing on moving tilting platforms.
movingPlatform.activeGlobalPoint = tr.position + Vector3.up * (controller.center.y - controller.height*0.5 + controller.radius);
movingPlatform.activeLocalPoint = movingPlatform.activePlatform.InverseTransformPoint(movingPlatform.activeGlobalPoint);
// Support moving platform rotation as well:
movingPlatform.activeGlobalRotation = tr.rotation;
movingPlatform.activeLocalRotation = Quaternion.Inverse(movingPlatform.activePlatform.rotation) * movingPlatform.activeGlobalRotation;
}
}
function FixedUpdate () {
if (movingPlatform.enabled) {
if (movingPlatform.activePlatform != null) {
if (!movingPlatform.newPlatform) {
var lastVelocity : Vector3 = movingPlatform.platformVelocity;
movingPlatform.platformVelocity = (
movingPlatform.activePlatform.localToWorldMatrix.MultiplyPoint3x4(movingPlatform.activeLocalPoint)
- movingPlatform.lastMatrix.MultiplyPoint3x4(movingPlatform.activeLocalPoint)
) / Time.deltaTime;
}
movingPlatform.lastMatrix = movingPlatform.activePlatform.localToWorldMatrix;
movingPlatform.newPlatform = false;
}
else {
movingPlatform.platformVelocity = Vector3.zero;
}
}
if (useFixedUpdate)
UpdateFunction();
}
function Update () {
if (!useFixedUpdate)
UpdateFunction();
}
private function ApplyInputVelocityChange (velocity : Vector3) {
if (!canControl)
inputMoveDirection = Vector3.zero;
// Find desired velocity
var desiredVelocity : Vector3;
if (grounded && TooSteep()) {
// The direction we're sliding in
desiredVelocity = Vector3(groundNormal.x, 0, groundNormal.z).normalized;
// Find the input movement direction projected onto the sliding direction
var projectedMoveDir = Vector3.Project(inputMoveDirection, desiredVelocity);
// Add the sliding direction, the spped control, and the sideways control vectors
desiredVelocity = desiredVelocity + projectedMoveDir * sliding.speedControl + (inputMoveDirection - projectedMoveDir) * sliding.sidewaysControl;
// Multiply with the sliding speed
desiredVelocity *= sliding.slidingSpeed;
}
else
desiredVelocity = GetDesiredHorizontalVelocity();
if (movingPlatform.enabled && movingPlatform.movementTransfer == MovementTransferOnJump.PermaTransfer) {
desiredVelocity += movement.frameVelocity;
desiredVelocity.y = 0;
}
if (grounded)
desiredVelocity = AdjustGroundVelocityToNormal(desiredVelocity, groundNormal);
else
velocity.y = 0;
// Enforce max velocity change
var maxVelocityChange : float = GetMaxAcceleration(grounded) * Time.deltaTime;
var velocityChangeVector : Vector3 = (desiredVelocity - velocity);
if (velocityChangeVector.sqrMagnitude > maxVelocityChange * maxVelocityChange) {
velocityChangeVector = velocityChangeVector.normalized * maxVelocityChange;
}
// If we're in the air and don't have control, don't apply any velocity change at all.
// If we're on the ground and don't have control we do apply it - it will correspond to friction.
if (grounded || canControl)
velocity += velocityChangeVector;
if (grounded) {
// When going uphill, the CharacterController will automatically move up by the needed amount.
// Not moving it upwards manually prevent risk of lifting off from the ground.
// When going downhill, DO move down manually, as gravity is not enough on steep hills.
velocity.y = Mathf.Min(velocity.y, 0);
}
return velocity;
}
private function ApplyGravityAndJumping (velocity : Vector3) {
if (!inputJump || !canControl) {
jumping.holdingJumpButton = false;
jumping.lastButtonDownTime = -100;
}
if (inputJump && jumping.lastButtonDownTime < 0 && canControl)
jumping.lastButtonDownTime = Time.time;
if (grounded)
velocity.y = Mathf.Min(0, velocity.y) - movement.gravity * Time.deltaTime;
else {
velocity.y = movement.velocity.y - movement.gravity * Time.deltaTime;
// When jumping up we don't apply gravity for some time when the user is holding the jump button.
// This gives more control over jump height by pressing the button longer.
if (jumping.jumping && jumping.holdingJumpButton) {
// Calculate the duration that the extra jump force should have effect.
// If we're still less than that duration after the jumping time, apply the force.
if (Time.time < jumping.lastStartTime + jumping.extraHeight / CalculateJumpVerticalSpeed(jumping.baseHeight)) {
// Negate the gravity we just applied, except we push in jumpDir rather than jump upwards.
velocity += jumping.jumpDir * movement.gravity * Time.deltaTime;
}
}
// Make sure we don't fall any faster than maxFallSpeed. This gives our character a terminal velocity.
velocity.y = Mathf.Max (velocity.y, -movement.maxFallSpeed);
}
if (grounded) {
// Jump only if the jump button was pressed down in the last 0.2 seconds.
// We use this check instead of checking if it's pressed down right now
// because players will often try to jump in the exact moment when hitting the ground after a jump
// and if they hit the button a fraction of a second too soon and no new jump happens as a consequence,
// it's confusing and it feels like the game is buggy.
if (jumping.enabled && canControl && (Time.time - jumping.lastButtonDownTime < 0.2)) {
grounded = false;
jumping.jumping = true;
jumping.lastStartTime = Time.time;
jumping.lastButtonDownTime = -100;
jumping.holdingJumpButton = true;
// Calculate the jumping direction
if (TooSteep())
jumping.jumpDir = Vector3.Slerp(Vector3.up, groundNormal, jumping.steepPerpAmount);
else
jumping.jumpDir = Vector3.Slerp(Vector3.up, groundNormal, jumping.perpAmount);
// Apply the jumping force to the velocity. Cancel any vertical velocity first.
velocity.y = 0;
velocity += jumping.jumpDir * CalculateJumpVerticalSpeed (jumping.baseHeight);
// Apply inertia from platform
if (movingPlatform.enabled &&
(movingPlatform.movementTransfer == MovementTransferOnJump.InitTransfer ||
movingPlatform.movementTransfer == MovementTransferOnJump.PermaTransfer)
) {
movement.frameVelocity = movingPlatform.platformVelocity;
velocity += movingPlatform.platformVelocity;
}
SendMessage("OnJump", SendMessageOptions.DontRequireReceiver);
}
else {
jumping.holdingJumpButton = false;
}
}
return velocity;
}
function OnControllerColliderHit (hit : ControllerColliderHit) {
if (hit.normal.y > 0 && hit.normal.y > groundNormal.y && hit.moveDirection.y < 0) {
if ((hit.point - movement.lastHitPoint).sqrMagnitude > 0.001 || lastGroundNormal == Vector3.zero)
groundNormal = hit.normal;
else
groundNormal = lastGroundNormal;
movingPlatform.hitPlatform = hit.collider.transform;
movement.hitPoint = hit.point;
movement.frameVelocity = Vector3.zero;
}
}
private function SubtractNewPlatformVelocity () {
// When landing, subtract the velocity of the new ground from the character's velocity
// since movement in ground is relative to the movement of the ground.
if (movingPlatform.enabled &&
(movingPlatform.movementTransfer == MovementTransferOnJump.InitTransfer ||
movingPlatform.movementTransfer == MovementTransferOnJump.PermaTransfer)
) {
// If we landed on a new platform, we have to wait for two FixedUpdates
// before we know the velocity of the platform under the character
if (movingPlatform.newPlatform) {
var platform : Transform = movingPlatform.activePlatform;
yield WaitForFixedUpdate();
yield WaitForFixedUpdate();
if (grounded && platform == movingPlatform.activePlatform)
yield 1;
}
movement.velocity -= movingPlatform.platformVelocity;
}
}
private function MoveWithPlatform () : boolean {
return (
movingPlatform.enabled
&& (grounded || movingPlatform.movementTransfer == MovementTransferOnJump.PermaLocked)
&& movingPlatform.activePlatform != null
);
}
private function GetDesiredHorizontalVelocity () {
// Find desired velocity
var desiredLocalDirection : Vector3 = tr.InverseTransformDirection(inputMoveDirection);
var maxSpeed : float = MaxSpeedInDirection(desiredLocalDirection);
if (grounded) {
// Modify max speed on slopes based on slope speed multiplier curve
var movementSlopeAngle = Mathf.Asin(movement.velocity.normalized.y) * Mathf.Rad2Deg;
maxSpeed *= movement.slopeSpeedMultiplier.Evaluate(movementSlopeAngle);
}
return tr.TransformDirection(desiredLocalDirection * maxSpeed);
}
private function AdjustGroundVelocityToNormal (hVelocity : Vector3, groundNormal : Vector3) : Vector3 {
var sideways : Vector3 = Vector3.Cross(Vector3.up, hVelocity);
return Vector3.Cross(sideways, groundNormal).normalized * hVelocity.magnitude;
}
private function IsGroundedTest () {
return (groundNormal.y > 0.01);
}
function GetMaxAcceleration (grounded : boolean) : float {
// Maximum acceleration on ground and in air
if (grounded)
return movement.maxGroundAcceleration;
else
return movement.maxAirAcceleration;
}
function CalculateJumpVerticalSpeed (targetJumpHeight : float) {
// From the jump height and gravity we deduce the upwards speed
// for the character to reach at the apex.
return Mathf.Sqrt (2 * targetJumpHeight * movement.gravity);
}
function IsJumping () {
return jumping.jumping;
}
function IsSliding () {
return (grounded && sliding.enabled && TooSteep());
}
function IsTouchingCeiling () {
return (movement.collisionFlags & CollisionFlags.CollidedAbove) != 0;
}
function IsGrounded () {
return grounded;
}
function TooSteep () {
return (groundNormal.y <= Mathf.Cos(controller.slopeLimit * Mathf.Deg2Rad));
}
function GetDirection () {
return inputMoveDirection;
}
function SetControllable (controllable : boolean) {
canControl = controllable;
}
// Project a direction onto elliptical quater segments based on forward, sideways, and backwards speed.
// The function returns the length of the resulting vector.
function MaxSpeedInDirection (desiredMovementDirection : Vector3) : float {
if (desiredMovementDirection == Vector3.zero)
return 0;
else {
var zAxisEllipseMultiplier : float = (desiredMovementDirection.z > 0 ? movement.maxForwardSpeed : movement.maxBackwardsSpeed) / movement.maxSidewaysSpeed;
var temp : Vector3 = new Vector3(desiredMovementDirection.x, 0, desiredMovementDirection.z / zAxisEllipseMultiplier).normalized;
var length : float = new Vector3(temp.x, 0, temp.z * zAxisEllipseMultiplier).magnitude * movement.maxSidewaysSpeed;
return length;
}
}
function SetVelocity (velocity : Vector3) {
grounded = false;
movement.velocity = velocity;
movement.frameVelocity = Vector3.zero;
SendMessage("OnExternalVelocity");
}
// Require a character controller to be attached to the same game object
@script RequireComponent (CharacterController)
@script AddComponentMenu ("Character/Character Motor")

View File

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

View File

@@ -0,0 +1,37 @@
private var motor : CharacterMotor;
// Use this for initialization
function Awake () {
motor = GetComponent(CharacterMotor);
}
// Update is called once per frame
function Update () {
// Get the input vector from keyboard or analog stick
var directionVector = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
if (directionVector != Vector3.zero) {
// Get the length of the directon vector and then normalize it
// Dividing by the length is cheaper than normalizing when we already have the length anyway
var directionLength = directionVector.magnitude;
directionVector = directionVector / directionLength;
// Make sure the length is no bigger than 1
directionLength = Mathf.Min(1, directionLength);
// Make the input vector more sensitive towards the extremes and less sensitive in the middle
// This makes it easier to control slow speeds when using analog sticks
directionLength = directionLength * directionLength;
// Multiply the normalized direction vector by the modified length
directionVector = directionVector * directionLength;
}
// Apply the direction to the CharacterMotor
motor.inputMoveDirection = transform.rotation * directionVector;
motor.inputJump = Input.GetButton("Jump");
}
// Require a character controller to be attached to the same game object
@script RequireComponent (CharacterMotor)
@script AddComponentMenu ("Character/FPS Input Controller")

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 60bca8f58a0b8478e946e6e86658cb29
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,63 @@
using UnityEngine;
using System.Collections;
/// MouseLook rotates the transform based on the mouse delta.
/// Minimum and Maximum values can be used to constrain the possible rotation
/// To make an FPS style character:
/// - Create a capsule.
/// - Add the MouseLook script to the capsule.
/// -> Set the mouse look to use LookX. (You want to only turn character but not tilt it)
/// - Add FPSInputController script to the capsule
/// -> A CharacterMotor and a CharacterController component will be automatically added.
/// - Create a camera. Make the camera a child of the capsule. Reset it's transform.
/// - Add a MouseLook script to the camera.
/// -> Set the mouse look to use LookY. (You want the camera to tilt up and down like a head. The character already turns.)
[AddComponentMenu("Camera-Control/Mouse Look")]
public class MouseLook : MonoBehaviour {
public enum RotationAxes { MouseXAndY = 0, MouseX = 1, MouseY = 2 }
public RotationAxes axes = RotationAxes.MouseXAndY;
public float sensitivityX = 15F;
public float sensitivityY = 15F;
public float minimumX = -360F;
public float maximumX = 360F;
public float minimumY = -60F;
public float maximumY = 60F;
float rotationY = 0F;
void Update ()
{
if (axes == RotationAxes.MouseXAndY)
{
float rotationX = transform.localEulerAngles.y + Input.GetAxis("Mouse X") * sensitivityX;
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
transform.localEulerAngles = new Vector3(-rotationY, rotationX, 0);
}
else if (axes == RotationAxes.MouseX)
{
transform.Rotate(0, Input.GetAxis("Mouse X") * sensitivityX, 0);
}
else
{
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
transform.localEulerAngles = new Vector3(-rotationY, transform.localEulerAngles.y, 0);
}
}
void Start ()
{
// Make the rigid body not change rotation
if (GetComponent<Rigidbody>())
GetComponent<Rigidbody>().freezeRotation = true;
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 68ec2fe99d1108b9d0006a298d76c639
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,68 @@
// This makes the character turn to face the current movement speed per default.
var autoRotate : boolean = true;
var maxRotationSpeed : float = 360;
private var motor : CharacterMotor;
// Use this for initialization
function Awake () {
motor = GetComponent(CharacterMotor);
}
// Update is called once per frame
function Update () {
// Get the input vector from keyboard or analog stick
var directionVector = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0);
if (directionVector != Vector3.zero) {
// Get the length of the directon vector and then normalize it
// Dividing by the length is cheaper than normalizing when we already have the length anyway
var directionLength = directionVector.magnitude;
directionVector = directionVector / directionLength;
// Make sure the length is no bigger than 1
directionLength = Mathf.Min(1, directionLength);
// Make the input vector more sensitive towards the extremes and less sensitive in the middle
// This makes it easier to control slow speeds when using analog sticks
directionLength = directionLength * directionLength;
// Multiply the normalized direction vector by the modified length
directionVector = directionVector * directionLength;
}
// Rotate the input vector into camera space so up is camera's up and right is camera's right
directionVector = Camera.main.transform.rotation * directionVector;
// Rotate input vector to be perpendicular to character's up vector
var camToCharacterSpace = Quaternion.FromToRotation(-Camera.main.transform.forward, transform.up);
directionVector = (camToCharacterSpace * directionVector);
// Apply the direction to the CharacterMotor
motor.inputMoveDirection = directionVector;
motor.inputJump = Input.GetButton("Jump");
// Set rotation to the move direction
if (autoRotate && directionVector.sqrMagnitude > 0.01) {
var newForward : Vector3 = ConstantSlerp(
transform.forward,
directionVector,
maxRotationSpeed * Time.deltaTime
);
newForward = ProjectOntoPlane(newForward, transform.up);
transform.rotation = Quaternion.LookRotation(newForward, transform.up);
}
}
function ProjectOntoPlane (v : Vector3, normal : Vector3) {
return v - Vector3.Project(v, normal);
}
function ConstantSlerp (from : Vector3, to : Vector3, angle : float) {
var value : float = Mathf.Min(1, angle / Vector3.Angle(from, to));
return Vector3.Slerp(from, to, value);
}
// Require a character controller to be attached to the same game object
@script RequireComponent (CharacterMotor)
@script AddComponentMenu ("Character/Platform Input Controller")

View File

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

View File

@@ -0,0 +1,230 @@
var cameraTransform : Transform;
private var _target : Transform;
// The distance in the x-z plane to the target
var distance = 7.0;
// the height we want the camera to be above the target
var height = 3.0;
var angularSmoothLag = 0.3;
var angularMaxSpeed = 15.0;
var heightSmoothLag = 0.3;
var snapSmoothLag = 0.2;
var snapMaxSpeed = 720.0;
var clampHeadPositionScreenSpace = 0.75;
var lockCameraTimeout = 0.2;
private var headOffset = Vector3.zero;
private var centerOffset = Vector3.zero;
private var heightVelocity = 0.0;
private var angleVelocity = 0.0;
private var snap = false;
private var controller : ThirdPersonController;
private var targetHeight = 100000.0;
function Awake ()
{
if(!cameraTransform && Camera.main)
cameraTransform = Camera.main.transform;
if(!cameraTransform) {
Debug.Log("Please assign a camera to the ThirdPersonCamera script.");
enabled = false;
}
_target = transform;
if (_target)
{
controller = _target.GetComponent(ThirdPersonController);
}
if (controller)
{
var characterController : CharacterController = _target.GetComponent.<Collider>();
centerOffset = characterController.bounds.center - _target.position;
headOffset = centerOffset;
headOffset.y = characterController.bounds.max.y - _target.position.y;
}
else
Debug.Log("Please assign a target to the camera that has a ThirdPersonController script attached.");
Cut(_target, centerOffset);
}
function DebugDrawStuff ()
{
Debug.DrawLine(_target.position, _target.position + headOffset);
}
function AngleDistance (a : float, b : float)
{
a = Mathf.Repeat(a, 360);
b = Mathf.Repeat(b, 360);
return Mathf.Abs(b - a);
}
function Apply (dummyTarget : Transform, dummyCenter : Vector3)
{
// Early out if we don't have a target
if (!controller)
return;
var targetCenter = _target.position + centerOffset;
var targetHead = _target.position + headOffset;
// DebugDrawStuff();
// Calculate the current & target rotation angles
var originalTargetAngle = _target.eulerAngles.y;
var currentAngle = cameraTransform.eulerAngles.y;
// Adjust real target angle when camera is locked
var targetAngle = originalTargetAngle;
// When pressing Fire2 (alt) the camera will snap to the target direction real quick.
// It will stop snapping when it reaches the target
if (Input.GetButton("Fire2"))
snap = true;
if (snap)
{
// We are close to the target, so we can stop snapping now!
if (AngleDistance (currentAngle, originalTargetAngle) < 3.0)
snap = false;
currentAngle = Mathf.SmoothDampAngle(currentAngle, targetAngle, angleVelocity, snapSmoothLag, snapMaxSpeed);
}
// Normal camera motion
else
{
if (controller.GetLockCameraTimer () < lockCameraTimeout)
{
targetAngle = currentAngle;
}
// Lock the camera when moving backwards!
// * It is really confusing to do 180 degree spins when turning around.
if (AngleDistance (currentAngle, targetAngle) > 160 && controller.IsMovingBackwards ())
targetAngle += 180;
currentAngle = Mathf.SmoothDampAngle(currentAngle, targetAngle, angleVelocity, angularSmoothLag, angularMaxSpeed);
}
// When jumping don't move camera upwards but only down!
if (controller.IsJumping ())
{
// We'd be moving the camera upwards, do that only if it's really high
var newTargetHeight = targetCenter.y + height;
if (newTargetHeight < targetHeight || newTargetHeight - targetHeight > 5)
targetHeight = targetCenter.y + height;
}
// When walking always update the target height
else
{
targetHeight = targetCenter.y + height;
}
// Damp the height
var currentHeight = cameraTransform.position.y;
currentHeight = Mathf.SmoothDamp (currentHeight, targetHeight, heightVelocity, heightSmoothLag);
// Convert the angle into a rotation, by which we then reposition the camera
var currentRotation = Quaternion.Euler (0, currentAngle, 0);
// Set the position of the camera on the x-z plane to:
// distance meters behind the target
cameraTransform.position = targetCenter;
cameraTransform.position += currentRotation * Vector3.back * distance;
// Set the height of the camera
cameraTransform.position.y = currentHeight;
// Always look at the target
SetUpRotation(targetCenter, targetHead);
}
function LateUpdate () {
Apply (transform, Vector3.zero);
}
function Cut (dummyTarget : Transform, dummyCenter : Vector3)
{
var oldHeightSmooth = heightSmoothLag;
var oldSnapMaxSpeed = snapMaxSpeed;
var oldSnapSmooth = snapSmoothLag;
snapMaxSpeed = 10000;
snapSmoothLag = 0.001;
heightSmoothLag = 0.001;
snap = true;
Apply (transform, Vector3.zero);
heightSmoothLag = oldHeightSmooth;
snapMaxSpeed = oldSnapMaxSpeed;
snapSmoothLag = oldSnapSmooth;
}
function SetUpRotation (centerPos : Vector3, headPos : Vector3)
{
// Now it's getting hairy. The devil is in the details here, the big issue is jumping of course.
// * When jumping up and down we don't want to center the guy in screen space.
// This is important to give a feel for how high you jump and avoiding large camera movements.
//
// * At the same time we dont want him to ever go out of screen and we want all rotations to be totally smooth.
//
// So here is what we will do:
//
// 1. We first find the rotation around the y axis. Thus he is always centered on the y-axis
// 2. When grounded we make him be centered
// 3. When jumping we keep the camera rotation but rotate the camera to get him back into view if his head is above some threshold
// 4. When landing we smoothly interpolate towards centering him on screen
var cameraPos = cameraTransform.position;
var offsetToCenter = centerPos - cameraPos;
// Generate base rotation only around y-axis
var yRotation = Quaternion.LookRotation(Vector3(offsetToCenter.x, 0, offsetToCenter.z));
var relativeOffset = Vector3.forward * distance + Vector3.down * height;
cameraTransform.rotation = yRotation * Quaternion.LookRotation(relativeOffset);
// Calculate the projected center position and top position in world space
var centerRay = cameraTransform.GetComponent.<Camera>().ViewportPointToRay(Vector3(.5, 0.5, 1));
var topRay = cameraTransform.GetComponent.<Camera>().ViewportPointToRay(Vector3(.5, clampHeadPositionScreenSpace, 1));
var centerRayPos = centerRay.GetPoint(distance);
var topRayPos = topRay.GetPoint(distance);
var centerToTopAngle = Vector3.Angle(centerRay.direction, topRay.direction);
var heightToAngle = centerToTopAngle / (centerRayPos.y - topRayPos.y);
var extraLookAngle = heightToAngle * (centerRayPos.y - centerPos.y);
if (extraLookAngle < centerToTopAngle)
{
extraLookAngle = 0;
}
else
{
extraLookAngle = extraLookAngle - centerToTopAngle;
cameraTransform.rotation *= Quaternion.Euler(-extraLookAngle, 0, 0);
}
}
function GetCenterOffset ()
{
return centerOffset;
}

View File

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

View File

@@ -0,0 +1,440 @@
// Require a character controller to be attached to the same game object
@script RequireComponent(CharacterController)
public var idleAnimation : AnimationClip;
public var walkAnimation : AnimationClip;
public var runAnimation : AnimationClip;
public var jumpPoseAnimation : AnimationClip;
public var walkMaxAnimationSpeed : float = 0.75;
public var trotMaxAnimationSpeed : float = 1.0;
public var runMaxAnimationSpeed : float = 1.0;
public var jumpAnimationSpeed : float = 1.15;
public var landAnimationSpeed : float = 1.0;
private var _animation : Animation;
enum CharacterState {
Idle = 0,
Walking = 1,
Trotting = 2,
Running = 3,
Jumping = 4,
}
private var _characterState : CharacterState;
// The speed when walking
var walkSpeed = 2.0;
// after trotAfterSeconds of walking we trot with trotSpeed
var trotSpeed = 4.0;
// when pressing "Fire3" button (cmd) we start running
var runSpeed = 6.0;
var inAirControlAcceleration = 3.0;
// How high do we jump when pressing jump and letting go immediately
var jumpHeight = 0.5;
// The gravity for the character
var gravity = 20.0;
// The gravity in controlled descent mode
var speedSmoothing = 10.0;
var rotateSpeed = 500.0;
var trotAfterSeconds = 3.0;
var canJump = true;
private var jumpRepeatTime = 0.05;
private var jumpTimeout = 0.15;
private var groundedTimeout = 0.25;
// The camera doesnt start following the target immediately but waits for a split second to avoid too much waving around.
private var lockCameraTimer = 0.0;
// The current move direction in x-z
private var moveDirection = Vector3.zero;
// The current vertical speed
private var verticalSpeed = 0.0;
// The current x-z move speed
private var moveSpeed = 0.0;
// The last collision flags returned from controller.Move
private var collisionFlags : CollisionFlags;
// Are we jumping? (Initiated with jump button and not grounded yet)
private var jumping = false;
private var jumpingReachedApex = false;
// Are we moving backwards (This locks the camera to not do a 180 degree spin)
private var movingBack = false;
// Is the user pressing any keys?
private var isMoving = false;
// When did the user start walking (Used for going into trot after a while)
private var walkTimeStart = 0.0;
// Last time the jump button was clicked down
private var lastJumpButtonTime = -10.0;
// Last time we performed a jump
private var lastJumpTime = -1.0;
// the height we jumped from (Used to determine for how long to apply extra jump power after jumping.)
private var lastJumpStartHeight = 0.0;
private var inAirVelocity = Vector3.zero;
private var lastGroundedTime = 0.0;
private var isControllable = true;
function Awake ()
{
moveDirection = transform.TransformDirection(Vector3.forward);
_animation = GetComponent(Animation);
if(!_animation)
Debug.Log("The character you would like to control doesn't have animations. Moving her might look weird.");
/*
public var idleAnimation : AnimationClip;
public var walkAnimation : AnimationClip;
public var runAnimation : AnimationClip;
public var jumpPoseAnimation : AnimationClip;
*/
if(!idleAnimation) {
_animation = null;
Debug.Log("No idle animation found. Turning off animations.");
}
if(!walkAnimation) {
_animation = null;
Debug.Log("No walk animation found. Turning off animations.");
}
if(!runAnimation) {
_animation = null;
Debug.Log("No run animation found. Turning off animations.");
}
if(!jumpPoseAnimation && canJump) {
_animation = null;
Debug.Log("No jump animation found and the character has canJump enabled. Turning off animations.");
}
}
function UpdateSmoothedMovementDirection ()
{
var cameraTransform = Camera.main.transform;
var grounded = IsGrounded();
// Forward vector relative to the camera along the x-z plane
var forward = cameraTransform.TransformDirection(Vector3.forward);
forward.y = 0;
forward = forward.normalized;
// Right vector relative to the camera
// Always orthogonal to the forward vector
var right = Vector3(forward.z, 0, -forward.x);
var v = Input.GetAxisRaw("Vertical");
var h = Input.GetAxisRaw("Horizontal");
// Are we moving backwards or looking backwards
if (v < -0.2)
movingBack = true;
else
movingBack = false;
var wasMoving = isMoving;
isMoving = Mathf.Abs (h) > 0.1 || Mathf.Abs (v) > 0.1;
// Target direction relative to the camera
var targetDirection = h * right + v * forward;
// Grounded controls
if (grounded)
{
// Lock camera for short period when transitioning moving & standing still
lockCameraTimer += Time.deltaTime;
if (isMoving != wasMoving)
lockCameraTimer = 0.0;
// We store speed and direction seperately,
// so that when the character stands still we still have a valid forward direction
// moveDirection is always normalized, and we only update it if there is user input.
if (targetDirection != Vector3.zero)
{
// If we are really slow, just snap to the target direction
if (moveSpeed < walkSpeed * 0.9 && grounded)
{
moveDirection = targetDirection.normalized;
}
// Otherwise smoothly turn towards it
else
{
moveDirection = Vector3.RotateTowards(moveDirection, targetDirection, rotateSpeed * Mathf.Deg2Rad * Time.deltaTime, 1000);
moveDirection = moveDirection.normalized;
}
}
// Smooth the speed based on the current target direction
var curSmooth = speedSmoothing * Time.deltaTime;
// Choose target speed
//* We want to support analog input but make sure you cant walk faster diagonally than just forward or sideways
var targetSpeed = Mathf.Min(targetDirection.magnitude, 1.0);
_characterState = CharacterState.Idle;
// Pick speed modifier
if (Input.GetKey (KeyCode.LeftShift) || Input.GetKey (KeyCode.RightShift))
{
targetSpeed *= runSpeed;
_characterState = CharacterState.Running;
}
else if (Time.time - trotAfterSeconds > walkTimeStart)
{
targetSpeed *= trotSpeed;
_characterState = CharacterState.Trotting;
}
else
{
targetSpeed *= walkSpeed;
_characterState = CharacterState.Walking;
}
moveSpeed = Mathf.Lerp(moveSpeed, targetSpeed, curSmooth);
// Reset walk time start when we slow down
if (moveSpeed < walkSpeed * 0.3)
walkTimeStart = Time.time;
}
// In air controls
else
{
// Lock camera while in air
if (jumping)
lockCameraTimer = 0.0;
if (isMoving)
inAirVelocity += targetDirection.normalized * Time.deltaTime * inAirControlAcceleration;
}
}
function ApplyJumping ()
{
// Prevent jumping too fast after each other
if (lastJumpTime + jumpRepeatTime > Time.time)
return;
if (IsGrounded()) {
// Jump
// - Only when pressing the button down
// - With a timeout so you can press the button slightly before landing
if (canJump && Time.time < lastJumpButtonTime + jumpTimeout) {
verticalSpeed = CalculateJumpVerticalSpeed (jumpHeight);
SendMessage("DidJump", SendMessageOptions.DontRequireReceiver);
}
}
}
function ApplyGravity ()
{
if (isControllable) // don't move player at all if not controllable.
{
// Apply gravity
var jumpButton = Input.GetButton("Jump");
// When we reach the apex of the jump we send out a message
if (jumping && !jumpingReachedApex && verticalSpeed <= 0.0)
{
jumpingReachedApex = true;
SendMessage("DidJumpReachApex", SendMessageOptions.DontRequireReceiver);
}
if (IsGrounded ())
verticalSpeed = 0.0;
else
verticalSpeed -= gravity * Time.deltaTime;
}
}
function CalculateJumpVerticalSpeed (targetJumpHeight : float)
{
// From the jump height and gravity we deduce the upwards speed
// for the character to reach at the apex.
return Mathf.Sqrt(2 * targetJumpHeight * gravity);
}
function DidJump ()
{
jumping = true;
jumpingReachedApex = false;
lastJumpTime = Time.time;
lastJumpStartHeight = transform.position.y;
lastJumpButtonTime = -10;
_characterState = CharacterState.Jumping;
}
function Update() {
if (!isControllable)
{
// kill all inputs if not controllable.
Input.ResetInputAxes();
}
if (Input.GetButtonDown ("Jump"))
{
lastJumpButtonTime = Time.time;
}
UpdateSmoothedMovementDirection();
// Apply gravity
// - extra power jump modifies gravity
// - controlledDescent mode modifies gravity
ApplyGravity ();
// Apply jumping logic
ApplyJumping ();
// Calculate actual motion
var movement = moveDirection * moveSpeed + Vector3 (0, verticalSpeed, 0) + inAirVelocity;
movement *= Time.deltaTime;
// Move the controller
var controller : CharacterController = GetComponent(CharacterController);
collisionFlags = controller.Move(movement);
// ANIMATION sector
if(_animation) {
if(_characterState == CharacterState.Jumping)
{
if(!jumpingReachedApex) {
_animation[jumpPoseAnimation.name].speed = jumpAnimationSpeed;
_animation[jumpPoseAnimation.name].wrapMode = WrapMode.ClampForever;
_animation.CrossFade(jumpPoseAnimation.name);
} else {
_animation[jumpPoseAnimation.name].speed = -landAnimationSpeed;
_animation[jumpPoseAnimation.name].wrapMode = WrapMode.ClampForever;
_animation.CrossFade(jumpPoseAnimation.name);
}
}
else
{
if(controller.velocity.sqrMagnitude < 0.1) {
_animation.CrossFade(idleAnimation.name);
}
else
{
if(_characterState == CharacterState.Running) {
_animation[runAnimation.name].speed = Mathf.Clamp(controller.velocity.magnitude, 0.0, runMaxAnimationSpeed);
_animation.CrossFade(runAnimation.name);
}
else if(_characterState == CharacterState.Trotting) {
_animation[walkAnimation.name].speed = Mathf.Clamp(controller.velocity.magnitude, 0.0, trotMaxAnimationSpeed);
_animation.CrossFade(walkAnimation.name);
}
else if(_characterState == CharacterState.Walking) {
_animation[walkAnimation.name].speed = Mathf.Clamp(controller.velocity.magnitude, 0.0, walkMaxAnimationSpeed);
_animation.CrossFade(walkAnimation.name);
}
}
}
}
// ANIMATION sector
// Set rotation to the move direction
if (IsGrounded())
{
transform.rotation = Quaternion.LookRotation(moveDirection);
}
else
{
var xzMove = movement;
xzMove.y = 0;
if (xzMove.sqrMagnitude > 0.001)
{
transform.rotation = Quaternion.LookRotation(xzMove);
}
}
// We are in jump mode but just became grounded
if (IsGrounded())
{
lastGroundedTime = Time.time;
inAirVelocity = Vector3.zero;
if (jumping)
{
jumping = false;
SendMessage("DidLand", SendMessageOptions.DontRequireReceiver);
}
}
}
function OnControllerColliderHit (hit : ControllerColliderHit )
{
// Debug.DrawRay(hit.point, hit.normal);
if (hit.moveDirection.y > 0.01)
return;
}
function GetSpeed () {
return moveSpeed;
}
function IsJumping () {
return jumping;
}
function IsGrounded () {
return (collisionFlags & CollisionFlags.CollidedBelow) != 0;
}
function GetDirection () {
return moveDirection;
}
function IsMovingBackwards () {
return movingBack;
}
function GetLockCameraTimer ()
{
return lockCameraTimer;
}
function IsMoving () : boolean
{
return Mathf.Abs(Input.GetAxisRaw("Vertical")) + Mathf.Abs(Input.GetAxisRaw("Horizontal")) > 0.5;
}
function HasJumpReachedApex ()
{
return jumpingReachedApex;
}
function IsGroundedWithTimeout ()
{
return lastGroundedTime + groundedTimeout > Time.time;
}
function Reset ()
{
gameObject.tag = "Player";
}

View File

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

View File

@@ -0,0 +1,869 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
SceneSettings:
m_ObjectHideFlags: 0
m_PVSData:
m_PVSObjectsArray: []
m_PVSPortalsArray: []
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44525063, g: 0.49485004, b: 0.5738951, a: 1}
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 4
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_DirectLightInLightProbes: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 1024
m_ReflectionCompression: 2
m_LightingDataAsset: {fileID: 0}
m_RuntimeCPUUsage: 25
--- !u!196 &5
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
accuratePlacement: 0
minRegionArea: 2
cellSize: 0.16666667
manualCellSize: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &347288839
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100000, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_PrefabInternal: {fileID: 1101579462}
serializedVersion: 4
m_Component:
- 4: {fileID: 347288840}
- 33: {fileID: 347288842}
- 23: {fileID: 347288841}
m_Layer: 0
m_Name: Graphics
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &347288840
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 400000, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 347288839}
m_LocalRotation: {x: -0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.4, y: 0.5, z: 0.4}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 1476358478}
m_RootOrder: 0
--- !u!23 &347288841
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 2300000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 347288839}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedWireframeHidden: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &347288842
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 3300000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 347288839}
m_Mesh: {fileID: 10205, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &537433168
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 537433170}
- 114: {fileID: 537433173}
- 82: {fileID: 537433169}
- 33: {fileID: 537433172}
- 23: {fileID: 537433171}
- 64: {fileID: 537433174}
m_Layer: 0
m_Name: SpatializedSound1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!82 &537433169
AudioSource:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 537433168}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 24300001, guid: 1dd706bb85d8aef4e83a6229dbd62c36,
type: 2}
m_audioClip: {fileID: 8300000, guid: 1340d7fb0cd1bfb4caa3b3270cb2ea5f, type: 3}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 1
Mute: 0
Spatialize: 1
Priority: 128
DopplerLevel: 0
MinDistance: 1
MaxDistance: 100
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 0.24404761
value: 1.1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!4 &537433170
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 537433168}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
--- !u!23 &537433171
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 537433168}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 584662273d60a0f47bd7fecbb570e66e, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedWireframeHidden: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &537433172
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 537433168}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!114 &537433173
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 537433168}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bb001ad917b86f148a2c85acdd0d5c6a, type: 3}
m_Name:
m_EditorClassIdentifier:
useVirtualSpeakers: 0
--- !u!64 &537433174
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 537433168}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &874827679
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 874827683}
- 33: {fileID: 874827682}
- 64: {fileID: 874827681}
- 23: {fileID: 874827680}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &874827680
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 874827679}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: e121bf11a9143914dbafa9e733415f2a, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedWireframeHidden: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!64 &874827681
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 874827679}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &874827682
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 874827679}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &874827683
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 874827679}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -2.64, z: 0}
m_LocalScale: {x: 39.853504, y: 39.85354, z: 39.85354}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
--- !u!1 &1004090725
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1004090727}
- 114: {fileID: 1004090726}
m_Layer: 0
m_Name: ONSP VERSION
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1004090726
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1004090725}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 46821b10458428648878b1b4a9113c40, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1004090727
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1004090725}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
--- !u!1001 &1101579462
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_LocalPosition.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_LocalPosition.y
value: -1.682
objectReference: {fileID: 0}
- target: {fileID: 400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_LocalPosition.z
value: -5
objectReference: {fileID: 0}
- target: {fileID: 400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2000000, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_ClearFlags
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2000000, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_BackGroundColor.r
value: .261948526
objectReference: {fileID: 0}
- target: {fileID: 2000000, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_BackGroundColor.g
value: .403528422
objectReference: {fileID: 0}
- target: {fileID: 2000000, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_BackGroundColor.b
value: .625
objectReference: {fileID: 0}
- target: {fileID: 100002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 14300000, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400004, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400006, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: movement.maxForwardSpeed
value: 3
objectReference: {fileID: 0}
- target: {fileID: 11400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: movement.maxBackwardsSpeed
value: 3
objectReference: {fileID: 0}
- target: {fileID: 11400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
propertyPath: movement.maxSidewaysSpeed
value: 3
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_RootGameObject: {fileID: 1476358473}
m_IsPrefabParent: 0
--- !u!1 &1149557338
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1149557340}
- 108: {fileID: 1149557339}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1149557339
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1149557338}
m_Enabled: 1
serializedVersion: 7
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1149557340
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1149557338}
m_LocalRotation: {x: 0.19034514, y: -0.41780472, z: 0.7921693, w: 0.40208936}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
--- !u!1 &1476358473
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_PrefabInternal: {fileID: 1101579462}
serializedVersion: 4
m_Component:
- 4: {fileID: 1476358478}
- 143: {fileID: 1476358477}
- 114: {fileID: 1476358476}
- 114: {fileID: 1476358475}
- 114: {fileID: 1476358474}
m_Layer: 0
m_Name: First Person Controller
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1476358474
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11400004, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1476358473}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 60bca8f58a0b8478e946e6e86658cb29, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1476358475
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11400002, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1476358473}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ab79d7f243824f5d9826bd83522c8df, type: 3}
m_Name:
m_EditorClassIdentifier:
canControl: 1
useFixedUpdate: 1
movement:
maxForwardSpeed: 3
maxSidewaysSpeed: 3
maxBackwardsSpeed: 3
slopeSpeedMultiplier:
serializedVersion: 2
m_Curve:
- time: -90
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- time: 90
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
maxGroundAcceleration: 20
maxAirAcceleration: 15
gravity: 20
maxFallSpeed: 20
jumping:
enabled: 1
baseHeight: 1
extraHeight: 1
perpAmount: 0
steepPerpAmount: 0.5
movingPlatform:
enabled: 1
movementTransfer: 2
sliding:
enabled: 1
slidingSpeed: 10
sidewaysControl: 1
speedControl: 0.4
--- !u!114 &1476358476
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11400000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1476358473}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68ec2fe99d1108b9d0006a298d76c639, type: 3}
m_Name:
m_EditorClassIdentifier:
axes: 1
sensitivityX: 15
sensitivityY: 0
minimumX: -360
maximumX: 360
minimumY: 0
maximumY: 0
--- !u!143 &1476358477
CharacterController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 14300000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1476358473}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Height: 2
m_Radius: 0.4
m_SlopeLimit: 45
m_StepOffset: 0.4
m_SkinWidth: 0.05
m_MinMoveDistance: 0
m_Center: {x: 0, y: 0, z: 0}
--- !u!4 &1476358478
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 400002, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1476358473}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0, y: -1.682, z: -5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 347288840}
- {fileID: 1926090764}
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1 &1926090763
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100004, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_PrefabInternal: {fileID: 1101579462}
serializedVersion: 4
m_Component:
- 4: {fileID: 1926090764}
- 20: {fileID: 1926090769}
- 92: {fileID: 1926090768}
- 124: {fileID: 1926090767}
- 114: {fileID: 1926090766}
- 81: {fileID: 1926090765}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1926090764
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 400004, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1926090763}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.9070835, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 1476358478}
m_RootOrder: 1
--- !u!81 &1926090765
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 8100000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1926090763}
m_Enabled: 1
--- !u!114 &1926090766
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11400006, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1926090763}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 68ec2fe99d1108b9d0006a298d76c639, type: 3}
m_Name:
m_EditorClassIdentifier:
axes: 2
sensitivityX: 10
sensitivityY: 10
minimumX: 0
maximumX: 360
minimumY: -60
maximumY: 60
--- !u!124 &1926090767
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 12400000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1926090763}
m_Enabled: 1
--- !u!92 &1926090768
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 9200000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1926090763}
m_Enabled: 1
--- !u!20 &1926090769
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 2000000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 1101579462}
m_GameObject: {fileID: 1926090763}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.26194853, g: 0.40352842, b: 0.625, a: 1}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 100
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c8a4434d7a298684fae176a7751d45a7
timeCreated: 1493326122
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 043c69ee822544cd18609a101bac4b55
folderAsset: yes
timeCreated: 1424053971
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,128 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: AmbisonicObject1
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHABLEND_ON _EMISSION
m_LightmapFlags: 1
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 10
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 2
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 5
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 0
m_Colors:
- first:
name: _Color
second: {r: 0.90344834, g: 1, b: 0, a: 0.78431374}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 584662273d60a0f47bd7fecbb570e66e
timeCreated: 1479162313
licenseType: Store
NativeFormatImporter:
mainObjectFileID: -1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,138 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Ground
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Cutoff
second: .5
data:
first:
name: _Parallax
second: .0199999996
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: .416000009
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: .317999989
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Color
second: {r: .0288062226, g: .132352948, b: .00291955308, a: 1}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: e121bf11a9143914dbafa9e733415f2a
timeCreated: 1440788967
licenseType: Store
NativeFormatImporter:
mainObjectFileID: -1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,128 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: SpatializedObject1
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHABLEND_ON _EMISSION
m_LightmapFlags: 1
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 10
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 2
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 5
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 0
m_Colors:
- first:
name: _Color
second: {r: 0, g: 0.75735295, b: 0.13057812, a: 0.78431374}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6498d4298a35c5c44894b5f194468896
timeCreated: 1440787665
licenseType: Store
NativeFormatImporter:
mainObjectFileID: -1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,128 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: SpatializedObject2
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHABLEND_ON _EMISSION
m_LightmapFlags: 1
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 10
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 2
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 5
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 0
m_Colors:
- first:
name: _Color
second: {r: 1, g: 0, b: 0, a: 0.78431374}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f54ef0e328359c14b9005f8a48cbd66b
timeCreated: 1441987536
licenseType: Store
NativeFormatImporter:
mainObjectFileID: -1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a7a0ebb37fd844daca2d9ca3b56db8ee
folderAsset: yes
timeCreated: 1424053917
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,364 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!241 &24100000
AudioMixerController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: SpatializerMixer
m_OutputGroup: {fileID: 0}
m_MasterGroup: {fileID: 24300001}
m_Snapshots:
- {fileID: 24500003}
- {fileID: 245000012928175524}
m_StartSnapshot: {fileID: 24500003}
m_SuspendThreshold: -80
m_EnableSuspend: 1
m_UpdateMode: 0
m_ExposedParameters: []
m_AudioMixerGroupViews:
- guids:
- 725e77d6ee2433b4388bc90340f64b61
name: View
m_CurrentViewIndex: 0
m_TargetSnapshot: {fileID: 24500003}
--- !u!243 &24300001
AudioMixerGroupController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Master
m_AudioMixer: {fileID: 24100000}
m_GroupID: 725e77d6ee2433b4388bc90340f64b61
m_Children: []
m_Volume: 0658889d5c88bf940b82d78b8d39562e
m_Pitch: 0d4bed6fb113d6f4089b817171a98447
m_Effects:
- {fileID: 24400002}
- {fileID: 24482754}
m_UserColorIndex: 0
m_Mute: 0
m_Solo: 0
m_BypassEffects: 0
--- !u!244 &24400002
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_EffectID: 42ec3f1ef4a750c4386011c7d2e2a267
m_EffectName: Attenuation
m_MixLevel: 82be81869b5ac364d99ce3b2ff1803b2
m_Parameters: []
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!244 &24482754
AudioMixerEffectController:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
m_EffectID: 1d0f44df94bc52146b502b66296662ae
m_EffectName: OculusSpatializerReflection
m_MixLevel: a5b6bd72526f2e44ab339b0cad35a895
m_Parameters:
- m_ParameterName: E.Rflt On
m_GUID: c37752d75bf132d47a7c3a93049722dc
- m_ParameterName: E.Rflt Rev On
m_GUID: f4fa4509dbcb99d46a3b47fb214a8e04
- m_ParameterName: Room X
m_GUID: 79190f1e429424246b6ff46577611745
- m_ParameterName: Room Y
m_GUID: 5cbf6ddbb7026dc45abe06cc43322e1c
- m_ParameterName: Room Z
m_GUID: 9760f1cc98e9dd54d9700864efe2f90a
- m_ParameterName: Left
m_GUID: c8aaa722d4ec4154bba4febdb24cb6a9
- m_ParameterName: Right
m_GUID: a7822f794e8835b44b5d97b299e90829
- m_ParameterName: Up
m_GUID: aff67efc612d61b469184c39ea2c6339
- m_ParameterName: Down
m_GUID: eedb6e2560b96954f80a6216a070957a
- m_ParameterName: Behind
m_GUID: f00e9382c178ba74091552a02191a248
- m_ParameterName: Front
m_GUID: aca764e9e8594ad4e82b73de0b803e6c
- m_ParameterName: GScale
m_GUID: 0a3224836f36e1a40a4ede80f5080595
- m_ParameterName: Shared Rev Max
m_GUID: d3e2b68513d653740a78c0c9c694e7c7
- m_ParameterName: Shared Rev Min
m_GUID: f55c0bb461c06f4419674ef5c9fa9953
m_SendTarget: {fileID: 0}
m_EnableWetMix: 0
m_Bypass: 0
--- !u!245 &24500003
AudioMixerSnapshotController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Snapshot Init
m_AudioMixer: {fileID: 24100000}
m_SnapshotID: a069d6b9a45325b43b6121c1de0b82fa
m_FloatValues:
9d315510bbbe3234f81f9ab55034eb95: 0.025578512
58c9ed10d34cdd24f96279ad753b5c44: 0
49ea3420a4d17de47999009a7def04ef: 138
649ec8308d11398408f8b4edb4a345a0: 106
cca26b403b997104bad4d1d8f7dca261: 140
db11616008472904e881c76426b068d3: 140
fcdca8708d2305f4593057c665f57be1: 0.438
67b81af0af5f7a642ae9a80222f7abdf: 0.01
48c4bbf0ea921c74c9fa6d520bee6afd: 0
4b21d1410309db948974e02993ffec79: 0.97
6392c38197012994ca13ff3d1d09933e: 0.155
2bff1f9125a0ac04aa2de5826f284cd1: 0.538
762f1bc1189ebbb4d826c6561132b46c: 0.38
bd705ee11343600419ecb19a2ba1b040: 0.36
eb9b8ff14fcb5f9488c715e2970b3b22: 0
f7aab8027052a8e4bbbbfa3e10f77076: 1
54a32c12472920747aadc169fc459833: 0.353
c8aaa722d4ec4154bba4febdb24cb6a9: 0.5
5873537254a301f4ea13ed21b0eff333: 0.512
f00e9382c178ba74091552a02191a248: 0.5
58edbc339fee35e4396568ee4b4453de: 0.92
ccd919438ea41b84a8839e71f708afbb: 0.336
0a3224836f36e1a40a4ede80f5080595: 1
d65515935f752c649a20a13490f2f9e0: 0
03939eb341cc86440a3b7f811113cd27: 0.385
2cf715c32cf694e4d977b3798f5f8bb2: 90
d2fdf2145b59fee4595a326c28abd184: 0
de1b983492eda6c47b6ef47105b52dda: 0.97
2e7f0254e7d38fd4eb3152ed5ccbaf19: 120
820d8864a3100854b99c649ce38e7f1c: 1
017e1c84d5ff649438cf7217f015a04f: 100
f55c0bb461c06f4419674ef5c9fa9953: 1
229fbec47d0de58408d0541ea2fa4c0e: 1.17
c04dfb256afb48d499bb4540ed5265bb: 0.696
eedb6e2560b96954f80a6216a070957a: 0.4
c6d3fa55e85ddbe489d20e1e07efba6f: 0.97
d046de7513d8e0b4fa166ea7382ecdaf: 0.511
d3e2b68513d653740a78c0c9c694e7c7: 100
5f0898855add70243aa14b3ea2677074: 1
01578495ccbabed42984621c044e5d72: 0.97
77d987a5a23fe9f40bc2a0ef32d60de5: 122
bd33a706336bb6742960b31b56d6d312: 0
70fb34464dced4d4fa0fcbc0a9bbcb03: 104
fd57dbc6c9ab56441b50cb4ec452b383: 0.5
0b9824d66b0abf64f9c881b46383bcc5: 157
f5d601f6a1282e848b1945fd6c7c37a6: 0.512
e25db507e301b004f861dc06d09175f4: 130
1a8948470036df943be2b94d699cf4e9: 95
285e7a478d90a1f4ea39bf4e24e02ebf: 3.2656894
afbfe0879e482b64b9dd4ceeeed82492: 0.33
ae6a7db7773ab66468e20795efab2e3e: 43
c37752d75bf132d47a7c3a93049722dc: 1
74df97f7555fd2241a41f845aa8c4d21: 0.353
d26a4918d633cb54fbd7a5b40efe1639: 0.045
bf51ba384a3c1f646a631feb6aed6c54: 114
0f0fba6804dba4c4cb19fd30e1223afb: 2.87
f4fa4509dbcb99d46a3b47fb214a8e04: 1
56c841194b2fe3040b48cf98706d6e73: 0
7413dd197ffb07340850468b31fcf1e0: 0.79
36b1ac29e76462c4586c397a65308888: 0.5
0417fc59ebc9a8546aeb76cabfc63779: 144
d06ca37942b78cc4bb681d13d04fd13f: 0
b8c78c79da9dc7647b11bfb614405d3a: 119
a7822f794e8835b44b5d97b299e90829: 0.5
528077a94b0c9414ebb8e893ec848cb5: 3.55
77747ac9fbec3bd4ea88da457cdb9929: 0.388
bac2bbc985be64f40b41721b00cd60b6: 1
aca764e9e8594ad4e82b73de0b803e6c: 0.5
ea845bf95b8ca3643b1e02f7eb395c20: 124
15ef323a36019924ca28f74bdd24e24c: 0
686ebe5a2690c5e479c8116b11041079: 0
4b58a99a50aafe74793b5dd2bedb0a96: 0.064
81eebcba61cc4d94bbc3e7c351b3cf37: 0
333585ca979bacf4eba5c4fee2741c4b: 0.273
cad86ecad0994a1468302748ea994d5c: 111
ddb13ffa06835ba45a05d6ccf101ba05: 139
bb163b3baa1705545a7c704ec4ac0c7b: 0
7c75d04b0f5050a48925a908ea48051c: 0.441
db3eaa4b3a4d9364eb3994f66a47b51a: 0
1c5e237b02d4533429539a0a6df19853: 0
d887dc8b995a9174aab8c8b0de3b0733: 0.97
fe36acab8a96d0046bafeb9e18a753df: 0.073
34546ccb2e240cd48bcca671564120ce: 0
5cbf6ddbb7026dc45abe06cc43322e1c: 3
cc132edbccace48469977b60edca52a5: 0.447
4cff19eb609afd84992763e1020b8181: 1
a7077ffb091b65b4dbcb5026128b2c5e: -25
c6cc7e2c3e902d94abdabdddc5a41800: 1
2883db3c75b4127489b7549dabc871af: 0.67
8998a24c4360c93478ec02f063d9b337: 0
1033165c48652b34db906f50dde24a50: 0.571
4a67b18c35650444b90dc3f572846173: 200
917c2e9cef00f3442b1165a1fda7d72a: 0.55
9760f1cc98e9dd54d9700864efe2f90a: 5
d779d8cc83e43cc4592a9ba5ce40cb9e: 0.415
447f4ecc9e3c96c4582c34dfc66436ae: 0
6dc37decaec0c0f468ba6c1fb4f95ebf: 50
aff67efc612d61b469184c39ea2c6339: 0.2
5168eefc6d05f3d4d802a585308e8b67: 0.588
7812eb7d1a7bba747868c3abff847dac: 0.538
983c698dea217524c994e7b88f25df7d: 1
ea47e49d533c4a149a56cf186a4119eb: 110
0658889d5c88bf940b82d78b8d39562e: 0
285a82bdfd80bae41b75462603f13baf: 0
72def6bd2a38a944ead357650153b6b3: 0.441
da2a1bdd1018dc54ebb2bf2349fbd8c8: 0.07
e431e5ed060aa204c9ba5678db126270: 0.388
3edd2aed8cd157048a7717f3d32caba1: 0.97
79190f1e429424246b6ff46577611745: 8
9cf1f33e7b3d84e40a784d007dfb6bbc: 0.72
6c1fab5e5d70dbf47a590880e58bedf2: 0.52
72e6fc6e91bd9c6438d9497c5c20f087: 97
3f673d6ec3ebc7040aaabfb340a480ba: 2.0025296
06e1389e10711584e98e63bcabbba3a4: 0.418
cad173aee6b7e8c45ac30f9cc5e32b2c: 0
b3b0eede46f5b304ba700843076db719: 0.209
141e6fde7f4d66a4d9ce1878b64dc199: -28
b1ed842f163fcae4989e68a530e081fd: 0.47
1b16bf2faec4ce249a80ce7b9f1346bd: 0.406
96bb113f992376e479fa8b09b724413d: 0.696
29b9835ff985b2e4c97d9e4ee57e84b1: 0.415
7ccabb5f18fe7824da14df39f37a68ec: 72
0d4bed6fb113d6f4089b817171a98447: 1
d90c93cfc45013545b3760e70f40dd9c: 0.65
m_TransitionOverrides: {}
--- !u!245 &245000012928175524
AudioMixerSnapshotController:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Snapshot Interior
m_AudioMixer: {fileID: 24100000}
m_SnapshotID: 06ac7339e485edb4182863286808e1fd
m_FloatValues:
9d315510bbbe3234f81f9ab55034eb95: 0.025578512
58c9ed10d34cdd24f96279ad753b5c44: 0
49ea3420a4d17de47999009a7def04ef: 138
649ec8308d11398408f8b4edb4a345a0: 106
cca26b403b997104bad4d1d8f7dca261: 140
db11616008472904e881c76426b068d3: 140
fcdca8708d2305f4593057c665f57be1: 0.438
67b81af0af5f7a642ae9a80222f7abdf: 0.01
48c4bbf0ea921c74c9fa6d520bee6afd: 0
4b21d1410309db948974e02993ffec79: 0.97
6392c38197012994ca13ff3d1d09933e: 0.155
2bff1f9125a0ac04aa2de5826f284cd1: 0.538
762f1bc1189ebbb4d826c6561132b46c: 0.38
bd705ee11343600419ecb19a2ba1b040: 0.36
eb9b8ff14fcb5f9488c715e2970b3b22: 0
f7aab8027052a8e4bbbbfa3e10f77076: 1
54a32c12472920747aadc169fc459833: 0.353
c8aaa722d4ec4154bba4febdb24cb6a9: 0.857
5873537254a301f4ea13ed21b0eff333: 0.512
f00e9382c178ba74091552a02191a248: 0.768
58edbc339fee35e4396568ee4b4453de: 0.92
ccd919438ea41b84a8839e71f708afbb: 0.336
0a3224836f36e1a40a4ede80f5080595: 1
d65515935f752c649a20a13490f2f9e0: 0
03939eb341cc86440a3b7f811113cd27: 0.385
2cf715c32cf694e4d977b3798f5f8bb2: 90
d2fdf2145b59fee4595a326c28abd184: 0
de1b983492eda6c47b6ef47105b52dda: 0.97
2e7f0254e7d38fd4eb3152ed5ccbaf19: 120
820d8864a3100854b99c649ce38e7f1c: 1
017e1c84d5ff649438cf7217f015a04f: 100
f55c0bb461c06f4419674ef5c9fa9953: 1
229fbec47d0de58408d0541ea2fa4c0e: 1.17
c04dfb256afb48d499bb4540ed5265bb: 0.696
eedb6e2560b96954f80a6216a070957a: 0.908
c6d3fa55e85ddbe489d20e1e07efba6f: 0.97
d046de7513d8e0b4fa166ea7382ecdaf: 0.511
d3e2b68513d653740a78c0c9c694e7c7: 1
5f0898855add70243aa14b3ea2677074: 1
01578495ccbabed42984621c044e5d72: 0.97
77d987a5a23fe9f40bc2a0ef32d60de5: 122
bd33a706336bb6742960b31b56d6d312: 0
70fb34464dced4d4fa0fcbc0a9bbcb03: 104
fd57dbc6c9ab56441b50cb4ec452b383: 0.5
0b9824d66b0abf64f9c881b46383bcc5: 157
f5d601f6a1282e848b1945fd6c7c37a6: 0.512
e25db507e301b004f861dc06d09175f4: 130
1a8948470036df943be2b94d699cf4e9: 95
285e7a478d90a1f4ea39bf4e24e02ebf: 3.2656894
afbfe0879e482b64b9dd4ceeeed82492: 0.33
ae6a7db7773ab66468e20795efab2e3e: 43
c37752d75bf132d47a7c3a93049722dc: 1
74df97f7555fd2241a41f845aa8c4d21: 0.353
d26a4918d633cb54fbd7a5b40efe1639: 0.045
bf51ba384a3c1f646a631feb6aed6c54: 114
0f0fba6804dba4c4cb19fd30e1223afb: 2.87
f4fa4509dbcb99d46a3b47fb214a8e04: 0
56c841194b2fe3040b48cf98706d6e73: 0
7413dd197ffb07340850468b31fcf1e0: 0.79
36b1ac29e76462c4586c397a65308888: 0.5
0417fc59ebc9a8546aeb76cabfc63779: 144
d06ca37942b78cc4bb681d13d04fd13f: 0
b8c78c79da9dc7647b11bfb614405d3a: 119
a7822f794e8835b44b5d97b299e90829: 0.682
528077a94b0c9414ebb8e893ec848cb5: 3.55
77747ac9fbec3bd4ea88da457cdb9929: 0.388
bac2bbc985be64f40b41721b00cd60b6: 1
aca764e9e8594ad4e82b73de0b803e6c: 0.718
ea845bf95b8ca3643b1e02f7eb395c20: 124
15ef323a36019924ca28f74bdd24e24c: 0
686ebe5a2690c5e479c8116b11041079: 0
4b58a99a50aafe74793b5dd2bedb0a96: 0.064
81eebcba61cc4d94bbc3e7c351b3cf37: 0
333585ca979bacf4eba5c4fee2741c4b: 0.273
cad86ecad0994a1468302748ea994d5c: 111
ddb13ffa06835ba45a05d6ccf101ba05: 139
bb163b3baa1705545a7c704ec4ac0c7b: 0
7c75d04b0f5050a48925a908ea48051c: 0.441
db3eaa4b3a4d9364eb3994f66a47b51a: 0
1c5e237b02d4533429539a0a6df19853: 0
d887dc8b995a9174aab8c8b0de3b0733: 0.97
fe36acab8a96d0046bafeb9e18a753df: 0.073
34546ccb2e240cd48bcca671564120ce: 0
5cbf6ddbb7026dc45abe06cc43322e1c: 68
cc132edbccace48469977b60edca52a5: 0.447
4cff19eb609afd84992763e1020b8181: 1
a7077ffb091b65b4dbcb5026128b2c5e: -25
c6cc7e2c3e902d94abdabdddc5a41800: 1
2883db3c75b4127489b7549dabc871af: 0.67
8998a24c4360c93478ec02f063d9b337: 0
1033165c48652b34db906f50dde24a50: 0.571
4a67b18c35650444b90dc3f572846173: 200
917c2e9cef00f3442b1165a1fda7d72a: 0.55
9760f1cc98e9dd54d9700864efe2f90a: 70
d779d8cc83e43cc4592a9ba5ce40cb9e: 0.415
447f4ecc9e3c96c4582c34dfc66436ae: 0
6dc37decaec0c0f468ba6c1fb4f95ebf: 50
aff67efc612d61b469184c39ea2c6339: 0.762
5168eefc6d05f3d4d802a585308e8b67: 0.588
7812eb7d1a7bba747868c3abff847dac: 0.538
983c698dea217524c994e7b88f25df7d: 1
ea47e49d533c4a149a56cf186a4119eb: 110
0658889d5c88bf940b82d78b8d39562e: 0
285a82bdfd80bae41b75462603f13baf: 0
72def6bd2a38a944ead357650153b6b3: 0.441
da2a1bdd1018dc54ebb2bf2349fbd8c8: 0.07
e431e5ed060aa204c9ba5678db126270: 0.388
3edd2aed8cd157048a7717f3d32caba1: 0.97
79190f1e429424246b6ff46577611745: 1
9cf1f33e7b3d84e40a784d007dfb6bbc: 0.72
6c1fab5e5d70dbf47a590880e58bedf2: 0.52
72e6fc6e91bd9c6438d9497c5c20f087: 97
3f673d6ec3ebc7040aaabfb340a480ba: 2.0025296
06e1389e10711584e98e63bcabbba3a4: 0.418
cad173aee6b7e8c45ac30f9cc5e32b2c: 0
b3b0eede46f5b304ba700843076db719: 0.209
141e6fde7f4d66a4d9ce1878b64dc199: -28
b1ed842f163fcae4989e68a530e081fd: 0.47
1b16bf2faec4ce249a80ce7b9f1346bd: 0.406
96bb113f992376e479fa8b09b724413d: 0.696
29b9835ff985b2e4c97d9e4ee57e84b1: 0.415
7ccabb5f18fe7824da14df39f37a68ec: 72
0d4bed6fb113d6f4089b817171a98447: 1
d90c93cfc45013545b3760e70f40dd9c: 0.65
m_TransitionOverrides: {}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1dd706bb85d8aef4e83a6229dbd62c36
timeCreated: 1440786022
licenseType: Store
NativeFormatImporter:
mainObjectFileID: -1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b5d8866648b1d45d2bc312b463c14345
folderAsset: yes
timeCreated: 1424053923
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 1340d7fb0cd1bfb4caa3b3270cb2ea5f
timeCreated: 1479409279
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 354c37cd61ec24bbcbbc7921d0a71bc1
timeCreated: 1424280968
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 3a4baf251c1814716b9458d036384a76
timeCreated: 1434610210
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 494bd1721199a40c5a79fa3011793556
timeCreated: 1424281508
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 37c9e69911022452a9ebd4ee732ab036
timeCreated: 1424661047
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 460d9a446cc128e4787c47d09d4af2bc
timeCreated: 1479495149
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 236da4b84bba246d283010b1b2dcf28a
timeCreated: 1434739439
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 197b6f9ffe1223343aa4672db3771875
timeCreated: 1443655172
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 2cfa96c21e4f54c20824bd26cd46c10f
timeCreated: 1424054227
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,20 @@
fileFormatVersion: 2
guid: f91d65267a08748519645f34d4358e48
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 1
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 0
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 33a0d552717ab4c2e87a77c856d9aaf3
timeCreated: 1423240920
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: a05d082cd207b4b12a47c089be8b7a62
timeCreated: 1434739439
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 51b022d9e2c54124eb2a24688675a7ee
folderAsset: yes
timeCreated: 1424053929
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,166 @@
/************************************************************************************
Filename : ONSPAmbisonicsNative.cs
Content : Native interface into the Oculus Ambisonics
Created : November 14, 2016
Authors : Peter Giokaris
Copyright : Copyright 2016 Oculus VR, Inc. All Rights reserved.
Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License");
you may not use the Oculus VR Rift SDK except in compliance with the License,
which is provided at the time of installation or download, or which
otherwise accompanies this software in either electronic or hard copy form.
You may obtain a copy of the License at
http://www.oculusvr.com/licenses/LICENSE-3.1
Unless required by applicable law or agreed to in writing, the Oculus VR SDK
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
************************************************************************************/
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class ONSPAmbisonicsNative : MonoBehaviour
{
#if !UNITY_5
static int numFOAChannels = 4; // we are only dealing with 1st order Ambisonics at this time
static int paramVSpeakerMode = 6; // set speaker mode (OculusAmbi or VSpeaker)
static int paramAmbiStat = 7; // use this to return internal Ambisonic status
// Staus codes that may return from Ambisonic engine
public enum ovrAmbisonicsNativeStatus
{
Uninitialized = -1, // Ambisonic stream not initialized (inital status)
NotEnabled, // Ambisonic has not been enabled on clip
Success, // Stream initialized and playing
StreamError, // Something wrong with input stream (not a 4-channel AmbiX format stream?)
ProcessError, // Handling of stream error
MaxStatValue
};
// current status
ovrAmbisonicsNativeStatus currentStatus = ovrAmbisonicsNativeStatus.Uninitialized;
// true to use Virtual Speaker output. Otherwise use OculusAmbi
[SerializeField]
private bool useVirtualSpeakers = false;
public bool UseVirtualSpeakers
{
get
{
return useVirtualSpeakers;
}
set
{
useVirtualSpeakers = value;
}
}
#endif
/// <summary>
/// OnEnable this instance.
/// </summary>
void OnEnable()
{
// Unity 4 is deprecated; UNITY_5 still valid with plug-in
#if UNITY_5
Debug.Log("Ambisonic ERROR: Ambisonic support in Unity 2017 or higher");
#else
AudioSource source = GetComponent<AudioSource>();
currentStatus = ovrAmbisonicsNativeStatus.Uninitialized;
if (source == null)
{
Debug.Log("Ambisonic ERROR: AudioSource does not exist.");
}
else
{
if(source.spatialize == true)
{
Debug.Log("Ambisonic WARNING: Turning spatialize field off for Ambisonic sources.");
source.spatialize = false;
}
if (source.clip == null)
{
Debug.Log("Ambisonic ERROR: AudioSource does not contain an audio clip.");
}
else
{
if(source.clip.channels != numFOAChannels)
{
Debug.Log("Ambisonic ERROR: AudioSource clip does not have correct number of channels.");
}
}
}
#endif
}
// Unity 4 is deprecated; UNITY_5 still valid with plug-in
#if !UNITY_5
/// <summary>
/// Update this instance.
/// </summary>
void Update()
{
AudioSource source = GetComponent<AudioSource>();
if (source == null)
{
// We already caught the error in Awake so bail
return;
}
// Set speaker mode
if(useVirtualSpeakers == true)
source.SetAmbisonicDecoderFloat(paramVSpeakerMode, 1.0f); // VSpeakerMode
else
source.SetAmbisonicDecoderFloat(paramVSpeakerMode, 0.0f); // OclusAmbi
float statusF = 0.0f;
// PGG 5/25/2017 There is a bug in the 2017.2 beta that does not
// allow for ambisonic params to be passed through to native
// from C# Get latest editor from Unity when available
source.GetAmbisonicDecoderFloat(paramAmbiStat, out statusF);
ovrAmbisonicsNativeStatus status = (ovrAmbisonicsNativeStatus)statusF;
// TODO: Add native result/error codes
if (status != currentStatus)
{
switch(status)
{
case (ovrAmbisonicsNativeStatus.NotEnabled):
Debug.Log("Ambisonic Native: Ambisonic not enabled on clip. Check clip field and turn it on");
break;
case (ovrAmbisonicsNativeStatus.Uninitialized):
Debug.Log("Ambisonic Native: Stream uninitialized");
break;
case (ovrAmbisonicsNativeStatus.Success):
Debug.Log("Ambisonic Native: Stream successfully initialized and playing/playable");
break;
case (ovrAmbisonicsNativeStatus.StreamError):
Debug.Log("Ambisonic Native WARNING: Stream error (bad input format?)");
break;
case (ovrAmbisonicsNativeStatus.ProcessError):
Debug.Log("Ambisonic Native WARNING: Stream process error (check default speaker setup)");
break;
default:
break;
}
}
currentStatus = status;
}
#endif
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: bb001ad917b86f148a2c85acdd0d5c6a
timeCreated: 1479161980
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,324 @@
/************************************************************************************
Filename : ONSPAudioSource.cs
Content : Interface into the Oculus Native Spatializer Plugin
Created : September 14, 2015
Authors : Peter Giokaris
Copyright : Copyright 2015 Oculus VR, Inc. All Rights reserved.
Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License");
you may not use the Oculus VR Rift SDK except in compliance with the License,
which is provided at the time of installation or download, or which
otherwise accompanies this software in either electronic or hard copy form.
You may obtain a copy of the License at
http://www.oculusvr.com/licenses/LICENSE-3.1
Unless required by applicable law or agreed to in writing, the Oculus VR SDK
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
************************************************************************************/
// Uncomment below to test access of read-only spatializer parameters
//#define TEST_READONLY_PARAMETERS
using UnityEngine;
using System;
using System.Collections;
using System.Runtime.InteropServices;
public class ONSPAudioSource : MonoBehaviour
{
#if TEST_READONLY_PARAMETERS
// Spatializer read-only system parameters (global)
static int readOnly_GlobalRelectionOn = 8;
static int readOnly_NumberOfUsedSpatializedVoices = 9;
#endif
// Import functions
public const string strONSPS = "AudioPluginOculusSpatializer";
[DllImport(strONSPS)]
private static extern void ONSP_GetGlobalRoomReflectionValues(ref bool reflOn, ref bool reverbOn,
ref float width, ref float height, ref float length);
// Public
[SerializeField]
private bool enableSpatialization = true;
public bool EnableSpatialization
{
get
{
return enableSpatialization;
}
set
{
enableSpatialization = value;
}
}
[SerializeField]
private float gain = 0.0f;
public float Gain
{
get
{
return gain;
}
set
{
gain = Mathf.Clamp(value, 0.0f, 24.0f);
}
}
[SerializeField]
private bool useInvSqr = false;
public bool UseInvSqr
{
get
{
return useInvSqr;
}
set
{
useInvSqr = value;
}
}
[SerializeField]
private float near = 1.0f;
public float Near
{
get
{
return near;
}
set
{
near = Mathf.Clamp(value, 0.0f, 1000000.0f);
}
}
[SerializeField]
private float far = 10.0f;
public float Far
{
get
{
return far;
}
set
{
far = Mathf.Clamp(value, 0.0f, 1000000.0f);
}
}
[SerializeField]
private float volumetricRadius = 0.0f;
public float VolumetricRadius
{
get
{
return volumetricRadius;
}
set
{
volumetricRadius = Mathf.Clamp(value, 0.0f, 1000.0f);
}
}
[SerializeField]
private bool enableRfl = false;
public bool EnableRfl
{
get
{
return enableRfl;
}
set
{
enableRfl = value;
}
}
/// <summary>
/// Awake this instance.
/// </summary>
void Awake()
{
// We might iterate through multiple sources / game object
var source = GetComponent<AudioSource>();
SetParameters(ref source);
}
/// <summary>
/// Start this instance.
/// </summary>
void Start()
{
}
/// <summary>
/// Update this instance.
/// </summary>
void Update()
{
// We might iterate through multiple sources / game object
var source = GetComponent<AudioSource>();
// READ-ONLY PARAMETER TEST
#if TEST_READONLY_PARAMETERS
float rfl_enabled = 0.0f;
source.GetSpatializerFloat(readOnly_GlobalRelectionOn, out rfl_enabled);
float num_voices = 0.0f;
source.GetSpatializerFloat(readOnly_NumberOfUsedSpatializedVoices, out num_voices);
String readOnly = System.String.Format
("Read only values: refl enabled: {0:F0} num voices: {1:F0}", rfl_enabled, num_voices);
Debug.Log(readOnly);
#endif
// Check to see if we should disable spatializion
if ((Application.isPlaying == false) ||
(AudioListener.pause == true) ||
(source.isPlaying == false) ||
(source.isActiveAndEnabled == false)
)
{
source.spatialize = false;
return;
}
else
{
SetParameters(ref source);
}
}
/// <summary>
/// Sets the parameters.
/// </summary>
/// <param name="source">Source.</param>
public void SetParameters(ref AudioSource source)
{
// See if we should enable spatialization
source.spatialize = enableSpatialization;
source.SetSpatializerFloat(0, gain);
// All inputs are floats; convert bool to 0.0 and 1.0
if(useInvSqr == true)
source.SetSpatializerFloat(1, 1.0f);
else
source.SetSpatializerFloat(1, 0.0f);
source.SetSpatializerFloat(2, near);
source.SetSpatializerFloat(3, far);
source.SetSpatializerFloat(4, volumetricRadius);
if(enableRfl == true)
source.SetSpatializerFloat(5, 0.0f);
else
source.SetSpatializerFloat(5, 1.0f);
}
private static ONSPAudioSource RoomReflectionGizmoAS = null;
/// <summary>
///
/// </summary>
void OnDrawGizmos()
{
// Are we the first one created? make sure to set our static ONSPAudioSource
// for drawing out room parameters once
if(RoomReflectionGizmoAS == null)
{
RoomReflectionGizmoAS = this;
}
Color c;
const float colorSolidAlpha = 0.1f;
// Draw the near/far spheres
// Near (orange)
c.r = 1.0f;
c.g = 0.5f;
c.b = 0.0f;
c.a = 1.0f;
Gizmos.color = c;
Gizmos.DrawWireSphere(transform.position, Near);
c.a = colorSolidAlpha;
Gizmos.color = c;
Gizmos.DrawSphere(transform.position, Near);
// Far (red)
c.r = 1.0f;
c.g = 0.0f;
c.b = 0.0f;
c.a = 1.0f;
Gizmos.color = Color.red;
Gizmos.DrawWireSphere(transform.position, Far);
c.a = colorSolidAlpha;
Gizmos.color = c;
Gizmos.DrawSphere(transform.position, Far);
// VolumetricRadius (purple)
c.r = 1.0f;
c.g = 0.0f;
c.b = 1.0f;
c.a = 1.0f;
Gizmos.color = c;
Gizmos.DrawWireSphere(transform.position, VolumetricRadius);
c.a = colorSolidAlpha;
Gizmos.color = c;
Gizmos.DrawSphere(transform.position, VolumetricRadius);
// Draw room parameters ONCE only, provided reflection engine is on
if (RoomReflectionGizmoAS == this)
{
// Get global room parameters (write new C api to get reflection values)
bool reflOn = false;
bool reverbOn = false;
float width = 1.0f;
float height = 1.0f;
float length = 1.0f;
ONSP_GetGlobalRoomReflectionValues(ref reflOn, ref reverbOn, ref width, ref height, ref length);
// TO DO: Get the room reflection values and render those out as well (like we do in the VST)
if((Camera.main != null) && (reflOn == true))
{
// Set color of cube (cyan is early reflections only, white is with reverb on)
if(reverbOn == true)
c = Color.white;
else
c = Color.cyan;
Gizmos.color = c;
Gizmos.DrawWireCube(Camera.main.transform.position, new Vector3(width, height, length));
c.a = colorSolidAlpha;
Gizmos.color = c;
Gizmos.DrawCube(Camera.main.transform.position, new Vector3(width, height, length));
}
}
}
/// <summary>
///
/// </summary>
void OnDestroy()
{
// We will null out single pointer instance
// of the room reflection gizmo since we are being destroyed.
// Any ONSPAS that is alive or born will re-set this pointer
// so that we only draw it once
if(RoomReflectionGizmoAS == this)
{
RoomReflectionGizmoAS = null;
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e503ea6418d27594caa33b93cac1b06a
timeCreated: 1442244775
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Networking;
public class ONSPProfiler : MonoBehaviour
{
public bool profilerEnabled = false;
const int DEFAULT_PORT = 2121;
public int port = DEFAULT_PORT;
void Start()
{
Application.runInBackground = true;
}
void Update()
{
if (port < 0 || port > 65535)
{
port = DEFAULT_PORT;
}
ONSP_SetProfilerPort(port);
ONSP_SetProfilerEnabled(profilerEnabled);
}
// Import functions
public const string strONSPS = "AudioPluginOculusSpatializer";
[DllImport(strONSPS)]
private static extern int ONSP_SetProfilerEnabled(bool enabled);
[DllImport(strONSPS)]
private static extern int ONSP_SetProfilerPort(int port);
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c02d0725e6d42214c99b03a3b162f0e8
timeCreated: 1504817842
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More