Skip to content

Commit

Permalink
Added Debug options for trailer
Browse files Browse the repository at this point in the history
  • Loading branch information
Saarg committed Apr 12, 2018
1 parent 516304e commit 7fc4bbf
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 19 deletions.
39 changes: 28 additions & 11 deletions Assets/Prefabs/Players/Player.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ GameObject:
- component: {fileID: 20293041392594200}
- component: {fileID: 124036514755073772}
- component: {fileID: 81223102895397238}
- component: {fileID: 114360012375058894}
- component: {fileID: 114516611077830756}
- component: {fileID: 114988907256552528}
- component: {fileID: 114360012375058894}
- component: {fileID: 114161477090624786}
m_Layer: 11
m_Name: Main Camera
m_TagString: MainCamera
Expand Down Expand Up @@ -272,7 +273,7 @@ AudioListener:
m_Enabled: 1
--- !u!114 &114048573908616452
MonoBehaviour:
m_ObjectHideFlags: 11
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1096707078535530}
Expand All @@ -284,7 +285,7 @@ MonoBehaviour:
_guid: 5b6349f9-8b79-4038-911a-8c83073b89b6
--- !u!114 &114061414602267784
MonoBehaviour:
m_ObjectHideFlags: 11
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1096497640146390}
Expand All @@ -296,7 +297,7 @@ MonoBehaviour:
_guid: 855f9602-d4f1-4f5e-9cb1-f58dcea40f7a
--- !u!114 &114132935520477524
MonoBehaviour:
m_ObjectHideFlags: 11
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1448668148569392}
Expand All @@ -306,9 +307,25 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_guid: 27f8e1ed-2a8d-4aca-b13e-651c12a1c343
--- !u!114 &114161477090624786
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1114446238097744}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5342b947a76d81546a9687e353859871, type: 3}
m_Name:
m_EditorClassIdentifier:
cameraSensitivity: 90
climbSpeed: 4
normalMoveSpeed: 10
slowMoveFactor: 0.25
fastMoveFactor: 3
--- !u!114 &114196350624596130
MonoBehaviour:
m_ObjectHideFlags: 11
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1095541610783580}
Expand Down Expand Up @@ -391,7 +408,7 @@ MonoBehaviour:
shootingController: {fileID: 114870713405615198}
--- !u!114 &114418166092139924
MonoBehaviour:
m_ObjectHideFlags: 11
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1038169052092530}
Expand All @@ -416,7 +433,7 @@ MonoBehaviour:
_assetGuid: 348fba6018b964493b39dea78c3a8176
--- !u!114 &114418756626441182
MonoBehaviour:
m_ObjectHideFlags: 11
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1215295761401924}
Expand Down Expand Up @@ -670,7 +687,7 @@ MonoBehaviour:
spawnPos: {x: 0, y: 0, z: 0}
--- !u!114 &114630188458626750
MonoBehaviour:
m_ObjectHideFlags: 11
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1853750504817478}
Expand Down Expand Up @@ -752,7 +769,7 @@ MonoBehaviour:
slider: {fileID: 114541582252936868}
--- !u!114 &114791753397003742
MonoBehaviour:
m_ObjectHideFlags: 11
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1399350855392520}
Expand All @@ -764,7 +781,7 @@ MonoBehaviour:
_guid: 47560898-c8b6-4227-82ca-cea9d6cd3c8d
--- !u!114 &114792738334932170
MonoBehaviour:
m_ObjectHideFlags: 11
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1038169052092530}
Expand All @@ -790,7 +807,7 @@ MonoBehaviour:
weapon: {fileID: 0}
--- !u!114 &114988907256552528
MonoBehaviour:
m_ObjectHideFlags: 11
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1114446238097744}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scenes/_Dungeon/_Dungeon01.unity
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 138916520}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_IndirectSpecularColor: {r: 0.02783398, g: 0.061925624, b: 0.103044674, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
Expand Down
24 changes: 21 additions & 3 deletions Assets/Scripts/CheatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ void Update () {
} else if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.M)) {
PlayerController pc = gameUI.GetPlayerController();
pc.curMana = pc.maxMana;
}
else if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.C))
} else if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.C))
{
PlayerController pc = gameUI.GetPlayerController();
pc.cam.GetComponent<CameraControl>().SetInverse(inverse);
Expand All @@ -47,7 +46,26 @@ void Update () {
inverse = true;
}

}
} else if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.Z))
{
PlayerController pc = gameUI.GetPlayerController();

pc.cam.transform.SetParent(null);

pc.cam.GetComponent<CameraControl>().enabled = false;
pc.cam.GetComponent<FreeCamera>().enabled = true;
} else if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.V))
{
PlayerController pc = gameUI.GetPlayerController();

pc.cam.transform.SetParent(pc.transform);

pc.cam.GetComponent<CameraControl>().enabled = true;
pc.cam.GetComponent<FreeCamera>().enabled = false;
} else if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.U))
{
gameUI.gameObject.SetActive(!gameUI.gameObject.activeSelf);
}
}

if (graphy != null && Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.D)) {
Expand Down
67 changes: 67 additions & 0 deletions Assets/Scripts/FreeCamera.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FreeCamera : MonoBehaviour {

/*
EXTENDED FLYCAM
Desi Quintans (CowfaceGames.com), 17 August 2012.
Based on FlyThrough.js by Slin (http://wiki.unity3d.com/index.php/FlyThrough), 17 May 2011.
LICENSE
Free as in speech, and free as in beer.
FEATURES
Arrows: Movement
Q: Climb
E: Drop
Shift: Move faster
Control: Move slower
End: Toggle cursor locking to screen (you can also press Ctrl+P to toggle play mode on and off).
*/

public float cameraSensitivity = 90;
public float climbSpeed = 4;
public float normalMoveSpeed = 10;
public float slowMoveFactor = 0.25f;
public float fastMoveFactor = 3;

private float rotationX = 0.0f;
private float rotationY = 0.0f;

void Update ()
{
rotationX += Input.GetAxis("Mouse X") * cameraSensitivity * Time.deltaTime;
rotationY += Input.GetAxis("Mouse Y") * cameraSensitivity * Time.deltaTime;
rotationY = Mathf.Clamp (rotationY, -90, 90);

transform.localRotation = Quaternion.AngleAxis(rotationX, Vector3.up);
transform.localRotation *= Quaternion.AngleAxis(rotationY, Vector3.left);

if (Input.GetKey (KeyCode.LeftShift) || Input.GetKey (KeyCode.RightShift))
{
transform.position += transform.forward * (normalMoveSpeed * fastMoveFactor) * Input.GetAxis("VerticalFreeCam") * Time.deltaTime;
transform.position += transform.right * (normalMoveSpeed * fastMoveFactor) * Input.GetAxis("HorizontalFreeCam") * Time.deltaTime;
}
else if (Input.GetKey (KeyCode.LeftControl) || Input.GetKey (KeyCode.RightControl))
{
transform.position += transform.forward * (normalMoveSpeed * slowMoveFactor) * Input.GetAxis("VerticalFreeCam") * Time.deltaTime;
transform.position += transform.right * (normalMoveSpeed * slowMoveFactor) * Input.GetAxis("HorizontalFreeCam") * Time.deltaTime;
}
else
{
transform.position += transform.forward * normalMoveSpeed * Input.GetAxis("VerticalFreeCam") * Time.deltaTime;
transform.position += transform.right * normalMoveSpeed * Input.GetAxis("HorizontalFreeCam") * Time.deltaTime;
}


if (Input.GetKey (KeyCode.Q)) {transform.position += transform.up * climbSpeed * Time.deltaTime;}
if (Input.GetKey (KeyCode.E)) {transform.position -= transform.up * climbSpeed * Time.deltaTime;}

if (Input.GetKeyDown (KeyCode.End))
{
Screen.lockCursor = (Screen.lockCursor == false) ? true : false;
}
}
}
13 changes: 13 additions & 0 deletions Assets/Scripts/FreeCamera.cs.meta

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

40 changes: 36 additions & 4 deletions ProjectSettings/InputManager.asset
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ InputManager:
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
negativeButton:
positiveButton:
altNegativeButton: a
altPositiveButton: d
gravity: 3
Expand All @@ -21,12 +21,28 @@ InputManager:
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: HorizontalFreeCam
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
altNegativeButton:
altPositiveButton:
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
negativeButton:
positiveButton:
altNegativeButton: s
altPositiveButton: w
gravity: 3
Expand All @@ -37,6 +53,22 @@ InputManager:
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: VerticalFreeCam
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
altNegativeButton:
altPositiveButton:
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire1
descriptiveName:
Expand Down

0 comments on commit 7fc4bbf

Please sign in to comment.