Added Higher Resolution Plane + Create-Plane Script.

This commit is contained in:
max 2019-10-15 17:13:45 +02:00
parent 039e4a27d6
commit b5caf76263
15 changed files with 872 additions and 1015 deletions

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelStore">
<e p="C:\Users\chikashi\.Rider2019.1\system\extResources" t="IncludeRecursive" />
<e p="C:\Users\chikashi\.Rider2019.1\system\resharper-host\local\Transient\ReSharperHost\v191\SolutionCaches\_UnityProject.1346624737.00" t="ExcludeRecursive" />
<e p="C:\Users\chikashi\Development\Soundvision\UnityProject" t="IncludeRecursive">
<e p="C:\Users\Cylvester\.Rider2019.2\system\extResources" t="IncludeRecursive" />
<e p="C:\Users\Cylvester\.Rider2019.2\system\resharper-host\local\Transient\ReSharperHost\v192\SolutionCaches\_UnityProject.442702191.00" t="ExcludeRecursive" />
<e p="D:\SoundVision_Repo\Soundvision\UnityProject" t="IncludeRecursive">
<e p="Assembly-CSharp-Editor.csproj" t="IncludeRecursive" />
<e p="Assembly-CSharp.csproj" t="IncludeRecursive" />
<e p="Assets" t="Include">
@ -37,6 +37,11 @@
<e p="BoomBall.cs" t="Include" />
</e>
</e>
<e p="PostProcessing" t="Include">
<e p="script" t="Include">
<e p="BokehBind.cs" t="Include" />
</e>
</e>
<e p="VisualEffectGraph" t="Include">
<e p="script" t="Include">
<e p="FlareBind.cs" t="Include" />
@ -47,13 +52,17 @@
</e>
<e p="Scripts" t="Include">
<e p="PdConnection" t="Include">
<e p="FFTArrayContainer.cs" t="Include" />
<e p="DspController.cs" t="Include" />
<e p="ISpectrumGenerator.cs" t="Include" />
<e p="MidiParser.cs" t="Include" />
<e p="PdArray.cs" t="Include" />
<e p="PdArrayContainer.cs" t="Include" />
<e p="PdArraySelector.cs" t="Include" />
<e p="PdBackend.cs" t="Include" />
<e p="PdConstant.cs" t="Include" />
<e p="PdProcess.cs" t="Include" />
<e p="PdSocket.cs" t="Include" />
<e p="PdReceiver.cs" t="Include" />
<e p="PdSender.cs" t="Include" />
<e p="PdSpectrumBind.cs" t="Include" />
<e p="SpectrumGeneratorPlayMode.cs" t="Include" />
</e>
@ -88,6 +97,11 @@
<e p="Vertex Modifier.shader" t="Include" />
</e>
<e p="ThridParty" t="Include">
<e p="Assets" t="Include">
<e p="JapaneseHouse" t="Include">
<e p="ReadMe.txt" t="Include" />
</e>
</e>
<e p="Editor" t="Include">
<e p="KinectCopyPluginDataHelper.cs" t="Include" />
</e>

View file

@ -5,10 +5,26 @@
<explicitIncludes>
<Path>Library/PackageCache/com.unity.ads@2.0.8</Path>
<Path>Library/PackageCache/com.unity.analytics@3.2.2</Path>
<Path>Library/PackageCache/com.unity.analytics@3.3.2</Path>
<Path>Library/PackageCache/com.unity.collab-proxy@1.2.15</Path>
<Path>Library/PackageCache/com.unity.collab-proxy@1.2.16</Path>
<Path>Library/PackageCache/com.unity.ext.nunit@1.0.0</Path>
<Path>Library/PackageCache/com.unity.ide.vscode@1.1.2</Path>
<Path>Library/PackageCache/com.unity.multiplayer-hlapi@1.0.2</Path>
<Path>Library/PackageCache/com.unity.package-manager-ui@2.0.7</Path>
<Path>Library/PackageCache/com.unity.polybrush@1.0.1</Path>
<Path>Library/PackageCache/com.unity.purchasing@2.0.3</Path>
<Path>Library/PackageCache/com.unity.purchasing@2.0.6</Path>
<Path>Library/PackageCache/com.unity.render-pipelines.core@6.9.1</Path>
<Path>Library/PackageCache/com.unity.render-pipelines.high-definition@6.9.1-preview</Path>
<Path>Library/PackageCache/com.unity.settings-manager@1.0.0</Path>
<Path>Library/PackageCache/com.unity.shadergraph@6.9.1</Path>
<Path>Library/PackageCache/com.unity.test-framework@1.0.13</Path>
<Path>Library/PackageCache/com.unity.textmeshpro@1.4.1</Path>
<Path>Library/PackageCache/com.unity.textmeshpro@2.0.1</Path>
<Path>Library/PackageCache/com.unity.visualeffectgraph@6.9.1-preview</Path>
<Path>Library/PackageCache/com.unity.xr.legacyinputhelpers@2.0.2</Path>
<Path>Library/PackageCache/nuget.mono-cecil@0.1.5-preview</Path>
<Path>Packages</Path>
<Path>ProjectSettings</Path>
</explicitIncludes>
@ -17,6 +33,7 @@
<Path>.vs</Path>
<Path>AudioSamples</Path>
<Path>Library</Path>
<Path>Logs</Path>
<Path>Temp</Path>
<Path>obj</Path>
</explicitExcludes>

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2af19fd62c4ff574a88cdb7412a28be6
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4300000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 530b9f2ec37cdfb469e6a2de877e8364
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 15600000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,215 @@
using UnityEngine;
using UnityEditor;
using System.Collections;
public class CreatePlane : ScriptableWizard
{
public enum Orientation
{
Horizontal,
Vertical
}
public enum AnchorPoint
{
TopLeft,
TopHalf,
TopRight,
RightHalf,
BottomRight,
BottomHalf,
BottomLeft,
LeftHalf,
Center
}
public int widthSegments = 1;
public int lengthSegments = 1;
public float width = 1.0f;
public float length = 1.0f;
public Orientation orientation = Orientation.Horizontal;
public AnchorPoint anchor = AnchorPoint.Center;
public bool addCollider = false;
public bool createAtOrigin = true;
public bool twoSided = false;
public string optionalName;
static Camera cam;
static Camera lastUsedCam;
[MenuItem("GameObject/Create Other/Custom Plane...")]
static void CreateWizard()
{
cam = Camera.current;
// Hack because camera.current doesn't return editor camera if scene view doesn't have focus
if (!cam)
cam = lastUsedCam;
else
lastUsedCam = cam;
ScriptableWizard.DisplayWizard("Create Plane",typeof(CreatePlane));
}
void OnWizardUpdate()
{
widthSegments = Mathf.Clamp(widthSegments, 1, 254);
lengthSegments = Mathf.Clamp(lengthSegments, 1, 254);
}
void OnWizardCreate()
{
GameObject plane = new GameObject();
if (!string.IsNullOrEmpty(optionalName))
plane.name = optionalName;
else
plane.name = "Plane";
if (!createAtOrigin && cam)
plane.transform.position = cam.transform.position + cam.transform.forward*5.0f;
else
plane.transform.position = Vector3.zero;
Vector2 anchorOffset;
string anchorId;
switch (anchor)
{
case AnchorPoint.TopLeft:
anchorOffset = new Vector2(-width/2.0f,length/2.0f);
anchorId = "TL";
break;
case AnchorPoint.TopHalf:
anchorOffset = new Vector2(0.0f,length/2.0f);
anchorId = "TH";
break;
case AnchorPoint.TopRight:
anchorOffset = new Vector2(width/2.0f,length/2.0f);
anchorId = "TR";
break;
case AnchorPoint.RightHalf:
anchorOffset = new Vector2(width/2.0f,0.0f);
anchorId = "RH";
break;
case AnchorPoint.BottomRight:
anchorOffset = new Vector2(width/2.0f,-length/2.0f);
anchorId = "BR";
break;
case AnchorPoint.BottomHalf:
anchorOffset = new Vector2(0.0f,-length/2.0f);
anchorId = "BH";
break;
case AnchorPoint.BottomLeft:
anchorOffset = new Vector2(-width/2.0f,-length/2.0f);
anchorId = "BL";
break;
case AnchorPoint.LeftHalf:
anchorOffset = new Vector2(-width/2.0f,0.0f);
anchorId = "LH";
break;
case AnchorPoint.Center:
default:
anchorOffset = Vector2.zero;
anchorId = "C";
break;
}
MeshFilter meshFilter = (MeshFilter)plane.AddComponent(typeof(MeshFilter));
plane.AddComponent(typeof(MeshRenderer));
string planeAssetName = plane.name + widthSegments + "x" + lengthSegments + "W" + width + "L" + length + (orientation == Orientation.Horizontal? "H" : "V") + anchorId + ".asset";
Mesh m = (Mesh)AssetDatabase.LoadAssetAtPath("Assets/Editor/" + planeAssetName,typeof(Mesh));
if (m == null)
{
m = new Mesh();
m.name = plane.name;
int hCount2 = widthSegments+1;
int vCount2 = lengthSegments+1;
int numTriangles = widthSegments * lengthSegments * 6;
if (twoSided) {
numTriangles *= 2;
}
int numVertices = hCount2 * vCount2;
Vector3[] vertices = new Vector3[numVertices];
Vector2[] uvs = new Vector2[numVertices];
int[] triangles = new int[numTriangles];
Vector4[] tangents = new Vector4[numVertices];
Vector4 tangent = new Vector4(1f, 0f, 0f, -1f);
int index = 0;
float uvFactorX = 1.0f/widthSegments;
float uvFactorY = 1.0f/lengthSegments;
float scaleX = width/widthSegments;
float scaleY = length/lengthSegments;
for (float y = 0.0f; y < vCount2; y++)
{
for (float x = 0.0f; x < hCount2; x++)
{
if (orientation == Orientation.Horizontal)
{
vertices[index] = new Vector3(x*scaleX - width/2f - anchorOffset.x, 0.0f, y*scaleY - length/2f - anchorOffset.y);
}
else
{
vertices[index] = new Vector3(x*scaleX - width/2f - anchorOffset.x, y*scaleY - length/2f - anchorOffset.y, 0.0f);
}
tangents[index] = tangent;
uvs[index++] = new Vector2(x*uvFactorX, y*uvFactorY);
}
}
index = 0;
for (int y = 0; y < lengthSegments; y++)
{
for (int x = 0; x < widthSegments; x++)
{
triangles[index] = (y * hCount2) + x;
triangles[index+1] = ((y+1) * hCount2) + x;
triangles[index+2] = (y * hCount2) + x + 1;
triangles[index+3] = ((y+1) * hCount2) + x;
triangles[index+4] = ((y+1) * hCount2) + x + 1;
triangles[index+5] = (y * hCount2) + x + 1;
index += 6;
}
if (twoSided) {
// Same tri vertices with order reversed, so normals point in the opposite direction
for (int x = 0; x < widthSegments; x++)
{
triangles[index] = (y * hCount2) + x;
triangles[index+1] = (y * hCount2) + x + 1;
triangles[index+2] = ((y+1) * hCount2) + x;
triangles[index+3] = ((y+1) * hCount2) + x;
triangles[index+4] = (y * hCount2) + x + 1;
triangles[index+5] = ((y+1) * hCount2) + x + 1;
index += 6;
}
}
}
m.vertices = vertices;
m.uv = uvs;
m.triangles = triangles;
m.tangents = tangents;
m.RecalculateNormals();
AssetDatabase.CreateAsset(m, "Assets/Editor/" + planeAssetName);
AssetDatabase.SaveAssets();
}
meshFilter.sharedMesh = m;
m.RecalculateBounds();
if (addCollider)
plane.AddComponent(typeof(BoxCollider));
Selection.activeObject = plane;
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 470ad64b3479a664f9b5146b64339ecc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -564,5 +564,115 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6543630110689268649, guid: 367ac1ecba1e2584c816e0372e8d9b31,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 367ac1ecba1e2584c816e0372e8d9b31, type: 3}
--- !u!1 &1755305043
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1755305047}
- component: {fileID: 1755305046}
- component: {fileID: 1755305045}
- component: {fileID: 1755305044}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1755305044
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1755305043}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c0603bf64edb4c8885cefbc40ee206fe, type: 3}
m_Name:
m_EditorClassIdentifier:
kinectManagerBehaviour: {fileID: 1809500800}
panel: {fileID: 1755305043}
--- !u!23 &1755305045
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1755305043}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 08091c5640297a64496a47b90b015414, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1755305046
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1755305043}
m_Mesh: {fileID: 4300000, guid: 2af19fd62c4ff574a88cdb7412a28be6, type: 2}
--- !u!4 &1755305047
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1755305043}
m_LocalRotation: {x: -0.67983025, y: 0.1703382, z: 0.1669823, w: 0.69349307}
m_LocalPosition: {x: 0, y: 0, z: 2.21}
m_LocalScale: {x: 10, y: 1, z: 10}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: -88.86, y: 27.6, z: 0}
--- !u!114 &1809500800 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6724733047624778891, guid: 367ac1ecba1e2584c816e0372e8d9b31,
type: 3}
m_PrefabInstance: {fileID: 880921870}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5b54a31bc1a14c1abb51fe86c56c6227, type: 3}
m_Name:
m_EditorClassIdentifier:

File diff suppressed because one or more lines are too long

View file

@ -27,5 +27,8 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- Vector1_F5BDDE65: 1
- Vector1_3B4ACB5C: 1
- Vector1_7BE5A8C0: 0
- Vector1_9E58CAEF: 0
- Vector1_F5BDDE65: 10
m_Colors: []

View file

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Tiling : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 88b0354d5879a54498b6466af5a54ec1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -9,6 +9,7 @@
"com.unity.ide.vscode": "1.1.2",
"com.unity.multiplayer-hlapi": "1.0.2",
"com.unity.package-manager-ui": "2.2.0",
"com.unity.polybrush": "1.0.1",
"com.unity.purchasing": "2.0.6",
"com.unity.render-pipelines.high-definition": "6.9.1-preview",
"com.unity.test-framework": "1.0.13",