@@ -23,6 +23,7 @@ class PracticeModManager : MonoBehaviour
2323 public ResizeScript resizeScript ;
2424 public Text playerText ;
2525 public Text grabbedObejctText ;
26+ public PauseMenu pauseMenu ;
2627
2728
2829 Vector3 storedPosition ;
@@ -51,13 +52,17 @@ void Awake()
5152 debugFunctions = false ;
5253 GameManager . GM . GetComponent < LevelInformation > ( ) . LevelInfo . RandomLoadingScreens = new SceneReference [ 1 ] { GameManager . GM . GetComponent < LevelInformation > ( ) . LevelInfo . NormalLoadingScreen } ;
5354
55+ base . gameObject . AddComponent < SLPMod_Console > ( ) ;
56+
5457 }
5558
5659
5760
5861
5962 void Update ( )
6063 {
64+ if ( Input . GetKeyDown ( KeyCode . F11 ) )
65+ SLPMod_Console . instance . Toggle ( ) ;
6166
6267 if ( Input . GetKeyDown ( KeyCode . F12 ) )
6368 {
@@ -66,6 +71,8 @@ void Update()
6671 performanceGraph . gameObject . SetActive ( ! performanceGraph . gameObject . activeSelf ) ;
6772 }
6873
74+ GameManager . GM . enableDebugFunctions = debugFunctions ;
75+
6976 if ( GameManager . GM . player == null )
7077 return ;
7178
@@ -75,6 +82,7 @@ void Update()
7582 playerMotor = player . GetComponent < CharacterMotor > ( ) ;
7683 playerCamera = player . GetComponentInChildren < Camera > ( ) ;
7784 resizeScript = playerCamera . GetComponent < ResizeScript > ( ) ;
85+ pauseMenu = GameObject . Find ( "UI_PAUSE_MENU" ) . GetComponentInChildren < PauseMenu > ( true ) ;
7886 defaultFarClipPlane = playerCamera . farClipPlane ;
7987 if ( player . transform . Find ( "Flashlight" ) == null )
8088 {
@@ -101,7 +109,7 @@ void Update()
101109 grabbedObejctText = NewGrabbedObjectText ( ) ;
102110 }
103111
104- GameManager . GM . enableDebugFunctions = debugFunctions ;
112+ SLPMod_Console . instance . active = false ;
105113 }
106114
107115
@@ -210,7 +218,9 @@ Text NewPlayerText()
210218 Text newText ;
211219 GameObject gameObject = new GameObject ( "PlayerText" ) ;
212220 gameObject . transform . parent = GameObject . Find ( "UI_PAUSE_MENU" ) . transform . Find ( "Canvas" ) ;
213- gameObject . AddComponent < CanvasGroup > ( ) . interactable = false ;
221+ CanvasGroup cg = gameObject . AddComponent < CanvasGroup > ( ) ;
222+ cg . interactable = false ;
223+ cg . blocksRaycasts = false ;
214224 newText = gameObject . AddComponent < Text > ( ) ;
215225 RectTransform component = newText . GetComponent < RectTransform > ( ) ;
216226 component . sizeDelta = new Vector2 ( ( float ) ( Screen . currentResolution . width / 3 ) , ( float ) ( Screen . currentResolution . height / 3 ) ) ;
@@ -236,7 +246,9 @@ Text NewGrabbedObjectText()
236246 Text newText ;
237247 GameObject gameObject = new GameObject ( "GrabbedObjectText" ) ;
238248 gameObject . transform . parent = GameObject . Find ( "UI_PAUSE_MENU" ) . transform . Find ( "Canvas" ) ;
239- gameObject . AddComponent < CanvasGroup > ( ) . interactable = false ;
249+ CanvasGroup cg = gameObject . AddComponent < CanvasGroup > ( ) ;
250+ cg . interactable = false ;
251+ cg . blocksRaycasts = false ;
240252 newText = gameObject . AddComponent < Text > ( ) ;
241253 RectTransform component = newText . GetComponent < RectTransform > ( ) ;
242254 component . sizeDelta = new Vector2 ( ( float ) ( Screen . currentResolution . width / 3 ) , ( float ) ( Screen . currentResolution . height / 3 ) ) ;
@@ -362,5 +374,19 @@ void RestartMap()
362374 GameManager . GM . GetComponent < SaveAndCheckpointManager > ( ) . RestartLevel ( ) ;
363375 }
364376
377+ public void Teleport ( Vector3 position )
378+ {
379+ if ( GameManager . GM . player == null )
380+ return ;
381+
382+ playerMotor . transform . position = position ;
383+ }
384+
385+ public void Scale ( float newScale )
386+ {
387+ if ( GameManager . GM . player != null && newScale > 0.0001f )
388+ playerMotor . transform . localScale = new Vector3 ( newScale , newScale , newScale ) ;
389+ }
390+
365391 }
366392}
0 commit comments