Browse Source

Room create

Виктор Шейко 5 years ago
parent
commit
3059dbb319

+ 8 - 7
Assets/Materials/Ground.mat

@@ -9,12 +9,13 @@ Material:
   m_PrefabAsset: {fileID: 0}
   m_Name: Ground
   m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
-  m_ShaderKeywords: _EMISSION
+  m_ShaderKeywords: _ALPHABLEND_ON _EMISSION
   m_LightmapFlags: 1
   m_EnableInstancingVariants: 0
   m_DoubleSidedGI: 0
-  m_CustomRenderQueue: -1
-  stringTagMap: {}
+  m_CustomRenderQueue: 3000
+  stringTagMap:
+    RenderType: Transparent
   disabledShaderPasses: []
   m_SavedProperties:
     serializedVersion: 3
@@ -59,20 +60,20 @@ Material:
     - _BumpScale: 1
     - _Cutoff: 0.5
     - _DetailNormalMapScale: 1
-    - _DstBlend: 0
+    - _DstBlend: 10
     - _EmissionScaleUI: 0
     - _GlossMapScale: 1
     - _Glossiness: 0
     - _GlossyReflections: 1
     - _Metallic: 0
-    - _Mode: 0
+    - _Mode: 2
     - _OcclusionStrength: 1
     - _Parallax: 0.02
     - _SmoothnessTextureChannel: 0
     - _SpecularHighlights: 1
-    - _SrcBlend: 1
+    - _SrcBlend: 5
     - _UVSec: 0
-    - _ZWrite: 1
+    - _ZWrite: 0
     m_Colors:
     - _Color: {r: 1, g: 1, b: 1, a: 1}
     - _EmissionColor: {r: 0, g: 0, b: 0, a: 0}

+ 15 - 1
Assets/Resources/GameObjects/Cube.prefab

@@ -18,7 +18,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!4 &7472118420328169210
 Transform:
   m_ObjectHideFlags: 0
@@ -195,6 +195,7 @@ GameObject:
   serializedVersion: 6
   m_Component:
   - component: {fileID: 7472118420504627703}
+  - component: {fileID: -2210416392163931611}
   m_Layer: 0
   m_Name: Cube
   m_TagString: Untagged
@@ -222,6 +223,19 @@ Transform:
   m_Father: {fileID: 0}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!65 &-2210416392163931611
+BoxCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7472118420504627702}
+  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!1 &7472118420774028791
 GameObject:
   m_ObjectHideFlags: 0

+ 3 - 3
Assets/Resources/GameObjects/Pole.prefab

@@ -27,8 +27,8 @@ Transform:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 8002323672054192881}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 5, y: 0, z: 9}
-  m_LocalScale: {x: 0.1, y: 0.6, z: 0.1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 0.1, y: 1, z: 0.1}
   m_Children: []
   m_Father: {fileID: 0}
   m_RootOrder: 0
@@ -59,7 +59,7 @@ MeshRenderer:
   m_RenderingLayerMask: 1
   m_RendererPriority: 0
   m_Materials:
-  - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
+  - {fileID: 2100000, guid: ebf40fc9dabfac1418d520d4c17e77fd, type: 2}
   m_StaticBatchInfo:
     firstSubMesh: 0
     subMeshCount: 0

File diff suppressed because it is too large
+ 1293 - 143
Assets/Scenes/Editor2D.unity


+ 0 - 14
Assets/Scenes/Editor3D.unity

@@ -225,7 +225,6 @@ GameObject:
   - component: {fileID: 163821093}
   - component: {fileID: 163821092}
   - component: {fileID: 163821091}
-  - component: {fileID: 163821090}
   m_Layer: 5
   m_Name: Canvas
   m_TagString: Untagged
@@ -233,19 +232,6 @@ GameObject:
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
   m_IsActive: 1
---- !u!114 &163821090
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 163821089}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 860fde6ca36e6c342a732c4a2dbb9cbb, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  mousePointer: {fileID: 0}
 --- !u!114 &163821091
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 27 - 6
Assets/Scripts/Components/Room.cs

@@ -5,9 +5,9 @@ using UnityEngine;
 
 public class Room : MonoBehaviour
 {
-    public float Height = 1f;
+    public float Height = 0.5f;
     public int Rounding = 1;
-    public bool move = false;
+    public bool move = true;
     public bool BoxColliderEnabled = true;
     //GameObject cursor_end;
 
@@ -15,6 +15,7 @@ public class Room : MonoBehaviour
     private Vector3 offset;
     private Vector3 curScreenPoint;
     private Vector3 curPosition;
+    private Vector3 start_pos = Vector3.zero;
 
     // Start is called before the first frame update
     void Start()
@@ -27,6 +28,7 @@ public class Room : MonoBehaviour
     void Update()
     {
         if (gameObject.GetComponent<BoxCollider>().enabled != BoxColliderEnabled) gameObject.GetComponent<BoxCollider>().enabled = BoxColliderEnabled;
+
     }
 
     void OnMouseDown()
@@ -44,10 +46,29 @@ public class Room : MonoBehaviour
         curScreenPoint = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z);
         curPosition = Camera.main.ScreenToWorldPoint(curScreenPoint) + offset;
         var x = (float)Math.Round(curPosition.x, Rounding);
-        var z = (float)Math.Round(curPosition.z, Rounding);  
-        //transform.position = new Vector3(x, Height, z);
-        gameObject.GetComponent<BoxCollider>().size = new Vector3(x, Height, z);
+        var z = (float)Math.Round(curPosition.z, Rounding); 
+        var boxCollider = gameObject.GetComponent<BoxCollider>();
+        if (!move)
+        {
+           
+            //transform.position = new Vector3(x, Height, z);
+            
+             boxCollider.size = new Vector3(x, Height, z);
+            
+            LocationController.Cube(gameObject, new Vector3(x, z, Height), new Vector2(start_pos.x, start_pos.z));
+        }
+        else
+        {
+            start_pos = new Vector3(x, Height, z);
+            transform.position = start_pos;
+            var size = boxCollider.size;
+            start_pos = new Vector3(x - size.x/2, Height, z - size.z / 2);
+        }
+        
+    }
 
-        LocationController.Cube(gameObject, new Vector3(x, z, Height));
+    private void OnMouseUp()
+    {
+        if (move) move = false;
     }
 }

+ 1 - 0
Assets/Scripts/Controllers/Editor2DController.cs

@@ -63,6 +63,7 @@ public class Editor2DController : MonoBehaviour
 
         button.name = $"BeaconButton_{Beacons.Count}";
         button.transform.SetParent(BeaconsContent.transform);
+        button.transform.GetChild(0).GetComponent<Text>().text = $"Маяк_{Beacons.Count}";
         Beacons.Add(new Beacon { id = (uint)Beacons.Count, beacon = beacon, button = button });
     }
 }

+ 3 - 1
ProjectSettings/GraphicsSettings.asset

@@ -3,7 +3,7 @@
 --- !u!30 &1
 GraphicsSettings:
   m_ObjectHideFlags: 0
-  serializedVersion: 12
+  serializedVersion: 13
   m_Deferred:
     m_Mode: 1
     m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
@@ -38,6 +38,7 @@ GraphicsSettings:
   - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
   - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
   - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
+  - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
   m_PreloadedShaders: []
   m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
     type: 0}
@@ -63,3 +64,4 @@ GraphicsSettings:
   m_LightsUseLinearIntensity: 0
   m_LightsUseColorTemperature: 0
   m_LogWhenShaderIsCompiled: 0
+  m_AllowEnlightenSupportForUpgradedProject: 1