Skip to content

Commit

Permalink
Fixed bugs related to the force teleport inclusion
Browse files Browse the repository at this point in the history
Fixed a bug (caused by an oversight) that let Merky teleport out of
range

Fixed the first tutorial level's milestones, and removed the default
MilestoneActivator from the activator on the milestone
  • Loading branch information
shieldgenerator7 committed Mar 29, 2016
1 parent d8a0cdf commit f97a463
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 39 deletions.
18 changes: 17 additions & 1 deletion Assets/Prefabs/merky.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ GameObject:
- 50: {fileID: 5068768}
- 60: {fileID: 6075330}
- 114: {fileID: 11477714}
- 114: {fileID: 11469308}
m_Layer: 0
m_Name: merky
m_TagString: Player
Expand Down Expand Up @@ -179,6 +180,22 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
parentObj: {fileID: 100086}
--- !u!114 &11469308
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100086}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f16f92f62c03f9d49ae9349cf322432d, type: 3}
m_Name:
m_EditorClassIdentifier:
forceRangeIndicator: {fileID: 138864, guid: d1311c9898ad32f488aea19cdc7d519c, type: 2}
maxForceAmount: 5000
forceAmount: 10
maxRange: 3
maxHoldTime: 1
--- !u!114 &11477714
MonoBehaviour:
m_ObjectHideFlags: 1
Expand All @@ -199,7 +216,6 @@ MonoBehaviour:
gravityImmuneTime: 0
gravityImmuneTimeAmount: 0.15
gGIDCinit: 2
forceAmount: 5000
teleportStreak: {fileID: 133468, guid: a76ac723dbf060e4fae65f29bcb058d9, type: 2}
teleportStar: {fileID: 127114, guid: 84842629c9b04df48a7cd79dca5c22e9, type: 2}
useStreak: 0
Expand Down
16 changes: 0 additions & 16 deletions Assets/Prefabs/milestone.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ GameObject:
m_Component:
- 4: {fileID: 442900}
- 61: {fileID: 6172966}
- 114: {fileID: 11461082}
m_Layer: 2
m_Name: activator
m_TagString: Untagged
Expand Down Expand Up @@ -128,21 +127,6 @@ BoxCollider2D:
m_Offset: {x: 0.03673044, y: 0.86855584}
serializedVersion: 2
m_Size: {x: 3.5271711, y: 1.6241728}
--- !u!114 &11461082
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 189458}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a77eff73c7195a449aee8cb3f17a7d28, type: 3}
m_Name:
m_EditorClassIdentifier:
incrementAmount: 1
particle: {fileID: 127114, guid: 84842629c9b04df48a7cd79dca5c22e9, type: 2}
starAmount: 100
starSpawnDuration: 25
--- !u!212 &21290114
SpriteRenderer:
m_ObjectHideFlags: 1
Expand Down
125 changes: 105 additions & 20 deletions Assets/Scenes/TutScene01b.unity
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_RootOrder
value: 20
value: 21
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_LocalScale.z
Expand All @@ -248,15 +248,16 @@ Prefab:
propertyPath: m_SortingOrder
value: -1
objectReference: {fileID: 0}
- target: {fileID: 11461082, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
- target: {fileID: 0}
propertyPath: starAmount
value: 25
objectReference: {fileID: 0}
- target: {fileID: 11461082, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
- target: {fileID: 0}
propertyPath: starSpawnDuration
value: 25
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedComponents:
- {fileID: 0}
m_ParentPrefab: {fileID: 100100000, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &8027019
Expand Down Expand Up @@ -2196,7 +2197,7 @@ Transform:
- {fileID: 317005405}
- {fileID: 468988936}
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 11
--- !u!4 &261908643 stripped
Transform:
m_PrefabParentObject: {fileID: 499288, guid: 8eb4ed9bb79bb4247b0cbfea87b4ca60, type: 2}
Expand Down Expand Up @@ -2470,14 +2471,14 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_RootOrder
value: 2
value: 3
objectReference: {fileID: 0}
- target: {fileID: 158788, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_Name
value: milestone (1)
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 11461082, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
- {fileID: 0}
m_ParentPrefab: {fileID: 100100000, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
m_IsPrefabParent: 0
--- !u!1 &281115434 stripped
Expand Down Expand Up @@ -3426,7 +3427,7 @@ Transform:
- {fileID: 579175700}
- {fileID: 1821304904}
m_Father: {fileID: 0}
m_RootOrder: 22
m_RootOrder: 23
--- !u!1001 &357525196
Prefab:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -4226,7 +4227,7 @@ Transform:
- {fileID: 756351077}
- {fileID: 777229661}
m_Father: {fileID: 0}
m_RootOrder: 13
m_RootOrder: 14
--- !u!1 &468732022
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -4257,7 +4258,7 @@ Transform:
- {fileID: 1560051713}
- {fileID: 1557328853}
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 7
--- !u!1001 &468988935
Prefab:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -4494,6 +4495,25 @@ SpriteRenderer:
Transform:
m_PrefabParentObject: {fileID: 409136, guid: 61d77a5c634a9db4186a94e82dca7230, type: 2}
m_PrefabInternal: {fileID: 1724361717}
--- !u!1 &480606322 stripped
GameObject:
m_PrefabParentObject: {fileID: 189458, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
m_PrefabInternal: {fileID: 6041994}
--- !u!114 &480606324
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 480606322}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0a93a0f8d2eb6f245a19966391be64af, type: 3}
m_Name:
m_EditorClassIdentifier:
incrementAmount: 1
particle: {fileID: 127114, guid: 84842629c9b04df48a7cd79dca5c22e9, type: 2}
starAmount: 25
starSpawnDuration: 25
--- !u!4 &482358207 stripped
Transform:
m_PrefabParentObject: {fileID: 409136, guid: 61d77a5c634a9db4186a94e82dca7230, type: 2}
Expand Down Expand Up @@ -4962,7 +4982,7 @@ Transform:
- {fileID: 54686649}
- {fileID: 1695327873}
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 13
--- !u!1001 &542166941
Prefab:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -7196,7 +7216,7 @@ Transform:
- {fileID: 578509817}
- {fileID: 1098054432}
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 12
--- !u!4 &777229661 stripped
Transform:
m_PrefabParentObject: {fileID: 499288, guid: 8eb4ed9bb79bb4247b0cbfea87b4ca60, type: 2}
Expand Down Expand Up @@ -8451,7 +8471,7 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_RootOrder
value: 18
value: 19
objectReference: {fileID: 0}
- target: {fileID: 158788, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_Name
Expand All @@ -8474,7 +8494,7 @@ Prefab:
value: 1.6241729
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 11461082, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
- {fileID: 0}
m_ParentPrefab: {fileID: 100100000, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
m_IsPrefabParent: 0
--- !u!1 &942130222 stripped
Expand Down Expand Up @@ -9929,7 +9949,7 @@ Transform:
- {fileID: 1523889299}
- {fileID: 1244690057}
m_Father: {fileID: 0}
m_RootOrder: 23
m_RootOrder: 24
--- !u!1001 &1180744196
Prefab:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -11607,7 +11627,7 @@ Transform:
- {fileID: 1159679351}
- {fileID: 487482568}
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 9
--- !u!4 &1359859493 stripped
Transform:
m_PrefabParentObject: {fileID: 409136, guid: 61d77a5c634a9db4186a94e82dca7230, type: 2}
Expand Down Expand Up @@ -13296,7 +13316,7 @@ Transform:
- {fileID: 13049417}
- {fileID: 678140310}
m_Father: {fileID: 0}
m_RootOrder: 24
m_RootOrder: 25
--- !u!1 &1560051712
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -13471,6 +13491,71 @@ Prefab:
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 8eb4ed9bb79bb4247b0cbfea87b4ca60, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1575373452
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_LocalPosition.x
value: 175.728
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_LocalPosition.y
value: 83.64415
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 434974, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 158788, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
propertyPath: m_Name
value: milestone (3)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1575373453 stripped
GameObject:
m_PrefabParentObject: {fileID: 189458, guid: a45652d8eb5429b44995a922e3a41a6a, type: 2}
m_PrefabInternal: {fileID: 1575373452}
--- !u!114 &1575373454
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1575373453}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4a2c20f1d5a0a704c84da17386adc689, type: 3}
m_Name:
m_EditorClassIdentifier:
incrementAmount: 1
particle: {fileID: 127114, guid: 84842629c9b04df48a7cd79dca5c22e9, type: 2}
starAmount: 25
starSpawnDuration: 25
--- !u!1001 &1577718701
Prefab:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -14677,7 +14762,7 @@ Transform:
- {fileID: 1280319359}
- {fileID: 1086639573}
m_Father: {fileID: 0}
m_RootOrder: 20
m_RootOrder: 22
--- !u!1 &1705151999
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -15630,7 +15715,7 @@ Transform:
- {fileID: 1653302414}
- {fileID: 1303998619}
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 8
--- !u!1001 &1822096076
Prefab:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -17866,7 +17951,7 @@ Transform:
- {fileID: 1316260797}
- {fileID: 1395504645}
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 10
--- !u!1001 &2094075320
Prefab:
m_ObjectHideFlags: 0
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/GestureManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void Update () {
}
else if (isTapGesture)
{
plrController.teleport(curMPWorld);
plrController.processTapGesture(curMPWorld);
}

//Set all flags = false
Expand Down
10 changes: 10 additions & 0 deletions Assets/Scripts/MilestoneActivatorAirport.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using UnityEngine;

public class MilestoneActivatorAirport : MilestoneActivator
{//2016-03-29: copied from MilestoneActivatorForceTeleport

public override void activateEffect()
{
playerObject.GetComponent<PlayerController>().maxAirPorts += incrementAmount;
}
}
12 changes: 12 additions & 0 deletions Assets/Scripts/MilestoneActivatorAirport.cs.meta

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

8 changes: 7 additions & 1 deletion Assets/Scripts/PlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void FixedUpdate()
//{
//}

public bool teleport(Vector3 targetPos)//targetPos is in world coordinations (NOT UI coordinates)
private bool teleport(Vector3 targetPos)//targetPos is in world coordinations (NOT UI coordinates)
{
if (teleportTime <= Time.time)
{
Expand Down Expand Up @@ -409,6 +409,12 @@ bool isOccupied(Vector3 pos)
return false;//nope, it's not occupied
}

public void processTapGesture(Vector3 gpos)
{
Vector3 newPos = findTeleportablePosition(gpos);
teleport(newPos);
}

public void processHoldGesture(Vector3 gpos, float holdTime, bool finished)
{
if (fta.enabled)
Expand Down

0 comments on commit f97a463

Please sign in to comment.