Navigation Menu

Skip to content

Commit

Permalink
Fixing merged scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
msutton22 committed Nov 15, 2018
1 parent b14b665 commit 04069b1
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 47 deletions.
6 changes: 3 additions & 3 deletions .idea/.idea.KatamariClone/.idea/contentModel.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

107 changes: 70 additions & 37 deletions .idea/.idea.KatamariClone/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Assets/Scenes/ClearyScene.unity
Expand Up @@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641252, b: 0.574817, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
Expand Down Expand Up @@ -1323,15 +1323,15 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 96d91f7777a124b9ba8ba5abae9e17b6, type: 3}
m_Name:
m_EditorClassIdentifier:
collector: {fileID: 803545599}
collector2: {fileID: 4856629}
maxSpeed: 150
minSpeed: 0
speed: 100
acceleration: 2
turn: 0.5
rbObject: {fileID: 0}
bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
originalBallDiameter: {fileID: 1500530833}
originalBallDiameter: {fileID: 0}
--- !u!135 &1500530833
SphereCollider:
m_ObjectHideFlags: 0
Expand Down
7 changes: 5 additions & 2 deletions Assets/scripts/ballBehavior.cs
Expand Up @@ -14,14 +14,15 @@ public class ballBehavior : MonoBehaviour
public float turn; //turn amount
private float massBall; //mass of the ball as it grows
private float collectMass = 2; //mass of collectables

public Bounds bounds;
public SphereCollider originalBallDiameter;

private Rigidbody rb;

void Start ()
{
rb = GetComponent<Rigidbody>(); //getting rigidbody of ball

bounds = originalBallDiameter.bounds;
}


Expand Down Expand Up @@ -65,6 +66,8 @@ void OnCollisionEnter(Collision col)
massBall += collectMass; //mass collected is added to variable
Destroy(col.rigidbody); //getting rid of the rigidbody on collectable
col.transform.parent = transform; //parenting object to ball

bounds.Encapsulate(transform.localScale + col.transform.localScale);

}

Expand Down

0 comments on commit 04069b1

Please sign in to comment.