Skip to content

Commit 44a9df7

Browse files
committed
upgrade to 2019.4.25f1, add BreakOnCollision script (to break object when it falls/hits something), adjust scripts to reduce GC, fix object rotation, add copy rigidbody properties (velocity, angular, mass, usegravity), add namespace, add 2nd example texture
1 parent c974025 commit 44a9df7

25 files changed

+1016
-245
lines changed

.vsconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": "1.0",
3+
"components": [
4+
"Microsoft.VisualStudio.Workload.ManagedGame"
5+
]
6+
}

Assets/Materials/UV_Debug.mat

4.16 KB
Binary file not shown.

Assets/Materials/UV_Debug.mat.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
2.46 KB
Binary file not shown.

Assets/Resources.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Resources/BillingMode.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"androidStore":"GooglePlay"}

Assets/Resources/BillingMode.json.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
9.14 KB
Binary file not shown.

Assets/Scripts/BreakOnCollision.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using Unitycoder.Demos;
4+
using UnityEngine;
5+
6+
namespace Unitycoder.Demos
7+
{
8+
public class BreakOnCollision : MonoBehaviour
9+
{
10+
[Tooltip("Collision impact threshold")]
11+
public float breakForce = 10f;
12+
13+
private void OnCollisionEnter(Collision collision)
14+
{
15+
if (collision.relativeVelocity.magnitude > breakForce)
16+
{
17+
// NOTE this can cause pieces to fly too much..
18+
SimpleMeshExploder.instance.Explode(transform);
19+
}
20+
}
21+
}
22+
}

Assets/Scripts/BreakOnCollision.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)