mirror of
https://github.com/DerTyp7/industrialize-unity.git
synced 2025-11-01 13:52:31 +01:00
buffer space
This commit is contained in:
@@ -302,6 +302,10 @@ MonoBehaviour:
|
|||||||
maxTimeAlive: 600
|
maxTimeAlive: 600
|
||||||
maxTimeWithoutConveyor: 10
|
maxTimeWithoutConveyor: 10
|
||||||
timeWithoutConveyor: 0
|
timeWithoutConveyor: 0
|
||||||
|
lastTouchedConveyor: {fileID: 0}
|
||||||
|
conveyorSpeed: 0
|
||||||
|
conveyorDirection: {x: 0, y: 0}
|
||||||
|
currentConveyor: {fileID: 0}
|
||||||
--- !u!61 &3180622400512972912
|
--- !u!61 &3180622400512972912
|
||||||
BoxCollider2D:
|
BoxCollider2D:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -326,7 +330,7 @@ BoxCollider2D:
|
|||||||
adaptiveTiling: 0
|
adaptiveTiling: 0
|
||||||
m_AutoTiling: 0
|
m_AutoTiling: 0
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Size: {x: 0.5, y: 0.5}
|
m_Size: {x: 0.1, y: 0.1}
|
||||||
m_EdgeRadius: 0
|
m_EdgeRadius: 0
|
||||||
--- !u!50 &3996583985504607898
|
--- !u!50 &3996583985504607898
|
||||||
Rigidbody2D:
|
Rigidbody2D:
|
||||||
|
|||||||
@@ -59,28 +59,25 @@ public abstract class ItemObject : MonoBehaviour
|
|||||||
{
|
{
|
||||||
Vector3 tempPivotPosition = transform.position;
|
Vector3 tempPivotPosition = transform.position;
|
||||||
|
|
||||||
|
float bufferSpace = 0.1f;
|
||||||
if (conveyorDirection == Vector2.up) // Up
|
if (conveyorDirection == Vector2.up) // Up
|
||||||
{
|
{
|
||||||
Debug.Log("Up");
|
tempPivotPosition = transform.position + new Vector3(transform.localScale.x / 2, bufferSpace, 0);
|
||||||
tempPivotPosition = transform.position + new Vector3(transform.localScale.x / 2, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conveyorDirection == Vector2.right) // Right
|
if (conveyorDirection == Vector2.right) // Right
|
||||||
{
|
{
|
||||||
Debug.Log("Right");
|
tempPivotPosition = transform.position + new Vector3(bufferSpace, transform.localScale.y / 2, 0);
|
||||||
tempPivotPosition = transform.position + new Vector3(0, transform.localScale.y / 2, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conveyorDirection == Vector2.down) // Down
|
if (conveyorDirection == Vector2.down) // Down
|
||||||
{
|
{
|
||||||
Debug.Log("Down");
|
tempPivotPosition = transform.position + new Vector3(transform.localScale.x / 2, transform.localScale.y - bufferSpace, 0);
|
||||||
tempPivotPosition = transform.position + new Vector3(transform.localScale.x / 2, transform.localScale.y, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conveyorDirection == Vector2.left) // Left
|
if (conveyorDirection == Vector2.left) // Left
|
||||||
{
|
{
|
||||||
Debug.Log("Left");
|
tempPivotPosition = transform.position + new Vector3(transform.localScale.x - bufferSpace, transform.localScale.y / 2, 0);
|
||||||
tempPivotPosition = transform.position + new Vector3(transform.localScale.x, transform.localScale.y / 2, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tempPivotPosition;
|
return tempPivotPosition;
|
||||||
|
|||||||
Reference in New Issue
Block a user