Readd missing import files

This commit is contained in:
Lucien
2026-05-07 10:14:44 +02:00
parent ecb44e63d8
commit cd608d5796
810 changed files with 263144 additions and 1 deletions
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1b71792065f28bf41874e3700c19e839
folderAsset: yes
timeCreated: 1515799132
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,58 @@
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(StackCreator))]
/**
* Minimal editor to make it easy to call the CreateStack methods on the simple stack creator.
*/
public class StackCreatorEditor : Editor
{
public override void OnInspectorGUI()
{
StackCreator stackCreator = (StackCreator)target;
DrawDefaultInspector();
if (GUILayout.Button("Create new stack"))
{
stackCreator.CreateStack();
}
if (GUILayout.Button("Replace last"))
{
stackCreator.DeleteLastStack();
stackCreator.CreateStack();
}
if (GUILayout.Button("Delete last"))
{
stackCreator.DeleteLastStack();
}
}
void OnSceneGUI()
{
StackCreator stackCreator = (StackCreator)target;
Event e = Event.current;
switch (e.type)
{
case EventType.KeyDown:
if (e.keyCode == stackCreator.placementKey)
{
stackCreator.CreateStack();
}
else if (e.keyCode == stackCreator.replacementKey)
{
stackCreator.DeleteLastStack();
stackCreator.CreateStack();
}
break;
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6c74eba3bbcf8c146aff0f9142e818e9
timeCreated: 1515798887
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 9f3c49cf7ae2104469ec5025b1965536
folderAsset: yes
timeCreated: 1518298229
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,128 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: BoxMaterial1
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0.10344789, a: 1}
- _Color: {r: 1, g: 0, b: 0.10344786, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &2797433526867838126
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: bef48ece7ed456f499aba56db78b39ae
timeCreated: 1518298242
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,128 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-528194706713432424
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: BoxMaterial2
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.3655171, g: 0, b: 1, a: 1}
- _Color: {r: 0.36551708, g: 0, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 569c2f11cc05acd4dbb7adf6d7a9b46f
timeCreated: 1518298242
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,128 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: BoxMaterial3
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0, g: 0.7103448, b: 1, a: 1}
- _Color: {r: 0, g: 0.7103448, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &2577544922165534426
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: ada4cd15def86c849b410665130b0eef
timeCreated: 1518298242
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,128 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-8506648177353223612
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: CubeMaterial
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.83823526, g: 0.9866125, b: 1, a: 0.791}
- _Color: {r: 0.83823526, g: 0.9866125, b: 1, a: 0.791}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 4a70913d5fd648b4cb645d344c1a8b72
timeCreated: 1518649244
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,128 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: GroundMaterial
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _UVSec: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0.72794116, g: 0.72981745, b: 1, a: 1}
- _Color: {r: 0.72794116, g: 0.72981745, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &5012401116113450556
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a63fef845cc64294799afe0cf1ea766e
timeCreated: 1518649244
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c7f474f43b2c6d14782bd5d9b4ab6e30
folderAsset: yes
timeCreated: 1518298223
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,95 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1863212150320378
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4123720627174654}
- component: {fileID: 33284633385241586}
- component: {fileID: 65192597974798104}
- component: {fileID: 23678276180132276}
m_Layer: 0
m_Name: Box1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4123720627174654
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1863212150320378}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 0.5, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33284633385241586
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1863212150320378}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65192597974798104
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1863212150320378}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &23678276180132276
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1863212150320378}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: bef48ece7ed456f499aba56db78b39ae, 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: 1
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
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 9273f0692452d1d45891707cf7b3e35c
timeCreated: 1518298359
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,95 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1862356211486470
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4357440221148154}
- component: {fileID: 33104095666105490}
- component: {fileID: 65403400711773398}
- component: {fileID: 23357624210797134}
m_Layer: 0
m_Name: Box2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4357440221148154
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1862356211486470}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33104095666105490
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1862356211486470}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65403400711773398
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1862356211486470}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &23357624210797134
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1862356211486470}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 569c2f11cc05acd4dbb7adf6d7a9b46f, 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: 1
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
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 17b16e0e852aed6469140f03f7008e7c
timeCreated: 1518298355
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,95 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1199887799151576
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4315891382389990}
- component: {fileID: 33079216478634558}
- component: {fileID: 65103250954026298}
- component: {fileID: 23339426389254006}
m_Layer: 0
m_Name: Box3
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4315891382389990
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1199887799151576}
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: 0.5}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33079216478634558
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1199887799151576}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65103250954026298
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1199887799151576}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &23339426389254006
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1199887799151576}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: ada4cd15def86c849b410665130b0eef, 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: 1
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
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b2a58e242a20d34438069d132645c11a
timeCreated: 1518298351
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,95 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1631499466211152
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4596745023067912}
- component: {fileID: 33411338053500338}
- component: {fileID: 65472206477882160}
- component: {fileID: 23997667453906740}
m_Layer: 0
m_Name: Box4
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4596745023067912
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1631499466211152}
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: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33411338053500338
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1631499466211152}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!65 &65472206477882160
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1631499466211152}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &23997667453906740
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1631499466211152}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 014bf233b80c4ad4a84c127825743f7a, 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: 1
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
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 300bbc6da7d4d584193a9d670dcb887c
timeCreated: 1518298349
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,68 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1531590937550994
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4166614137140252}
- component: {fileID: 114641098835390960}
m_Layer: 0
m_Name: StackCreator
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4166614137140252
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1531590937550994}
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: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114641098835390960
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1531590937550994}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67a1244fda9ffe7488d5c1cb9981f091, type: 3}
m_Name:
m_EditorClassIdentifier:
newParentName: Stack
keepGrounded: 1
groundMask:
serializedVersion: 2
m_Bits: 4294967295
stackPrefabs:
- {fileID: 1863212150320378, guid: 9273f0692452d1d45891707cf7b3e35c, type: 3}
- {fileID: 1862356211486470, guid: 17b16e0e852aed6469140f03f7008e7c, type: 3}
- {fileID: 1199887799151576, guid: b2a58e242a20d34438069d132645c11a, type: 3}
- {fileID: 1631499466211152, guid: 300bbc6da7d4d584193a9d670dcb887c, type: 3}
minStackSize: 4
maxStackSize: 9
bottomObjectScale: 1.5
topObjectScale: 0.8
scaleVariation: 0.3
randomPositionOffset: 0
startRotationVariance: 0
objectRotationVariance: 60
objectRotationOffset: 0
compoundCapsuleCollider: 0
yOffset: 0
placementKey: 91
replacementKey: 93
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 9aa6d9e577b12004d80ad9563e05c73c
timeCreated: 1519208890
licenseType: Store
NativeFormatImporter:
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: fac2e6af078d994488e176b7b96dd6c8
folderAsset: yes
timeCreated: 1515700183
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CreateStacksFromCode : MonoBehaviour {
public GameObject[] prefabs;
// Use this for initialization
void Start () {
for (int i = 0; i < 5; i++)
{
StackUtility.CreateStack(
"Stack" + i, //name
new Vector3(-7 + 3.5f*i, 0, 0), //position
0, //rotation
5, //count
prefabs,
2, //start scale
1, //end scale
0, //scale variation
0, //random position offset
0, //start rotation variance
0, //object rotation variance
10, //object rotation offset
0, //pYOffset
false //Create compound collider
);
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 59465161eb1772d40b0b9b54eb423479
timeCreated: 1519379605
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,183 @@
using System.Collections.Generic;
using UnityEngine;
/**
* Creates stacks of items with different scale and rotation settings.
*
* @author J.C. Wichman - InnerDriveStudios.com
*/
[ExecuteInEditMode]
public class StackCreator : MonoBehaviour {
[Header("Placement settings")]
[Tooltip ("If the parent name is not empty, a new object with the given name will be created as parent for the created objects.")]
public string newParentName = "Stack";
[Tooltip("If checked, a ray will be cast down to automatically locate a surface below the stackcreator to place the objects on.")]
public bool keepGrounded = true;
[Tooltip("The layer mask for valid ground objects. Note that ground objects need to have a collider in order to be hit with a ray.")]
public LayerMask groundMask;
[Header("Prefab settings")]
[Tooltip("All prefabs in this list will randomly be picked to built a stack from.")]
public GameObject[] stackPrefabs;
[Header("Stacksize settings")]
[Tooltip("The minimum amount of objects in the stack.")]
[Range(1,100)]
public int minStackSize = 5;
[Range(1,100)]
[Tooltip("The maximum amount of objects in the stack.")]
public int maxStackSize = 10;
[Header("Scale settings")]
[Range(0.5f, 2)]
[Tooltip("The scale for the object on the bottom of the stack. Interpolated towards the top scale to get a base scale for the current object in the stack.")]
public float bottomObjectScale = 1;
[Range(0.5f, 2)]
[Tooltip("The scale for the object on the top of the stack. Interpolated from the bottom scale to get a base scale for the current object in the stack.")]
public float topObjectScale = 1;
[Range(0, 0.5f)]
[Tooltip("The variation in scale for all the objects in the stack." +
"The actual scale will be between (1-variation) * the base scale and (1+variation) * the base scale.")]
public float scaleVariation = 0.5f;
[Header("Position settings")]
[Range(0, 0.5f)]
[Tooltip("A randomly added position offset added to the xz direction to make stacks look less organized.")]
public float randomPositionOffset = 0;
[Header("Rotation settings")]
[Range(0, 180)]
[Tooltip("A random rotation between -VALUE and +VALUE for the first object in the stack.")]
public float startRotationVariance = 0;
[Range(0, 180)]
[Tooltip("A random rotation between -VALUE and +VALUE for each next object in the stack.")]
public float objectRotationVariance = 0;
[Range(-180, 180)]
[Tooltip ("A fixed offset rotation that is added for each next object in the stack.")]
public float objectRotationOffset = 0;
[Header("Collider settings")]
[Tooltip("Specifies whether to add a compound capsule collider to the stack parent (if applicable)")]
public bool compoundCapsuleCollider = false;
[Header("Other")]
[Tooltip("Change this to adjust the auto calculated y offset between the objects. Automatically adjusted by the scale. Default 0.")]
[Range(-0.1f, 0.1f)]
public float yOffset;
[Tooltip("Drag the object that contains this component through the scene and press this key to place a stack.")]
public KeyCode placementKey = KeyCode.S;
[Tooltip("Drag the object that contains this component through the scene and press this key to replace the last stack.")]
public KeyCode replacementKey = KeyCode.R;
void OnValidate()
{
minStackSize = Mathf.Min(minStackSize, maxStackSize);
maxStackSize = Mathf.Max(minStackSize, maxStackSize);
}
private void OnDrawGizmos()
{
//set our starting values based on our own transform
Vector3 stackPosition = transform.position;
float stackRotation = transform.rotation.eulerAngles.y;
//get an indication of the size of the bottom object in the stack
float width = 1f;
float height = 1f;
if (stackPrefabs != null && stackPrefabs.Length > 0)
{
Bounds? bounds = StackUtility.FindBounds(stackPrefabs[0]);
if (bounds != null)
{
Bounds actualBounds = (Bounds)bounds;
width = actualBounds.size.x;
height = actualBounds.size.z;
}
}
//now see if we can find the ground below us
Vector3 surfacePosition = stackPosition;
bool groundFound = StackUtility.FindStackPositionBelow(ref surfacePosition, groundMask);
if (keepGrounded)
{
//if we want to keep the stack grounded, draw an indicator of where that is going to happen
if (groundFound)
{
drawStackIndicator(stackPosition, stackRotation, Color.gray * 0.5f, width, height);
drawStackIndicator(surfacePosition, stackRotation, Color.green, width, height);
Gizmos.color = Color.blue;
Gizmos.DrawLine(stackPosition, surfacePosition);
}
else //or a red square if we could not locate the ground
{
drawStackIndicator(stackPosition, stackRotation, Color.red, width, height);
}
} else
{
//if we do not want to keep the stack grounded, we still draw a sort of shadow indicator
//because it makes placement easier
drawStackIndicator(stackPosition, stackRotation, Color.green, width, height);
if (groundFound)
{
drawStackIndicator(surfacePosition, stackRotation, Color.gray, width, height);
}
}
}
/**
* Draws a square with a cross using the given color.
*/
private void drawStackIndicator (Vector3 pPosition, float pYRotation, Color pColor, float pWidth = 1f, float pHeight = 0.75f)
{
GizmoUtility.DrawSquare(pPosition, Quaternion.Euler(90, pYRotation, 0), pColor, pWidth, pHeight,4);
GizmoUtility.DrawCross(pPosition, Quaternion.Euler(90, pYRotation, 0), pColor, pWidth/2, pHeight/2, 4);
}
private List<GameObject> _history;
//helper method to create stack according to settings above
public void CreateStack()
{
//check our creation settings
Vector3 stackPosition = transform.position;
Vector3 surfacePosition = stackPosition;
bool groundFound = StackUtility.FindStackPositionBelow(ref surfacePosition, groundMask);
if (keepGrounded && !groundFound)
{
Debug.Log("Cannot place stack using current settings. No ground found.");
return;
}
_history = StackUtility.CreateStack(
newParentName,
keepGrounded && groundFound ? surfacePosition : stackPosition,
transform.rotation.eulerAngles.y,
Random.Range (minStackSize, maxStackSize+1),
stackPrefabs,
bottomObjectScale,
topObjectScale,
scaleVariation,
randomPositionOffset,
startRotationVariance,
objectRotationVariance,
objectRotationOffset,
yOffset,
compoundCapsuleCollider
);
}
public void DeleteLastStack()
{
if (_history == null) return;
for (int i = _history.Count - 1; i >= 0; i--)
{
GameObject.DestroyImmediate(_history[i]);
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 67a1244fda9ffe7488d5c1cb9981f091
timeCreated: 1515700206
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,214 @@
using System.Collections.Generic;
using UnityEngine;
/**
* StackUtility class to create stacks of items through code.
*
* @author J.C. Wichman - www.innerdrivestudios.com
*/
public class StackUtility {
/**
* Helper method to find a valid stack position below a given stackposition.
* For example you can pick a point above a floor and this method will return
* a position on the floor.
*
* @param pStackPosition the position to start looking from (downwards)
* @param pLayerMask the layermask of the objects to include in the downward raycast
*/
public static bool FindStackPositionBelow (ref Vector3 pStackPosition, LayerMask pLayerMask )
{
//use given stackposition as start to cast a ray down to find the first target we hit
//if we can't find a ray, just return false
RaycastHit info;
Ray ray = new Ray(pStackPosition, Vector3.down);
if (Physics.Raycast(ray, out info, float.PositiveInfinity, pLayerMask))
{
pStackPosition = info.point;
return true;
}
else
{
return false;
}
}
/**
* Create a stack of objects, automatically randomizing them, scaling them, rotating them etc.
*
* @param pParentName if pParentName != null, all objects will be created as children of a parent with the given name
* @param pStackPosition the world space position of the bottom of the stack
* @param pStackRotation the world space y rotation of the stack (0,360)
* @param pStackSize the amount of objects in the stack (1-...?)
*
* @param pPrefabs the prefabs to choose from randomly when creating objects in the stack
*
* @param pStartScale the uniform scale for the object on the bottom of the stack (interpolated to top)
* @param pEndScale the uniform scale for the object on the top of the stack (interpolated from bottom)
* @param pScaleVariation the percentage of scale variation for each book (A range of 0..0.5f works best)
*
* @param pRandomPositionOffset a random offset added to each next book, calculated from the center
*
* @param pStartRotationVariance the variance in rotation for the first object in the stack (0 .. 180)
* (calculated as a number between (-pObjectRotationVariance, pObjectRotationVariance)
* @param pObjectRotationVariance the variance in rotation for each subsequent object (0 .. 180)
* (calculated as a number between (-pObjectRotationVariance, pObjectRotationVariance)
* @param pObjectRotationOffset the added rotation to each object (-180 .. 180)
* @param pYOffset an additional yOffset padding between the objects automatically multiplied with the scale
*
* @param pCompoundCapsuleCollider should we create a compound capsule collider for the stack as a whole
*
* @return a list of all created root objects (which is 1 if pParentName.Length > 0)
*/
public static List<GameObject> CreateStack(
string pParentName,
Vector3 pStackPosition,
float pStackRotation,
int pStackSize,
GameObject[] pPrefabs,
float pStartScale,
float pEndScale,
float pScaleVariation,
float pRandomPositionOffset,
float pStartRotationVariance,
float pObjectRotationVariance,
float pObjectRotationOffset,
float pYOffset,
bool pCompoundCapsuleCollider
)
{
//during creation keep a list of created objects so we can return that to the caller
List<GameObject> rootStackObjects = new List<GameObject>();
//set some start variables that we can overwrite later
//start by assuming the objects will be attached directly to the world
Transform parent = null;
Vector3 startPosition = pStackPosition;
float startRotation = pStackRotation + Random.Range(-pStartRotationVariance, pStartRotationVariance);
//if required created an addition stack parent and attach it to the main parent (if given)
bool createIntermediateNode = pParentName != null && pParentName.Length > 0;
if (createIntermediateNode)
{
//overwrite the null parent with this new intermediate node
parent = new GameObject(pParentName).transform;
rootStackObjects.Add(parent.gameObject);
parent.position = pStackPosition;
parent.rotation = Quaternion.AngleAxis(startRotation, Vector3.up);
//but since all objects will now be nested under this new node, reset the object start position & rotation to 0
startPosition = Vector3.zero;
startRotation = 0;
}
//now build the stack of objects
//this loop is fairly long, but all variables are so related that
//splitting it up into smaller parts does not improve the readability or performance.
//stacktop is used to place a new book and for collider calculation
float stackTop = 0;
//maxExtents is used to calculate a radius for a compound collider
float maxExtents = 0;
for (int i = 0; i < pStackSize; i++)
{
//create a random object, the object should be created from a prefab at (0,0,0), without rotation, keeping the original scale
GameObject newObject = GameObject.Instantiate(pPrefabs[Random.Range(0, pPrefabs.Length)], Vector3.zero, Quaternion.identity);
//calculate scale based on start/end/index
float baseScale = (pStackSize > 1) ?
Mathf.Lerp(pStartScale, pEndScale, ((float)i) / (pStackSize - 1)) :
pStartScale;
baseScale += Random.Range(-baseScale * pScaleVariation, baseScale * pScaleVariation);
newObject.transform.localScale = newObject.transform.localScale * baseScale;
//get the bounds for this object so we can use those values for positioning etc
Bounds? bounds = FindBounds(newObject);
if (bounds == null)
{
Debug.LogWarning("Created object has no meshrenderers, check your prefabs!");
continue;
}
Bounds actualBounds = (Bounds)bounds;
//now that we have the bounds, set the position with an optionally added random offset
Vector2 randomOffset = Random.insideUnitCircle * pRandomPositionOffset;
newObject.transform.localPosition =
//the bottom of the stack
startPosition +
new Vector3(
0,
//the distance from the bottom of the stack, to the top of the last object
stackTop +
//plus the offset from the center of the bounds to the bottom (or top) of the object
actualBounds.extents.y - actualBounds.center.y
,
0
) +
new Vector3(randomOffset.x, 0, randomOffset.y);
//set our top to be the new starting point
stackTop += (2 * actualBounds.extents.y) + (pYOffset * baseScale);
//calculate the max extents in case we want to add a compound collider
maxExtents = Mathf.Max(Mathf.Max(actualBounds.extents.x, actualBounds.extents.z), maxExtents);
//update parenting and history, if we have a parent, attach us, if not
//add us to the history list so that the caller can remove us if required
if (parent != null) newObject.transform.SetParent(parent, false);
else rootStackObjects.Add(newObject);
//update object rotation
newObject.transform.localRotation = Quaternion.AngleAxis(startRotation, Vector3.up);
startRotation += Random.Range(-pObjectRotationVariance, pObjectRotationVariance) + pObjectRotationOffset;
}
//we can also add a compound collider assuming there is an intermediate stack mode
if (pCompoundCapsuleCollider)
{
if (createIntermediateNode)
{
CapsuleCollider collider = parent.gameObject.AddComponent<CapsuleCollider>();
collider.center = new Vector3(0, stackTop/2, 0);
collider.height = stackTop;
collider.radius = maxExtents;
} else
{
Debug.Log("Cannot add a compound collider, since there is no intermediate node.");
}
}
return rootStackObjects;
}
public static Bounds? FindBounds (GameObject pGameObject)
{
if (pGameObject == null) return null;
MeshRenderer[] meshRenderers = pGameObject.GetComponentsInChildren<MeshRenderer>();
if (meshRenderers.Length > 0)
{
Bounds bounds = meshRenderers[0].bounds;
for (int i = 1; i < meshRenderers.Length; i++)
{
bounds.Encapsulate(meshRenderers[i].bounds);
}
return bounds;
} else
{
return null;
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c54fe1ab3952e964d8fc3b7ce93d8b39
timeCreated: 1515840197
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: