add games
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0daf439e3ba1a4e469eabf083337aef7
|
||||
timeCreated: 1430409674
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d33b9d7789a85b46929af17f7ce5cf3
|
||||
folderAsset: yes
|
||||
timeCreated: 1430752296
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,144 @@
|
||||
%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: Ico
|
||||
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords: []
|
||||
m_CustomRenderQueue: -1
|
||||
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: _Cutoff
|
||||
second: .5
|
||||
data:
|
||||
first:
|
||||
name: _SrcBlend
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _DstBlend
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Parallax
|
||||
second: .0199999996
|
||||
data:
|
||||
first:
|
||||
name: _ZWrite
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _Glossiness
|
||||
second: .433999985
|
||||
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: _EmissionScaleUI
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Mode
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Metallic
|
||||
second: .239999995
|
||||
m_Colors:
|
||||
data:
|
||||
first:
|
||||
name: _Color
|
||||
second: {r: .264705896, g: .264705896, b: .264705896, a: 1}
|
||||
data:
|
||||
first:
|
||||
name: _EmissionColor
|
||||
second: {r: 0, g: 0, b: 0, a: 0}
|
||||
data:
|
||||
first:
|
||||
name: _EmissionColorUI
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6acb458e3627cfb47b3a6cc6e8cbde22
|
||||
timeCreated: 1430420618
|
||||
licenseType: Store
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 384 KiB |
@@ -0,0 +1,55 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0260234d1358f84e89b381f81fe4228
|
||||
timeCreated: 1431722871
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -2
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 5
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,4 @@
|
||||
# Quick Start
|
||||
|
||||
1. Provide an audio clip to the AudioSource component on the FFT Source gameobject for this to work.
|
||||
2. Once an audio clip is put in the `Audio Clip` field, run the scene.
|
||||
@@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a8a34809b06c50418c4d2ae4f91cbf1
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d4fbaf964fde3a84493b674520e51822
|
||||
folderAsset: yes
|
||||
timeCreated: 1430752196
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Camera orbit controls.
|
||||
*/
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace ProBuilder2.Examples
|
||||
{
|
||||
public class CameraControls : MonoBehaviour
|
||||
{
|
||||
const string INPUT_MOUSE_SCROLLWHEEL = "Mouse ScrollWheel";
|
||||
const string INPUT_MOUSE_X = "Mouse X";
|
||||
const string INPUT_MOUSE_Y = "Mouse Y";
|
||||
const float MIN_CAM_DISTANCE = 10f;
|
||||
const float MAX_CAM_DISTANCE = 40f;
|
||||
|
||||
// how fast the camera orbits
|
||||
[Range(2f, 15f)]
|
||||
public float orbitSpeed = 6f;
|
||||
|
||||
// how fast the camera zooms in and out
|
||||
[Range(.3f,2f)]
|
||||
public float zoomSpeed = .8f;
|
||||
|
||||
// the current distance from pivot point (locked to Vector3.zero)
|
||||
float distance = 0f;
|
||||
|
||||
// how fast the idle camera movement is
|
||||
public float idleRotation = 1f;
|
||||
|
||||
private Vector2 dir = new Vector2(.8f, .2f);
|
||||
|
||||
void Start()
|
||||
{
|
||||
distance = Vector3.Distance(transform.position, Vector3.zero);
|
||||
}
|
||||
|
||||
void LateUpdate()
|
||||
{
|
||||
Vector3 eulerRotation = transform.localRotation.eulerAngles;
|
||||
eulerRotation.z = 0f;
|
||||
|
||||
// orbits
|
||||
if( Input.GetMouseButton(0) )
|
||||
{
|
||||
float rot_x = Input.GetAxis(INPUT_MOUSE_X);
|
||||
float rot_y = -Input.GetAxis(INPUT_MOUSE_Y);
|
||||
|
||||
eulerRotation.x += rot_y * orbitSpeed;
|
||||
eulerRotation.y += rot_x * orbitSpeed;
|
||||
|
||||
// idle direction is derived from last user input.
|
||||
dir.x = rot_x;
|
||||
dir.y = rot_y;
|
||||
dir.Normalize();
|
||||
}
|
||||
else
|
||||
{
|
||||
eulerRotation.y += Time.deltaTime * idleRotation * dir.x;
|
||||
eulerRotation.x += Time.deltaTime * Mathf.PerlinNoise(Time.time, 0f) * idleRotation * dir.y;
|
||||
}
|
||||
|
||||
transform.localRotation = Quaternion.Euler( eulerRotation );
|
||||
transform.position = transform.localRotation * (Vector3.forward * -distance);
|
||||
|
||||
if( Input.GetAxis(INPUT_MOUSE_SCROLLWHEEL) != 0f )
|
||||
{
|
||||
float delta = Input.GetAxis(INPUT_MOUSE_SCROLLWHEEL);
|
||||
|
||||
distance -= delta * (distance/MAX_CAM_DISTANCE) * (zoomSpeed * 1000) * Time.deltaTime;
|
||||
distance = Mathf.Clamp(distance, MIN_CAM_DISTANCE, MAX_CAM_DISTANCE);
|
||||
transform.position = transform.localRotation * (Vector3.forward * -distance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32fdb03cf8ee6094c841dd6f93b3e66a
|
||||
timeCreated: 1430420844
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,272 @@
|
||||
#if UNITY_EDITOR || UNITY_STANDALONE
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ProBuilder2.Common;
|
||||
using ProBuilder2.MeshOperations;
|
||||
|
||||
namespace ProBuilder2.Examples
|
||||
{
|
||||
|
||||
[RequireComponent(typeof(AudioSource))]
|
||||
public class IcoBumpin : MonoBehaviour
|
||||
{
|
||||
pb_Object ico; // A reference to the icosphere pb_Object component
|
||||
Mesh icoMesh; // A reference to the icosphere mesh (cached because we access the vertex array every frame)
|
||||
Transform icoTransform; // A reference to the icosphere transform component. Cached because I can't remember if GameObject.transform is still a performance drain :|
|
||||
AudioSource audioSource;// Cached reference to the audiosource.
|
||||
|
||||
/**
|
||||
* Holds a pb_Face, the normal of that face, and the index of every vertex that touches it (sharedIndices).
|
||||
*/
|
||||
struct FaceRef
|
||||
{
|
||||
public pb_Face face;
|
||||
public Vector3 nrm; // face normal
|
||||
public int[] indices; // all vertex indices (including shared connected vertices)
|
||||
|
||||
public FaceRef(pb_Face f, Vector3 n, int[] i)
|
||||
{
|
||||
face = f;
|
||||
nrm = n;
|
||||
indices = i;
|
||||
}
|
||||
}
|
||||
|
||||
// All faces that have been extruded
|
||||
FaceRef[] outsides;
|
||||
|
||||
// Keep a copy of the original vertex array to calculate the distance from origin.
|
||||
Vector3[] original_vertices, displaced_vertices;
|
||||
|
||||
// The radius of the mesh icosphere on instantiation.
|
||||
[Range(1f, 10f)]
|
||||
public float icoRadius = 2f;
|
||||
|
||||
// The number of subdivisions to give the icosphere.
|
||||
[Range(0, 3)]
|
||||
public int icoSubdivisions = 2;
|
||||
|
||||
// How far along the normal should each face be extruded when at idle (no audio input).
|
||||
[Range(0f, 1f)]
|
||||
public float startingExtrusion = .1f;
|
||||
|
||||
// The material to apply to the icosphere.
|
||||
public Material material;
|
||||
|
||||
// The max distance a frequency range will extrude a face.
|
||||
[Range(1f, 50f)]
|
||||
public float extrusion = 30f;
|
||||
|
||||
// An FFT returns a spectrum including frequencies that are out of human hearing range -
|
||||
// this restricts the number of bins used from the spectrum to the lower @fftBounds.
|
||||
[Range(8, 128)]
|
||||
public int fftBounds = 32;
|
||||
|
||||
// How high the icosphere transform will bounce (sample volume determines height).
|
||||
[Range(0f, 10f)]
|
||||
public float verticalBounce = 4f;
|
||||
|
||||
// Optionally weights the frequency amplitude when calculating extrude distance.
|
||||
public AnimationCurve frequencyCurve;
|
||||
|
||||
// A reference to the line renderer that will be used to render the raw waveform.
|
||||
public LineRenderer waveform;
|
||||
|
||||
// The y size of the waveform.
|
||||
public float waveformHeight = 2f;
|
||||
|
||||
// How far from the icosphere should the waveform be.
|
||||
public float waveformRadius = 20f;
|
||||
|
||||
// If @rotateWaveformRing is true, this is the speed it will travel.
|
||||
public float waveformSpeed = .1f;
|
||||
|
||||
// If true, the waveform ring will randomly orbit the icosphere.
|
||||
public bool rotateWaveformRing = false;
|
||||
|
||||
// If true, the waveform will bounce up and down with the icosphere.
|
||||
public bool bounceWaveform = false;
|
||||
|
||||
public GameObject missingClipWarning;
|
||||
|
||||
// Icosphere's starting position.
|
||||
Vector3 icoPosition = Vector3.zero;
|
||||
float faces_length;
|
||||
|
||||
const float TWOPI = 6.283185f; // 2 * PI
|
||||
const int WAVEFORM_SAMPLES = 1024; // How many samples make up the waveform ring.
|
||||
const int FFT_SAMPLES = 4096; // How many samples are used in the FFT. More means higher resolution.
|
||||
|
||||
// Keep copy of the last frame's sample data to average with the current when calculating
|
||||
// deformation amounts. Smoothes the visual effect.
|
||||
float[] fft = new float[FFT_SAMPLES],
|
||||
fft_history = new float[FFT_SAMPLES],
|
||||
data = new float[WAVEFORM_SAMPLES],
|
||||
data_history = new float[WAVEFORM_SAMPLES];
|
||||
|
||||
// Root mean square of raw data (volume, but not in dB).
|
||||
float rms = 0f, rms_history = 0f;
|
||||
|
||||
/**
|
||||
* Creates the icosphere, and loads all the cache information.
|
||||
*/
|
||||
void Start()
|
||||
{
|
||||
audioSource = GetComponent<AudioSource>();
|
||||
|
||||
if( audioSource.clip == null )
|
||||
missingClipWarning.SetActive(true);
|
||||
|
||||
// Create a new icosphere.
|
||||
ico = pb_ShapeGenerator.IcosahedronGenerator(icoRadius, icoSubdivisions);
|
||||
|
||||
// Shell is all the faces on the new icosphere.
|
||||
pb_Face[] shell = ico.faces;
|
||||
|
||||
// Materials are set per-face on pb_Object meshes. pb_Objects will automatically
|
||||
// condense the mesh to the smallest set of subMeshes possible based on materials.
|
||||
#if !PROTOTYPE
|
||||
foreach(pb_Face f in shell)
|
||||
f.material = material;
|
||||
#else
|
||||
ico.gameObject.GetComponent<MeshRenderer>().sharedMaterial = material;
|
||||
#endif
|
||||
|
||||
// Extrude all faces on the icosphere by a small amount. The third boolean parameter
|
||||
// specifies that extrusion should treat each face as an individual, not try to group
|
||||
// all faces together.
|
||||
ico.Extrude(shell, ExtrudeMethod.IndividualFaces, startingExtrusion);
|
||||
|
||||
// ToMesh builds the mesh positions, submesh, and triangle arrays. Call after adding
|
||||
// or deleting vertices, or changing face properties.
|
||||
ico.ToMesh();
|
||||
|
||||
// Refresh builds the normals, tangents, and UVs.
|
||||
ico.Refresh();
|
||||
|
||||
outsides = new FaceRef[shell.Length];
|
||||
Dictionary<int, int> lookup = ico.sharedIndices.ToDictionary();
|
||||
|
||||
// Populate the outsides[] cache. This is a reference to the tops of each extruded column, including
|
||||
// copies of the sharedIndices.
|
||||
for(int i = 0; i < shell.Length; ++i)
|
||||
outsides[i] = new FaceRef( shell[i],
|
||||
pb_Math.Normal(ico, shell[i]),
|
||||
ico.sharedIndices.AllIndicesWithValues(lookup, shell[i].distinctIndices).ToArray()
|
||||
);
|
||||
|
||||
// Store copy of positions array un-modified
|
||||
original_vertices = new Vector3[ico.vertices.Length];
|
||||
System.Array.Copy(ico.vertices, original_vertices, ico.vertices.Length);
|
||||
|
||||
// displaced_vertices should mirror icosphere mesh vertices.
|
||||
displaced_vertices = ico.vertices;
|
||||
|
||||
icoMesh = ico.msh;
|
||||
icoTransform = ico.transform;
|
||||
|
||||
faces_length = (float)outsides.Length;
|
||||
|
||||
// Build the waveform ring.
|
||||
icoPosition = icoTransform.position;
|
||||
#if UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2 || UNITY_5_3 || UNITY_5_4
|
||||
waveform.SetVertexCount(WAVEFORM_SAMPLES);
|
||||
#elif UNITY_5_5
|
||||
waveform.numPositions = WAVEFORM_SAMPLES;
|
||||
#else
|
||||
waveform.positionCount = WAVEFORM_SAMPLES;
|
||||
#endif
|
||||
|
||||
|
||||
if( bounceWaveform )
|
||||
waveform.transform.parent = icoTransform;
|
||||
|
||||
audioSource.Play();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
// fetch the fft spectrum
|
||||
audioSource.GetSpectrumData(fft, 0, FFTWindow.BlackmanHarris);
|
||||
|
||||
// get raw data for waveform
|
||||
audioSource.GetOutputData(data, 0);
|
||||
|
||||
// calculate root mean square (volume)
|
||||
rms = RMS(data);
|
||||
|
||||
/**
|
||||
* For each face, translate the vertices some distance depending on the frequency range assigned.
|
||||
* Not using the TranslateVertices() pb_Object extension method because as a convenience, that method
|
||||
* gathers the sharedIndices per-face on every call, which while not tremondously expensive in most
|
||||
* contexts, is far too slow for use when dealing with audio, and especially so when the mesh is
|
||||
* somewhat large.
|
||||
*/
|
||||
for(int i = 0; i < outsides.Length; i++)
|
||||
{
|
||||
float normalizedIndex = (i/faces_length);
|
||||
|
||||
int n = (int)(normalizedIndex*fftBounds);
|
||||
|
||||
Vector3 displacement = outsides[i].nrm * ( ((fft[n]+fft_history[n]) * .5f) * (frequencyCurve.Evaluate(normalizedIndex) * .5f + .5f)) * extrusion;
|
||||
|
||||
foreach(int t in outsides[i].indices)
|
||||
{
|
||||
displaced_vertices[t] = original_vertices[t] + displacement;
|
||||
}
|
||||
}
|
||||
|
||||
Vector3 vec = Vector3.zero;
|
||||
|
||||
// Waveform ring
|
||||
for(int i = 0; i < WAVEFORM_SAMPLES; i++)
|
||||
{
|
||||
int n = i < WAVEFORM_SAMPLES-1 ? i : 0;
|
||||
vec.x = Mathf.Cos((float)n/WAVEFORM_SAMPLES * TWOPI) * (waveformRadius + (((data[n] + data_history[n]) * .5f) * waveformHeight));
|
||||
vec.z = Mathf.Sin((float)n/WAVEFORM_SAMPLES * TWOPI) * (waveformRadius + (((data[n] + data_history[n]) * .5f) * waveformHeight));
|
||||
|
||||
vec.y = 0f;
|
||||
|
||||
waveform.SetPosition(i, vec);
|
||||
}
|
||||
|
||||
// Ring rotation
|
||||
if( rotateWaveformRing )
|
||||
{
|
||||
Vector3 rot = waveform.transform.localRotation.eulerAngles;
|
||||
|
||||
rot.x = Mathf.PerlinNoise(Time.time * waveformSpeed, 0f) * 360f;
|
||||
rot.y = Mathf.PerlinNoise(0f, Time.time * waveformSpeed) * 360f;
|
||||
|
||||
waveform.transform.localRotation = Quaternion.Euler(rot);
|
||||
}
|
||||
|
||||
icoPosition.y = -verticalBounce + ((rms + rms_history) * verticalBounce);
|
||||
icoTransform.position = icoPosition;
|
||||
|
||||
// Keep copy of last FFT samples so we can average with the current. Smoothes the movement.
|
||||
System.Array.Copy(fft, fft_history, FFT_SAMPLES);
|
||||
System.Array.Copy(data, data_history, WAVEFORM_SAMPLES);
|
||||
rms_history = rms;
|
||||
|
||||
icoMesh.vertices = displaced_vertices;
|
||||
}
|
||||
|
||||
/**
|
||||
* Root mean square is a good approximation of perceived loudness.
|
||||
*/
|
||||
float RMS(float[] arr)
|
||||
{
|
||||
float v = 0f,
|
||||
len = (float)arr.Length;
|
||||
|
||||
for(int i = 0; i < len; i++)
|
||||
v += Mathf.Abs(arr[i]);
|
||||
|
||||
return Mathf.Sqrt(v / (float)len);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 846bc9a21176f194688069652bb1299b
|
||||
timeCreated: 1430416040
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 705371b5d4fb86b4fa445d50ea42797b
|
||||
folderAsset: yes
|
||||
timeCreated: 1430743015
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,199 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 5
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: Space
|
||||
m_Shader: {fileID: 104, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords:
|
||||
m_LightmapFlags: 5
|
||||
m_CustomRenderQueue: -1
|
||||
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}
|
||||
data:
|
||||
first:
|
||||
name: _FrontTex
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: 760f3e975cb462c4cb9948cd150a6343, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _BackTex
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: 5b16e194d8a47394d8bba2d7f22281dd, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _LeftTex
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: 4f323298b76d3fa45944036e8597b509, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _RightTex
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: f8ebd7b4946039d4587fbf987d710add, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _UpTex
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: 03f6d5b8c2b6ce54a9d3bad9227d22e8, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _DownTex
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: 6925cd6e64cbdf14f823015144ddb2e2, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
data:
|
||||
first:
|
||||
name: _Cutoff
|
||||
second: .5
|
||||
data:
|
||||
first:
|
||||
name: _Exposure
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _SrcBlend
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _DstBlend
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Parallax
|
||||
second: .0199999996
|
||||
data:
|
||||
first:
|
||||
name: _ZWrite
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _Glossiness
|
||||
second: .5
|
||||
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: _EmissionScaleUI
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Mode
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Metallic
|
||||
second: 0
|
||||
data:
|
||||
first:
|
||||
name: _Rotation
|
||||
second: 0
|
||||
m_Colors:
|
||||
data:
|
||||
first:
|
||||
name: _EmissionColor
|
||||
second: {r: 0, g: 0, b: 0, a: 1}
|
||||
data:
|
||||
first:
|
||||
name: _Color
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
data:
|
||||
first:
|
||||
name: _EmissionColorUI
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
data:
|
||||
first:
|
||||
name: _Tint
|
||||
second: {r: .5, g: .5, b: .5, a: .5}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: de1a4762e946d7a439d86780c041e661
|
||||
timeCreated: 1430743144
|
||||
licenseType: Store
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,55 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b16e194d8a47394d8bba2d7f22281dd
|
||||
timeCreated: 1430743015
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,55 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6925cd6e64cbdf14f823015144ddb2e2
|
||||
timeCreated: 1430743015
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,55 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 760f3e975cb462c4cb9948cd150a6343
|
||||
timeCreated: 1430743015
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,55 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f323298b76d3fa45944036e8597b509
|
||||
timeCreated: 1430743015
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1,55 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f8ebd7b4946039d4587fbf987d710add
|
||||
timeCreated: 1430743015
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1,55 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03f6d5b8c2b6ce54a9d3bad9227d22e8
|
||||
timeCreated: 1430743015
|
||||
licenseType: Store
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
cubemapConvolution: 0
|
||||
cubemapConvolutionSteps: 8
|
||||
cubemapConvolutionExponent: 1.5
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
rGBM: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||