Commit e62bb15d authored by Nathan De Castro's avatar Nathan De Castro

draft

parent c1829eb3
......@@ -49,11 +49,13 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Other Sources\Ripple\rippleSharp.cs" />
<Compile Include="Assets\Scripts\AI\AI.cs" />
<Compile Include="Assets\Scripts\Effects\PlayerSettings.cs" />
<Compile Include="Assets\Scripts\Effects\Rotate.cs" />
<Compile Include="Assets\Scripts\Menu\LoadPlay.cs" />
<Compile Include="Assets\Scripts\Tools\AudioManager.cs" />
<Compile Include="Assets\Scripts\Tools\EchoSound.cs" />
<Compile Include="Assets\Scripts\Tools\FPS_Camera.cs" />
<Compile Include="Assets\Scripts\Tools\FPS_Control.cs" />
<Compile Include="Assets\Scripts\Tools\GameSettings.cs" />
......
fileFormatVersion: 2
guid: 34d22faf1d7e2c8429cadea8d9e205f8
folderAsset: yes
timeCreated: 1486914879
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
%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: New Material
m_Shader: {fileID: 28, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
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: _Cube
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}
m_Floats:
- first:
name: _Cutoff
second: 0.5
- first:
name: _Parallax
second: 0.0132835815
- first:
name: _Shininess
second: 0.56573695
m_Colors:
- first:
name: _Color
second: {r: 0.4, g: 1, b: 1, a: 0.24}
- first:
name: _ReflectColor
second: {r: 1, g: 0.43529412, b: 0.8117647, a: 1}
- first:
name: _SpecColor
second: {r: 0.4, g: 1, b: 0.4, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6
fileFormatVersion: 2
guid: 810cebed1f363c7479884f152d71de71
timeCreated: 1486916812
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !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: 1802124651185064}
m_IsPrefabParent: 1
--- !u!1 &1049480624652460
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4607767398666284}
- component: {fileID: 23388984037506834}
- component: {fileID: 111601143508679154}
- component: {fileID: 114240015916630166}
- component: {fileID: 33088446716562156}
m_Layer: 0
m_Name: 128xplane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1526515523882130
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4580214526593280}
- component: {fileID: 33376699165076374}
- component: {fileID: 64607807228510372}
- component: {fileID: 23917298595123638}
m_Layer: 0
m_Name: collision plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1802124651185064
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4104538227611206}
m_Layer: 0
m_Name: RipplePlane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4104538227611206
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1802124651185064}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 4, y: 1, z: 4}
m_Children:
- {fileID: 4607767398666284}
- {fileID: 4580214526593280}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4580214526593280
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1526515523882130}
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_Children: []
m_Father: {fileID: 4104538227611206}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4607767398666284
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1049480624652460}
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_Children: []
m_Father: {fileID: 4104538227611206}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &23388984037506834
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1049480624652460}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 5f377ddd01309ad4cb352876ed0fc22b, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
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_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &23917298595123638
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1526515523882130}
m_Enabled: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
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_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &33088446716562156
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1049480624652460}
m_Mesh: {fileID: 0}
--- !u!33 &33376699165076374
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1526515523882130}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!64 &64607807228510372
MeshCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1526515523882130}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_InflateMesh: 0
m_SkinWidth: 0.01
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!111 &111601143508679154
Animation:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1049480624652460}
m_Enabled: 1
serializedVersion: 3
m_Animation: {fileID: 0}
m_Animations: []
m_WrapMode: 0
m_PlayAutomatically: 1
m_AnimatePhysics: 0
m_CullingType: 0
--- !u!114 &114240015916630166
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1049480624652460}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 03874d69177b2d54ba4eb2b4af03dbe9, type: 3}
m_Name:
m_EditorClassIdentifier:
dampner: 0.999
maxWaveHeight: 2
splashForce: 1000
cols: 128
rows: 128
fileFormatVersion: 2
guid: d4bd53f01c2f4c44f89fd28aa4ca29c9
timeCreated: 1486927622
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%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: ocean
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 7c7a007aa2ca74fd1b8e51c1d32d3dc5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: []
m_Colors:
- first:
name: _Color
second: {r: 1, g: 0, b: 0, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6
fileFormatVersion: 2
guid: 5f377ddd01309ad4cb352876ed0fc22b
timeCreated: 1486926505
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class rippleSharp : MonoBehaviour
{
private int[] buffer1;
private int[] buffer2;
private int[] vertexIndices;
private Mesh mesh;
private Vector3[] vertices;
//private Vector3[] normals ;
public float dampner = 0.999f;
public float maxWaveHeight = 2.0f;
public int splashForce = 1000;
//public int slowdown = 20;
//private int slowdownCount = 0;
private bool swapMe = true;
public int cols = 128;
public int rows = 128;
// Use this for initialization
void Start()
{
MeshFilter mf = (MeshFilter)GetComponent(typeof(MeshFilter));
mesh = mf.mesh;
vertices = mesh.vertices;
buffer1 = new int[vertices.Length];
buffer2 = new int[vertices.Length];
Bounds bounds = mesh.bounds;
float xStep = (bounds.max.x - bounds.min.x) / cols;
float zStep = (bounds.max.z - bounds.min.z) / rows;
vertexIndices = new int[vertices.Length];
int i = 0;
for (i = 0; i < vertices.Length; i++)
{
vertexIndices[i] = -1;
buffer1[i] = 0;
buffer2[i] = 0;
}
// this will produce a list of indices that are sorted the way I need them to
// be for the algo to work right
for (i = 0; i < vertices.Length; i++)
{
float column = ((vertices[i].x - bounds.min.x) / xStep);// + 0.5;
float row = ((vertices[i].z - bounds.min.z) / zStep);// + 0.5;
float position = (row * (cols + 1)) + column + 0.5f;
if (vertexIndices[(int)position] >= 0) print("smash");
vertexIndices[(int)position] = i;
}
splashAtPoint(cols / 2, rows / 2);
}
void splashAtPoint(int x, int y)
{
int position = ((y * (cols + 1)) + x);
buffer1[position] = splashForce;
buffer1[position - 1] = splashForce;
buffer1[position + 1] = splashForce;
buffer1[position + (cols + 1)] = splashForce;
buffer1[position + (cols + 1) + 1] = splashForce;
buffer1[position + (cols + 1) - 1] = splashForce;
buffer1[position - (cols + 1)] = splashForce;
buffer1[position - (cols + 1) + 1] = splashForce;
buffer1[position - (cols + 1) - 1] = splashForce;
}
// Update is called once per frame
void Update()
{
checkInput();
int[] currentBuffer;
if (swapMe)
{
// process the ripples for this frame
processRipples(buffer1, buffer2);
currentBuffer = buffer2;
}
else
{
processRipples(buffer2, buffer1);
currentBuffer = buffer1;
}
swapMe = !swapMe;
// apply the ripples to our buffer
Vector3[] theseVertices = new Vector3[vertices.Length];
int vertIndex;
int i = 0;
for (i = 0; i < currentBuffer.Length; i++)
{
vertIndex = vertexIndices[i];
theseVertices[vertIndex] = vertices[vertIndex];
theseVertices[vertIndex].y += (currentBuffer[i] * 1.0f / splashForce) * maxWaveHeight;
}
mesh.vertices = theseVertices;
// swap buffers
}
void checkInput()
{
if (Input.GetMouseButton(0))
{
RaycastHit hit;
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit))
{
Bounds bounds = mesh.bounds;
float xStep = (bounds.max.x - bounds.min.x) / cols;
float zStep = (bounds.max.z - bounds.min.z) / rows;
float xCoord = (bounds.max.x - bounds.min.x) - ((bounds.max.x - bounds.min.x) * hit.textureCoord.x);
float zCoord = (bounds.max.z - bounds.min.z) - ((bounds.max.z - bounds.min.z) * hit.textureCoord.y);
float column = (xCoord / xStep);// + 0.5;
float row = (zCoord / zStep);// + 0.5;
splashAtPoint((int)column, (int)row);
}
}
}
void processRipples(int[] source, int[] dest)
{
int x = 0;
int y = 0;
int position = 0;
for (y = 1; y < rows - 1; y++)
{
for (x = 1; x < cols; x++)
{
position = (y * (cols + 1)) + x;
dest[position] = (((source[position - 1] +
source[position + 1] +
source[position - (cols + 1)] +
source[position + (cols + 1)]) >> 1) - dest[position]);
dest[position] = (int)(dest[position] * dampner);
}
}
}
}
fileFormatVersion: 2
guid: 03874d69177b2d54ba4eb2b4af03dbe9
timeCreated: 1486914819
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -46,7 +46,7 @@ GameObject:
- component: {fileID: 65000012651988492}
- component: {fileID: 23000010267785920}
m_Layer: 0
m_Name: dot
m_Name: dot (10)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -67,25 +67,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000013147154044
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000013514783194}
- component: {fileID: 33000011146887598}
- component: {fileID: 65000011623477234}