-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Camera Tests are now on separate scene. * ZS-40, 41 complete * Points can now be removed * Added tests for adding and removing points * Added unity editor check blocks so build can go through * Camera moves to specific Transition Point on Spacebar press * ZS-42 Player can touch zone to trigger transition to specific point * Added test to make sure camera moves to correct listed point * Transition Zones can swap between two Transition Points * Transition Zones now toggle between two points and move camera to them * ZS-43 Complete
- Loading branch information
1 parent
297698b
commit 8c01f27
Showing
10 changed files
with
766 additions
and
29 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#if UNITY_EDITOR | ||
using UnityEngine; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEditor; | ||
|
||
[CustomEditor(typeof(CameraMover))] | ||
public class TransitionEditor : Editor | ||
{ | ||
private CameraMover cM; | ||
private ScreenTransition sT; | ||
private Camera mainCam; | ||
|
||
private void OnEnable() | ||
{ | ||
// Method 1 | ||
cM = (CameraMover) target; | ||
mainCam = Camera.main; | ||
sT = mainCam.GetComponent<ScreenTransition>(); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
if (GUILayout.Button("Add Point")) | ||
{ | ||
cM.AddPoint(sT.transitionPoint); | ||
} | ||
|
||
if (GUILayout.Button("Remove Last Point")) | ||
{ | ||
cM.RemoveLastPoint(); | ||
} | ||
|
||
// Draw default inspector after button... | ||
base.OnInspectorGUI(); | ||
} | ||
} | ||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class TransitionZone : MonoBehaviour | ||
{ | ||
public int pointOne; | ||
public int pointTwo; | ||
public ScreenTransition.transitionTypes type; | ||
bool swap = false; | ||
|
||
// begin transition on collision with player only | ||
void OnTriggerEnter2D(Collider2D col) | ||
{ | ||
if (col.tag == "Player") | ||
{ | ||
if(!Camera.main.GetComponent<CameraMover>().m_moving) | ||
{ | ||
if (!swap) | ||
{ | ||
Camera.main.GetComponent<CameraMover>().StartMovement(pointOne, type); | ||
} | ||
else | ||
{ | ||
Camera.main.GetComponent<CameraMover>().StartMovement(pointTwo, type); | ||
} | ||
|
||
swap = !swap; | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters