Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
using System.Xml; | ||
|
||
public class Platformer : SceneLoadingMiniGame { | ||
|
||
void OnGUI() { | ||
if (GUILayout.Button("test")) { | ||
MiniGameController.endMiniGame("firstPuzzleRecur"); | ||
} | ||
} | ||
} | ||
using UnityEngine; | ||
using System.Collections; | ||
using System.Xml; | ||
|
||
public class Platformer : SceneLoadingMiniGame { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class EndNode : MonoBehaviour { | ||
public float difficulty; | ||
|
||
private Ending ending; | ||
public Ending Ending { | ||
set { | ||
ending = value; | ||
renderer.material.color = ending.color; | ||
} | ||
get { | ||
return ending; | ||
} | ||
} | ||
|
||
public void notifyEnd() { | ||
MiniGameController.endMiniGame(ending.edgeId); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
using System.Linq; | ||
|
||
public class PipePlatformer : Platformer { | ||
protected override void onMyLevelLoaded () | ||
{ | ||
Ending[] endings = Ending.findEndings(data).OrderBy<Ending, float>(x => x.difficulty).ToArray(); | ||
EndNode[] nodes = FindObjectsOfType(typeof(EndNode)).Cast<EndNode>().OrderBy<EndNode, float>(x => x.difficulty).ToArray(); | ||
if (nodes.Length != endings.Length) { | ||
Debug.LogWarning(Application.loadedLevelName + " is only designed to handle " + nodes.Length.ToString() + " endings"); | ||
} | ||
for (int i = 0; i < nodes.Length && i < endings.Length; i++) { | ||
nodes[i].Ending = endings[i]; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
|
||
public class RisingWaterEnding : CollisionManager { | ||
public float speed; | ||
|
||
public override void manageCollision (CollisionData data) | ||
{ | ||
PipeController other = data.other.GetComponent<PipeController>(); | ||
if (other != null) { | ||
other.kill(GetComponent<EndNode>().Ending.edgeId); | ||
} | ||
} | ||
|
||
void FixedUpdate() { | ||
Vector3 pos = transform.position; | ||
pos.y += speed * Time.deltaTime; | ||
transform.position = pos; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.