Skip to content

Commit

Permalink
Merge branch 'release/0.3.4-alpha.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
griffinteller committed Jul 13, 2020
2 parents 7a9de4a + c6b1753 commit 1df5131
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 31 deletions.
8 changes: 4 additions & 4 deletions Assets/Prefab/Part/Building/BasicTire.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ BoxCollider:
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.31299046, y: 0.9060723, z: 0.9030622}
m_Center: {x: 0, y: 0, z: 0}
m_Size: {x: 0.31299046, y: 0.9229157, z: 0.9030622}
m_Center: {x: 0, y: -0.22177482, z: 0}
--- !u!114 &5573408519385158023
MonoBehaviour:
m_ObjectHideFlags: 0
Expand All @@ -217,8 +217,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f2211cf0b3c94b189ae6cc6794db361b, type: 3}
m_Name:
m_EditorClassIdentifier:
removable: 1
partName: BasicTire
mass: 20
partName: BasicTire
removable: 1
collider: {fileID: 2160681236945319564}
tireName:
19 changes: 17 additions & 2 deletions Assets/Prefab/Part/Play/BasicTire.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ GameObject:
- component: {fileID: 3923196539191495623}
- component: {fileID: 3226723001406992128}
- component: {fileID: 4734048834668821019}
- component: {fileID: 8195048015080138190}
m_Layer: 0
m_Name: BasicTire
m_TagString: Untagged
Expand Down Expand Up @@ -235,8 +236,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 782460a61c9c454b9fda77e87e8e3e01, type: 3}
m_Name:
m_EditorClassIdentifier:
innerMesh: {fileID: 212465993580246236}
_tireComponent: {fileID: 4734048834668821019}
innerMesh: {fileID: 212465993580246236}
tireMeshRoot: {fileID: 0}
wheelCollider: {fileID: 0}
--- !u!114 &4734048834668821019
Expand All @@ -251,5 +252,19 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1416999b371041a993ba1d4cc6fa7c56, type: 3}
m_Name:
m_EditorClassIdentifier:
bearing: 0
baseSteerAngle: 0
bearing: 0
WheelCollider: {fileID: 0}
--- !u!65 &8195048015080138190
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5299458965186968501}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.3406933, y: 0.42197776, z: 0.9126946}
m_Center: {x: 0, y: 0, z: 0}
24 changes: 1 addition & 23 deletions Assets/Scripts/Main/DesignLoaderPlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Building;
using Photon.Pun;
using UnityEngine;
using Utility;

namespace Main
{
Expand All @@ -29,28 +30,6 @@ public void BuildRobotRpc(object data)
BuildRobot(structure);
}

private void ReplaceColliders()
{
var newColliderRelativeBounds = new Bounds(Vector3.zero, Vector3.zero);
var buffer = new Vector3(1, 0, 1) * 2 * ColliderBuffer;

foreach (var boxCollider in structureRoot.GetComponentsInChildren<BoxCollider>())
{
var colliderBounds = new Bounds(
boxCollider.transform.localPosition,
boxCollider.size + buffer);

newColliderRelativeBounds.Encapsulate(colliderBounds);

Destroy(boxCollider);
}

var newBoxCollider = structureRoot.gameObject.AddComponent<BoxCollider>();
newBoxCollider.center = Vector3.zero;
newBoxCollider.size = newColliderRelativeBounds.size;
_robotRigidbody.centerOfMass = Vector3.zero;
}

public void BuildRobot(RobotStructure structure = null)
{
LoadPartListIntoDict();
Expand All @@ -62,7 +41,6 @@ public void BuildRobot(RobotStructure structure = null)
}

CreateParts(structure);
ReplaceColliders();

robotMain.OnPartsLoaded();
}
Expand Down
5 changes: 5 additions & 0 deletions Assets/Scripts/Utility/MetaUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,10 @@ public static void DestroyImmediateAllChildren(GameObject gameObject)
foreach (Transform child in gameObject.transform)
UnityEngine.Object.DestroyImmediate(child.gameObject);
}

public static Vector3 Vector3Abs(Vector3 vector)
{
return new Vector3(Mathf.Abs(vector.x), Mathf.Abs(vector.y), Mathf.Abs(vector.y));
}
}
}
2 changes: 1 addition & 1 deletion ProjectSettings/EditorBuildSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ EditorBuildSettings:
- enabled: 1
path: Assets/Scenes/BuildScene.unity
guid: d950b2e5c72befc4798a2812dd7fa1fb
- enabled: 1
- enabled: 0
path: Assets/Scenes/NewMainMenu.unity
guid: dd1b1c3cdb239af45af5bc3baf78e8c5
m_configObjects:
Expand Down
1 change: 1 addition & 0 deletions ProjectSettings/GraphicsSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ GraphicsSettings:
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 0.3.4-dev.4
bundleVersion: 0.3.4-alpha.1
preloadedAssets:
- {fileID: 0}
- {fileID: 0}
Expand Down

0 comments on commit 1df5131

Please sign in to comment.