drag and drop

This commit is contained in:
Felix Boucher 2023-06-02 13:59:51 -04:00
parent 9304b02c31
commit 86cb9280b4
28 changed files with 5606 additions and 16 deletions

18
Assets/LogScript.cs Normal file
View File

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

11
Assets/LogScript.cs.meta Normal file
View File

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

View File

@ -0,0 +1,948 @@
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "d762eb40128145ada2a38cb86a2f827a",
"m_Properties": [
{
"m_Id": "c9fc807377854a30b4c9c46daa7cc353"
},
{
"m_Id": "3c818862e7b2430ba5590e42b334a09c"
}
],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "bdc3a9c5c6ea46a69b3141975a60a8a5"
}
],
"m_Nodes": [
{
"m_Id": "ef7b77a67b7c49649c84d0cc54632bae"
},
{
"m_Id": "4565b21ec9e343ac88c8055772b0cecb"
},
{
"m_Id": "690c585987114da3b2636a55de4ddf7f"
},
{
"m_Id": "b06212e5c44a42b8a8c0f878f440d35e"
},
{
"m_Id": "46be20cd2e994ae6b102372f1787521a"
},
{
"m_Id": "25ffb2fd592448e4b05ee73a005db243"
},
{
"m_Id": "133b35d8741040b58fbeb2f469e1ab63"
},
{
"m_Id": "0853489fc09d4e438c2766762007929b"
},
{
"m_Id": "d950c2076a1742249e62524d6ed0c828"
},
{
"m_Id": "315aeb40c5474d37b453dae1995d6856"
}
],
"m_GroupDatas": [],
"m_StickyNoteDatas": [],
"m_Edges": [
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "0853489fc09d4e438c2766762007929b"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "d950c2076a1742249e62524d6ed0c828"
},
"m_SlotId": 1
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "315aeb40c5474d37b453dae1995d6856"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "b06212e5c44a42b8a8c0f878f440d35e"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "d950c2076a1742249e62524d6ed0c828"
},
"m_SlotId": 7
},
"m_InputSlot": {
"m_Node": {
"m_Id": "133b35d8741040b58fbeb2f469e1ab63"
},
"m_SlotId": 0
}
}
],
"m_VertexContext": {
"m_Position": {
"x": 57.5999641418457,
"y": -14.39999008178711
},
"m_Blocks": [
{
"m_Id": "ef7b77a67b7c49649c84d0cc54632bae"
},
{
"m_Id": "4565b21ec9e343ac88c8055772b0cecb"
},
{
"m_Id": "690c585987114da3b2636a55de4ddf7f"
}
]
},
"m_FragmentContext": {
"m_Position": {
"x": 57.5999641418457,
"y": 185.59999084472657
},
"m_Blocks": [
{
"m_Id": "b06212e5c44a42b8a8c0f878f440d35e"
},
{
"m_Id": "46be20cd2e994ae6b102372f1787521a"
},
{
"m_Id": "25ffb2fd592448e4b05ee73a005db243"
},
{
"m_Id": "133b35d8741040b58fbeb2f469e1ab63"
}
]
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
},
"preventRotation": false
},
"m_Path": "Shader Graphs",
"m_GraphPrecision": 1,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": ""
},
"m_ActiveTargets": [
{
"m_Id": "e56cfd3b62a84535a0a3de604f2cc2e5"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "02dd9b445445415dbd3636bc8d216c2b",
"m_Id": 4,
"m_DisplayName": "R",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "R",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
"m_ObjectId": "05d1cb6e29924601861acaa28280952c",
"m_Id": 0,
"m_DisplayName": "Tangent",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Tangent",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "0853489fc09d4e438c2766762007929b",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -806.3999633789063,
"y": 225.60000610351563,
"width": 128.0,
"height": 33.600006103515628
}
},
"m_Slots": [
{
"m_Id": "62cc977f75ae40cf93b751ee48d83cda"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "c9fc807377854a30b4c9c46daa7cc353"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
"m_ObjectId": "0b3bf84f31fa4f5d9996f5f0624f8530",
"m_Id": 0,
"m_DisplayName": "Normal",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Normal",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "133b35d8741040b58fbeb2f469e1ab63",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.Alpha",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "b35ca63d9b7b4c91a0b840d71a03e2f2"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.Alpha"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
"m_ObjectId": "19b4e61e14294068bb520f7e992471bb",
"m_Id": 0,
"m_DisplayName": "Base Color",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "BaseColor",
"m_StageCapability": 2,
"m_Value": {
"x": 0.5,
"y": 0.5,
"z": 0.5
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_ColorMode": 0,
"m_DefaultColor": {
"r": 0.5,
"g": 0.5,
"b": 0.5,
"a": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalSpriteLitSubTarget",
"m_ObjectId": "1b0d89ba3c0145ba8f128686c26ae641"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "25ffb2fd592448e4b05ee73a005db243",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.NormalTS",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "d4e712c9fba743c88ad26b5d6fe6ba6c"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.NormalTS"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "315aeb40c5474d37b453dae1995d6856",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -240.00001525878907,
"y": 225.59999084472657,
"width": 104.80001831054688,
"height": 33.60002136230469
}
},
"m_Slots": [
{
"m_Id": "bf4271291cb2408bb5ebc3aaa5d0d8a2"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "3c818862e7b2430ba5590e42b334a09c"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "3bb1f2612d02495aa8048ba9ac8766b5",
"m_Id": 6,
"m_DisplayName": "B",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "B",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector3ShaderProperty",
"m_ObjectId": "3c818862e7b2430ba5590e42b334a09c",
"m_Guid": {
"m_GuidSerialized": "b9a3aab0-ea6e-416a-abc2-821c43264458"
},
"m_Name": "Color",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Color",
"m_DefaultReferenceName": "_Color",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 0.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "4565b21ec9e343ac88c8055772b0cecb",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Normal",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "0b3bf84f31fa4f5d9996f5f0624f8530"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Normal"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "46be20cd2e994ae6b102372f1787521a",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.SpriteMask",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "7018d50e3931485f82f5e21e23f5837e"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.SpriteMask"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
"m_ObjectId": "61078ede8f9943018a80c79d95a1f541",
"m_Id": 0,
"m_DisplayName": "RGBA",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "RGBA",
"m_StageCapability": 2,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot",
"m_ObjectId": "62cc977f75ae40cf93b751ee48d83cda",
"m_Id": 0,
"m_DisplayName": "MainTex",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_BareResource": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "646ea4b69b6745d79e8689d1e79c7412",
"m_Id": 5,
"m_DisplayName": "G",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "G",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "690c585987114da3b2636a55de4ddf7f",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Tangent",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "05d1cb6e29924601861acaa28280952c"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Tangent"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBAMaterialSlot",
"m_ObjectId": "7018d50e3931485f82f5e21e23f5837e",
"m_Id": 0,
"m_DisplayName": "Sprite Mask",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "SpriteMask",
"m_StageCapability": 2,
"m_Value": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "71dcfbc9a8f64b64b96bbe9a0b527bd6",
"m_Id": 7,
"m_DisplayName": "A",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "A",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot",
"m_ObjectId": "83c14ba3968f4122b5df12a1d7272727",
"m_Id": 1,
"m_DisplayName": "Texture",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Texture",
"m_StageCapability": 3,
"m_BareResource": false,
"m_Texture": {
"m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}",
"m_Guid": ""
},
"m_DefaultType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
"m_ObjectId": "9cba3a38bf3f4f0888d6c8cabccb2451",
"m_Id": 0,
"m_DisplayName": "Position",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Position",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "b06212e5c44a42b8a8c0f878f440d35e",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.BaseColor",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "19b4e61e14294068bb520f7e992471bb"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.BaseColor"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "b35ca63d9b7b4c91a0b840d71a03e2f2",
"m_Id": 0,
"m_DisplayName": "Alpha",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Alpha",
"m_StageCapability": 2,
"m_Value": 1.0,
"m_DefaultValue": 1.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot",
"m_ObjectId": "ba0139dc089441dda20c18fc382d8199",
"m_Id": 2,
"m_DisplayName": "UV",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "UV",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0
},
"m_Labels": [],
"m_Channel": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
"m_ObjectId": "bdc3a9c5c6ea46a69b3141975a60a8a5",
"m_Name": "",
"m_ChildObjectList": [
{
"m_Id": "c9fc807377854a30b4c9c46daa7cc353"
},
{
"m_Id": "3c818862e7b2430ba5590e42b334a09c"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "bf4271291cb2408bb5ebc3aaa5d0d8a2",
"m_Id": 0,
"m_DisplayName": "Color",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty",
"m_ObjectId": "c9fc807377854a30b4c9c46daa7cc353",
"m_Guid": {
"m_GuidSerialized": "c4ddea04-c9c9-4848-82a6-e79257fdf4f5"
},
"m_Name": "MainTex",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "MainTex",
"m_DefaultReferenceName": "_MainTex",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": {
"m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}",
"m_Guid": ""
},
"isMainTexture": false,
"useTilingAndOffset": false,
"m_Modifiable": true,
"m_DefaultType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
"m_ObjectId": "d4e712c9fba743c88ad26b5d6fe6ba6c",
"m_Id": 0,
"m_DisplayName": "Normal (Tangent Space)",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "NormalTS",
"m_StageCapability": 2,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 3
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode",
"m_ObjectId": "d950c2076a1742249e62524d6ed0c828",
"m_Group": {
"m_Id": ""
},
"m_Name": "Sample Texture 2D",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -566.3999633789063,
"y": 185.60000610351563,
"width": 207.99996948242188,
"height": 431.9999694824219
}
},
"m_Slots": [
{
"m_Id": "61078ede8f9943018a80c79d95a1f541"
},
{
"m_Id": "02dd9b445445415dbd3636bc8d216c2b"
},
{
"m_Id": "646ea4b69b6745d79e8689d1e79c7412"
},
{
"m_Id": "3bb1f2612d02495aa8048ba9ac8766b5"
},
{
"m_Id": "71dcfbc9a8f64b64b96bbe9a0b527bd6"
},
{
"m_Id": "83c14ba3968f4122b5df12a1d7272727"
},
{
"m_Id": "ba0139dc089441dda20c18fc382d8199"
},
{
"m_Id": "f67c1d86cf4b445fac1496a7c23d1030"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_TextureType": 0,
"m_NormalMapSpace": 0,
"m_EnableGlobalMipBias": true
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
"m_ObjectId": "e56cfd3b62a84535a0a3de604f2cc2e5",
"m_ActiveSubTarget": {
"m_Id": "1b0d89ba3c0145ba8f128686c26ae641"
},
"m_AllowMaterialOverride": false,
"m_SurfaceType": 0,
"m_ZTestMode": 4,
"m_ZWriteControl": 0,
"m_AlphaMode": 0,
"m_RenderFace": 2,
"m_AlphaClip": false,
"m_CastShadows": true,
"m_ReceiveShadows": true,
"m_CustomEditorGUI": "",
"m_SupportVFX": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "ef7b77a67b7c49649c84d0cc54632bae",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Position",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "9cba3a38bf3f4f0888d6c8cabccb2451"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Position"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot",
"m_ObjectId": "f67c1d86cf4b445fac1496a7c23d1030",
"m_Id": 3,
"m_DisplayName": "Sampler",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Sampler",
"m_StageCapability": 3,
"m_BareResource": false
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 5aed7d9426a25544b928536f1bd9edc0
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View File

@ -0,0 +1,42 @@
%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: Shader Graphs_New Shader Graph
m_Shader: {fileID: -6465566751694194690, guid: 5aed7d9426a25544b928536f1bd9edc0, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
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: []
m_Colors: []
m_BuildTextureStacks: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7f87c7d6b4237a34ea92984757e5c269
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -72,6 +72,38 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_entityLinked: {fileID: 5998513223176943995}
--- !u!1 &3383419206106522944
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6362326292554678953}
m_Layer: 0
m_Name: Wrapper
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6362326292554678953
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3383419206106522944}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.5, y: 0.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6962989255883535387}
m_Father: {fileID: 6962989255644195631}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &6962989255035248094
GameObject:
m_ObjectHideFlags: 0
@ -421,7 +453,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6962989256011107500}
- {fileID: 6962989255883535387}
- {fileID: 6362326292554678953}
- {fileID: 71124047072817123}
m_Father: {fileID: 0}
m_RootOrder: 0
@ -700,8 +732,8 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6962989255883535386}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.006, y: -0.464, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.006000042, y: -0.464, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@ -711,8 +743,8 @@ Transform:
- {fileID: 6962989255885988242}
- {fileID: 6962989256565824838}
- {fileID: 6962989256410121263}
m_Father: {fileID: 6962989255644195631}
m_RootOrder: 1
m_Father: {fileID: 6362326292554678953}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!95 &6962989255883535384
Animator:

View File

@ -1,5 +1,37 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4770868994596278828
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6485819158859757590}
m_Layer: 0
m_Name: Wrapper
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6485819158859757590
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4770868994596278828}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.5, y: 0.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6962989256011107500}
m_Father: {fileID: 6962989255644195631}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &6962989255644195630
GameObject:
m_ObjectHideFlags: 0
@ -32,7 +64,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6962989256011107500}
- {fileID: 6485819158859757590}
- {fileID: 6802302589573039538}
m_Father: {fileID: 0}
m_RootOrder: 0
@ -163,11 +195,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6962989256011107503}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.0259, y: 0.01, z: 0}
m_LocalPosition: {x: 0.025899887, y: 0.00999999, z: 0}
m_LocalScale: {x: 0.5394133, y: 0.56488746, z: 0.9686}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6962989255644195631}
m_Father: {fileID: 6485819158859757590}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &6962989256011107501

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ed7ee58626f3e454da1ee905c792503a
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -72,6 +72,38 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_entityLinked: {fileID: 8585520847943034727}
--- !u!1 &3780396010419979768
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8332730521900469995}
m_Layer: 0
m_Name: Wrapper
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8332730521900469995
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3780396010419979768}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.5, y: 0.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6962989255883535387}
m_Father: {fileID: 6962989255644195631}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &6962989255035248094
GameObject:
m_ObjectHideFlags: 0
@ -421,7 +453,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6962989256011107500}
- {fileID: 6962989255883535387}
- {fileID: 8332730521900469995}
- {fileID: 71124047072817123}
m_Father: {fileID: 0}
m_RootOrder: 0
@ -699,8 +731,8 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6962989255883535386}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.006, y: -0.464, z: 0}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.006000042, y: -0.464, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@ -710,8 +742,8 @@ Transform:
- {fileID: 6962989255885988242}
- {fileID: 6962989256565824838}
- {fileID: 6962989256410121263}
m_Father: {fileID: 6962989255644195631}
m_RootOrder: 1
m_Father: {fileID: 8332730521900469995}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!95 &6962989255883535384
Animator:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 64c72bd54322341478cf0e9cf7b42ea4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,35 @@
using UnityEngine;
using System.Collections.Generic;
public class #SCRIPTNAME# : LevelTile
{
public override void LevelStart()
{
//executes when object is added to level manager
}
public override void LevelUpdate()
{
//executes when level manager updates
}
public override void LevelDestroy()
{
//executes when object is removed from level manager
}
public override bool Equals(ILevelObject other)
{
var isEqual = base.Equals(other);
//add important code to differentiate this tile from another similar tile
return isEqual;
}
public override Dictionary<string, object> ToDictionary()
{
var dict = base.ToDictionary();
//add variables you would like to serialize to the dictionary
return dict;
}
public override void LoadDictionary(Dictionary<string, object> dict)
{
base.LoadDictionary(dict);
//fetch variables you would like to deserialize from the dictionary.
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9c60920f50a80c3479cad04a716e2bf2
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,35 @@
using UnityEngine;
using System.Collections.Generic;
public class #SCRIPTNAME# : LevelObject
{
public override void LevelStart()
{
//executes when object is added to level manager
}
public override void LevelUpdate()
{
//executes when level manager updates
}
public override void LevelDestroy()
{
//executes when object is removed from level manager
}
public override bool Equals(ILevelObject other)
{
var isEqual = base.Equals(other);
//add important code to differentiate this tile from another similar tile
return isEqual;
}
public override Dictionary<string, object> ToDictionary()
{
var dict = base.ToDictionary();
//add variables you would like to serialize to the dictionary
return dict;
}
public override void LoadDictionary(Dictionary<string, object> dict)
{
base.LoadDictionary(dict);
//fetch variables you would like to deserialize from the dictionary.
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f24f74dad4f23744b9e6bd9096544251
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,80 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class DraggablePlaceholder : MonoBehaviour
{
[SerializeField]
protected Color _validColor = Color.green;
[SerializeField]
protected Color _invalidColor = Color.red;
[SerializeField]
protected Transform _outline;
protected Camera _mainCamCache;
protected Rect _lvlBoundsCache;
protected bool _isOnValidPosition;
protected virtual void Start()
{
_mainCamCache = Camera.main;
_lvlBoundsCache = LevelManager.Instance.CurrentLevel.CalculateBounds();
_lvlBoundsCache.xMax += 1;
_lvlBoundsCache.yMax += 1;
UpdatePosition();
}
protected virtual void Update()
{
if (!Input.GetMouseButton(0))
{
if (_isOnValidPosition)
{
Place();
}
Destroy(gameObject);
}
UpdatePosition();
_isOnValidPosition = CanBePlacedHere();
ShowValidity();
}
protected virtual void UpdatePosition()
{
var mousePos = Vector3Int.RoundToInt(_mainCamCache.ScreenToWorldPoint(Input.mousePosition) - new Vector3(0.5f, 0.5f));
mousePos.z = 0;
if (!_lvlBoundsCache.Contains(mousePos)) return;
transform.position = mousePos;
}
/// <summary>
/// helps determine if a unit can be placed on the tile sitting at unit's position (out of bound? obstacle? invalid tile?<br/>
/// default behaviour is : you cant place a tile over an already existing tile
/// </summary>
public virtual bool CanBePlacedHere()
{
return !LevelManager.Instance.Has<ILevelObject>(obj => obj.Position.Approximately(transform.position));
}
/// <summary>
/// how your character will appear depending on the validity of the tile you want to put them on<br/>
/// default behaviour is changes color of all sprite renderers (this one and children) to red if invalid, green otherwise
/// </summary>
/// <param name="isValidPosition"></param>
/// <returns></returns>
public virtual void ShowValidity()
{
Color getColor() => _isOnValidPosition ? _validColor : _invalidColor;
foreach (var child in _outline.GetComponentsInChildren<SpriteRenderer>(true))
{
Debug.Log(child.name);
child.color = getColor();
}
}
public abstract void Place();
}

View File

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

View File

@ -3,9 +3,40 @@ using System.Collections.Generic;
using BindingFlags = System.Reflection.BindingFlags;
using UnityEngine;
using System.Collections;
using GatherAndDefend.LevelEditor;
public static class Extensions
{
public static Rect CalculateBounds(this Level level)
{
Rect bound = new Rect(0, 0, 0, 0);
foreach (var tilemap in level)
{
foreach (var tile in tilemap)
{
bound = bound.GetUpdatedBound((Vector3)tile.Position);
}
}
return bound;
}
public static Rect GetUpdatedBound(this Rect bound, Rect other)
{
var rect = bound;
rect.xMin = other.xMin < rect.xMin ? other.xMin : rect.xMin;
rect.yMin = other.yMin < rect.yMin ? other.yMin : rect.yMin;
rect.xMax = other.xMax > rect.xMax ? other.xMax : rect.xMax;
rect.yMax = other.yMax > rect.yMax ? other.yMax : rect.yMax;
return rect;
}
public static Rect GetUpdatedBound(this Rect bound, Vector2 position)
{
var rect = bound;
rect.xMin = position.x < rect.xMin ? position.x : rect.xMin;
rect.yMin = position.y < rect.yMin ? position.y : rect.yMin;
rect.xMax = position.x > rect.xMax ? position.x : rect.xMax;
rect.yMax = position.y > rect.yMax ? position.y : rect.yMax;
return rect;
}
public static int ToInt(this object jobj)
{
return int.Parse(jobj.ToString());

View File

@ -7,6 +7,8 @@ namespace GatherAndDefend.LevelEditor
{
public class Level : ScriptableObject, IEnumerable<TilemapData>
{
private Rect _bounds;
public Rect Bounds => _bounds;
[SerializeField]
private List<TilemapData> _data = new List<TilemapData>();
public void SaveFromTilemap(Tilemap tilemap)

View File

@ -27,7 +27,6 @@ namespace GatherAndDefend.LevelEditor
[SerializeField]
private string _renderLayer;
public string Key => _key;
public void LoadToTilemap(Tilemap reference)
@ -48,6 +47,11 @@ namespace GatherAndDefend.LevelEditor
reference.SetTile(data.Position, data.Tile);
}
}
/// <summary>
/// saves a tilemap into the level object
/// </summary>
/// <param name="reference"></param>
/// <returns>the bounds of the tilemap</returns>
public void SaveFromTilemap(Tilemap reference)
{
_key = reference.name;
@ -62,7 +66,7 @@ namespace GatherAndDefend.LevelEditor
_tiles = new List<TileData>();
BoundsInt bounds = reference.cellBounds;
for (int i = bounds.xMin; i <= bounds.xMax; i++)
{

View File

@ -21,6 +21,9 @@ public class LevelManager : Singleton<LevelManager>
private readonly List<ILevelObject> _toRemove;
private readonly List<ILevelObject> _levelObjects;
private Level _currentLevel;
public Level CurrentLevel => _currentLevel;
public Transform LevelTransform
{
get;
@ -75,6 +78,7 @@ public class LevelManager : Singleton<LevelManager>
#endregion
#region [Level management]
public void UpdateLevel()
{
_levelObjects.ForEach(levelObject => levelObject.LevelUpdate());

View File

@ -1,7 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static Extensions;
/// <summary>
/// can be inherited by MonoBehaviours in order to be added to the level manager

View File

@ -0,0 +1,11 @@
using UnityEngine;
public class ObjectDraggablePlaceholder : DraggablePlaceholder
{
[SerializeField]
private GameObject _prefab;
public override void Place()
{
var instance = Instantiate(_prefab, transform.position, Quaternion.identity);
}
}

View File

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

View File

@ -0,0 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class UnitPlacementButton : MonoBehaviour, IPointerDownHandler
{
[SerializeField, Tooltip("the gameobject we will drag")]
private GameObject placeholder;
public void OnPointerDown(PointerEventData eventData)
{
Instantiate(placeholder);
}
}

View File

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

View File

@ -43,3 +43,6 @@ TagManager:
- name: Default
uniqueID: 0
locked: 0
- name: Character
uniqueID: 364159097
locked: 0