Skip to content
Snippets Groups Projects
Commit ab88c991 authored by MaZiFAU's avatar MaZiFAU
Browse files

Bug Fixes; Refactored stuff;

Bug Fixes:
+adjustet Gadget layerMask & logic (layerIgnore -> layer Hit)
+repaired crossline selection
+Adjusted Layers for tree-snapzones & Boundary Walls

Refactored:
+WorldCurser: SnappLogic
+other things
parent 183a09c6
No related branches found
No related tags found
No related merge requests found
Showing
with 67 additions and 89 deletions
......@@ -111,7 +111,7 @@ GameObject:
- component: {fileID: 7455726115425455088}
- component: {fileID: 933372636075482527}
- component: {fileID: 539717056228735193}
m_Layer: 16
m_Layer: 20
m_Name: TopSnapZone
m_TagString: SnapZone
m_Icon: {fileID: 0}
......
......@@ -112,7 +112,7 @@ GameObject:
- component: {fileID: 4646352123586789184}
- component: {fileID: 6011793418505273338}
- component: {fileID: 5015158088123139087}
m_Layer: 19
m_Layer: 20
m_Name: TopSnapZone
m_TagString: SnapZone
m_Icon: {fileID: 0}
......
......@@ -112,13 +112,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, type: 3}
m_Name:
m_EditorClassIdentifier:
_URI:
FactText: []
StringLabelFormats: []
renderer: []
Default: {fileID: 0}
Selected: {fileID: 0}
Hint: {fileID: 0}
Solution: {fileID: 0}
renderer:
- {fileID: 5284903402926663935}
- {fileID: 1078883255209641429}
Default: {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2}
Selected: {fileID: 2100000, guid: 34a95baef388bb8458c97a626b732f9f, type: 2}
Hint: {fileID: 2100000, guid: 8621b710d7d1d5041bc6bfd0cc37cdff, type: 2}
Solution: {fileID: 2100000, guid: 2a003f0807acc1142965bb21bdc824f6, type: 2}
--- !u!1 &4682201382595328041
GameObject:
m_ObjectHideFlags: 0
......@@ -397,13 +400,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, type: 3}
m_Name:
m_EditorClassIdentifier:
_URI:
FactText: []
StringLabelFormats: []
renderer: []
Default: {fileID: 0}
Selected: {fileID: 0}
Hint: {fileID: 0}
Solution: {fileID: 0}
renderer:
- {fileID: 1078883255209641429}
- {fileID: 5284903402926663935}
Default: {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2}
Selected: {fileID: 2100000, guid: 34a95baef388bb8458c97a626b732f9f, type: 2}
Hint: {fileID: 2100000, guid: 8621b710d7d1d5041bc6bfd0cc37cdff, type: 2}
Solution: {fileID: 2100000, guid: 2a003f0807acc1142965bb21bdc824f6, type: 2}
--- !u!1 &6839596689016440457
GameObject:
m_ObjectHideFlags: 0
......@@ -470,6 +476,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, type: 3}
m_Name:
m_EditorClassIdentifier:
_URI:
FactText: []
StringLabelFormats: []
renderer:
......
......@@ -288,6 +288,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, type: 3}
m_Name:
m_EditorClassIdentifier:
_URI:
FactText: []
StringLabelFormats: []
renderer:
......@@ -495,6 +496,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, type: 3}
m_Name:
m_EditorClassIdentifier:
_URI:
FactText:
- {fileID: 1254072669719294581}
StringLabelFormats:
......
......@@ -2624,7 +2624,7 @@ GameObject:
- component: {fileID: 139953605}
- component: {fileID: 139953604}
- component: {fileID: 139953603}
m_Layer: 0
m_Layer: 2
m_Name: Cube (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -3870,7 +3870,7 @@ Mesh:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: pb_Mesh26262
m_Name: pb_Mesh1141600
serializedVersion: 10
m_SubMeshes:
- serializedVersion: 2
......@@ -4283,7 +4283,7 @@ PrefabInstance:
- target: {fileID: 5974816098015535063, guid: e289bf5debb17f6459818c207d781953,
type: 3}
propertyPath: m_Layer
value: 16
value: 20
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e289bf5debb17f6459818c207d781953, type: 3}
......@@ -32763,7 +32763,7 @@ GameObject:
- component: {fileID: 1560940263}
- component: {fileID: 1560940262}
- component: {fileID: 1560940261}
m_Layer: 0
m_Layer: 2
m_Name: Cube (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -33425,7 +33425,7 @@ GameObject:
- component: {fileID: 1593527563}
- component: {fileID: 1593527562}
- component: {fileID: 1593527561}
m_Layer: 0
m_Layer: 2
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -36234,7 +36234,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1738359117}
m_Layer: 0
m_Layer: 2
m_Name: Boarders
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -36811,7 +36811,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 1777335750}
m_Layer: 0
m_Layer: 2
m_Name: Walls
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -54270,7 +54270,7 @@ GameObject:
- component: {fileID: 1911980458}
- component: {fileID: 1911980457}
- component: {fileID: 1911980456}
m_Layer: 0
m_Layer: 2
m_Name: Cube (4)
m_TagString: Untagged
m_Icon: {fileID: 0}
......@@ -55581,18 +55581,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 04a4ac0a27312d04787dc2494b7aa690, type: 3}
m_Name:
m_EditorClassIdentifier:
URI:
materials:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
renderer: []
cascade: []
Default: {fileID: 0}
Selected: {fileID: 0}
Hint: {fileID: 0}
Solution: {fileID: 0}
_URI:
repeat: 1
original: 1
--- !u!1001 &1970241703
......@@ -18,9 +18,9 @@ MonoBehaviour:
UiName: Angle Tool
MaterialIndx: 1
ButtonIndx: 3
IgnoreLayerMask:
LayerHitMask:
serializedVersion: 2
m_Bits: 391718
m_Bits: 1024
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 0
......@@ -13,6 +13,6 @@ public class DataContainerGadgetInit : ScriptableObject
public int MaterialIndx = 0;
public int ButtonIndx = 0;
public LayerMask IgnoreLayerMask;
public LayerMask LayerHitMask;
public LayerMask SecondaryLayerMask;
}
\ No newline at end of file
......@@ -16,7 +16,11 @@ MonoBehaviour:
MaxRange: Infinity
MaxHeight: Infinity
UiName: Not Defined
ButtonSprite: {fileID: 21300000, guid: f4c84b8f318e3cb469eb72c734ccbf39, type: 3}
IgnoreLayerMask:
MaterialIndx: 0
ButtonIndx: 0
LayerHitMask:
serializedVersion: 2
m_Bits: 1637393
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 0
......@@ -18,9 +18,9 @@ MonoBehaviour:
UiName: Not Defined
MaterialIndx: 0
ButtonIndx: 9
IgnoreLayerMask:
LayerHitMask:
serializedVersion: 2
m_Bits: 802342
m_Bits: 49152
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 0
......@@ -27,18 +27,6 @@ MonoBehaviour:
- {fileID: 21300000, guid: d456617ba2282854d9570dcebcc2b279, type: 3}
- {fileID: 21300000, guid: e35797aede3d7bd449ca9195a409b0cc, type: 3}
- {fileID: 21300000, guid: 9831128faf2531e4cba52f58894091be, type: 3}
GadgetNames:
- undefined
- Point Tool
- Tape Tool
- Angle Tool
- Line Tool
- Lot Tool
- Pendulum
- Pole Tool
- Remover
- Equal Circles
- Middle Point
GadgetType: ffffffff00000000010000000200000003000000040000000500000006000000070000000800000009000000
GadgetData:
- {fileID: 11400000, guid: 7431ff31b707d2a4082b65b61e15e5df, type: 2}
......
......@@ -18,9 +18,9 @@ MonoBehaviour:
UiName: Line Tool
MaterialIndx: 0
ButtonIndx: 4
IgnoreLayerMask:
LayerHitMask:
serializedVersion: 2
m_Bits: 391714
m_Bits: 1024
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 0
......@@ -18,9 +18,9 @@ MonoBehaviour:
UiName: Lot Tool
MaterialIndx: 0
ButtonIndx: 5
IgnoreLayerMask:
LayerHitMask:
serializedVersion: 2
m_Bits: 365090
m_Bits: 535553
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 0
......@@ -18,9 +18,9 @@ MonoBehaviour:
UiName: Middle Point Tool
MaterialIndx: 0
ButtonIndx: 10
IgnoreLayerMask:
LayerHitMask:
serializedVersion: 2
m_Bits: 326178
m_Bits: 1024
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 0
......@@ -18,9 +18,9 @@ MonoBehaviour:
UiName: Pendulum
MaterialIndx: 0
ButtonIndx: 6
IgnoreLayerMask:
LayerHitMask:
serializedVersion: 2
m_Bits: 391714
m_Bits: 1024
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 1
......@@ -18,9 +18,9 @@ MonoBehaviour:
UiName: Pointer
MaterialIndx: 0
ButtonIndx: 1
IgnoreLayerMask:
LayerHitMask:
serializedVersion: 2
m_Bits: 269858
m_Bits: 1572913
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 0
......@@ -18,9 +18,9 @@ MonoBehaviour:
UiName: Pole
MaterialIndx: 0
ButtonIndx: 7
IgnoreLayerMask:
LayerHitMask:
serializedVersion: 2
m_Bits: 391714
m_Bits: 525313
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 32769
m_Bits: 524289
......@@ -18,9 +18,9 @@ MonoBehaviour:
UiName: Delete Fact
MaterialIndx: 0
ButtonIndx: 8
IgnoreLayerMask:
LayerHitMask:
serializedVersion: 2
m_Bits: 328243
m_Bits: 64512
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 0
......@@ -18,9 +18,9 @@ MonoBehaviour:
UiName: Tape
MaterialIndx: 0
ButtonIndx: 2
IgnoreLayerMask:
LayerHitMask:
serializedVersion: 2
m_Bits: 391714
m_Bits: 1024
SecondaryLayerMask:
serializedVersion: 2
m_Bits: 0
......@@ -3,7 +3,11 @@ guid: 626c435b76e0d334f959ede8b54b07ac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
defaultReferences:
- Default: {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2}
- Selected: {fileID: 2100000, guid: 34a95baef388bb8458c97a626b732f9f, type: 2}
- Hint: {fileID: 2100000, guid: 8621b710d7d1d5041bc6bfd0cc37cdff, type: 2}
- Solution: {fileID: 2100000, guid: 2a003f0807acc1142965bb21bdc824f6, type: 2}
executionOrder: 0
icon: {instanceID: 0}
userData:
......
......@@ -2,10 +2,7 @@
using System.Collections;
using TMPro;
using UnityEngine;
using UnityEngine.UIElements;
using UnityStandardAssets.Vehicles.Car;
using static CommunicationEvents;
using static GlobalBehaviour;
public class FactSpawner : MonoBehaviour
{
......@@ -59,7 +56,6 @@ public void SpawnPoint(PointFact fact)
GameObject point = GameObject.Instantiate(Sphere);
point.GetComponent<FactObject>().URI = fact.Id;
point.transform.SetPositionAndRotation(fact.Position, fact.Rotation);
//point.GetComponentInChildren<TextMeshPro>().text = fact.Label;
fact.Representation = point;
}
......@@ -95,37 +91,29 @@ public void SpawnRay(RayFact fact)
line.transform.GetChild(0).localScale = fact.LocalScale;
line.transform.GetChild(0).rotation = fact.Rotation;
//line.GetComponentInChildren<TextMeshPro>().text = fact.Label;
fact.Representation = line;
}
//Spawn an angle: point with id = angleFact.Pid2 is the point where the angle gets applied
public void SpawnAngle(AbstractAngleFact fact)
{
Vector3 Psotion = fact.Position;
Quaternion Rotation = fact.Rotation;
float angleValue = fact.angle;
//Change FactRepresentation to Angle
GameObject angle = GameObject.Instantiate(Angle);
angle.GetComponentInChildren<FactObject>().URI = fact.Id;
//Place the Angle at position of point2
angle.transform.SetPositionAndRotation(Psotion, Rotation);
angle.transform.SetPositionAndRotation(fact.Position, fact.Rotation);
//Set text of angle
TextMeshPro[] texts = angle.GetComponentsInChildren<TextMeshPro>();
foreach (TextMeshPro t in texts)
{
//Change Text not to the id, but to the angle-value (from both sides)
t.text = Math.Round(angleValue, 2) + "°";
t.text = Math.Round((float)fact.angle, 2) + "°";
}
//Generate angle mesh
CircleSegmentGenerator[] segments = angle.GetComponentsInChildren<CircleSegmentGenerator>();
foreach (CircleSegmentGenerator c in segments)
c.setAngle(angleValue);
c.setAngle((float)fact.angle);
fact.Representation = angle;
}
......@@ -136,7 +124,6 @@ public void SpawnRingAndCircle(CircleFact fact)
SpawnRing(fact, ringAndCircleGO.transform);
SpawnCircle(fact, ringAndCircleGO.transform);
//Move Ring to middlePoint
ringAndCircleGO.transform.SetPositionAndRotation(fact.Position, fact.Rotation);
fact.Representation = ringAndCircleGO;
......@@ -149,10 +136,7 @@ public void SpawnRing(CircleFact circleFact, Transform parent = null)
var tori = ring.GetComponentsInChildren<TorusGenerator>();
foreach (var torus in tori)
torus.torusRadius = circleFact.radius;
//var tmpText = ring.GetComponentInChildren<TextMeshPro>();
//tmpText.text = $"○{circleFact.Point1.Label}";
torus.torusRadius = circleFact.radius + (float)Math3d.vectorPrecission;
}
public void SpawnCircle(CircleFact circleFact, Transform parent = null)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment