2023-03-28 13:16:30 -04:00
using System.Collections ;
using System.Collections.Generic ;
using UnityEngine ;
using RPGCreationKit.Player ;
using RPGCreationKit ;
using UnityEngine.UI ;
public class LargeMapHandler : MonoBehaviour
{
public GameObject Map ;
public Transform Player ;
public GameObject Stats ;
public GameObject CompassBar ;
public Transform MapCompass ;
public Camera Cam ;
public Camera FPC ;
public Camera TPC ;
public Slider ADJZoom ;
public Slider ADJRot ;
public Slider ADJXAxis ;
public Slider ADJZAxis ;
public void ToggleMap ( ) {
if ( Map . activeSelf ) {
RckInput . input . SwitchCurrentActionMap ( "Player" ) ;
RckPlayer . instance . mouseLook . LockCursor ( ) ;
Cam . cullingMask = 0 ;
if ( RckPlayer . instance . isInThirdPerson = = true ) {
TPC . cullingMask = 1283383 ;
} else {
FPC . cullingMask = 1283895 ;
}
CompassBar . SetActive ( true ) ;
Map . SetActive ( false ) ;
Stats . SetActive ( true ) ;
RenderSettings . fog = true ;
} else {
Vector3 NewPosition = Player . position ;
NewPosition . y = transform . position . y ;
ADJZAxis . value = NewPosition . z ;
ADJXAxis . value = NewPosition . x ;
transform . position = NewPosition ;
RckInput . input . SwitchCurrentActionMap ( "LargeMapMenu" ) ;
RckPlayer . instance . mouseLook . UnlockCursor ( ) ;
Cam . cullingMask = 1413393 ;
FPC . cullingMask = 0 ;
TPC . cullingMask = 0 ;
CompassBar . SetActive ( false ) ;
Map . SetActive ( true ) ;
Stats . SetActive ( false ) ;
RenderSettings . fog = false ;
}
2023-04-08 03:11:54 -04:00
/ *
2023-03-28 13:16:30 -04:00
//- To get Map Mask
Debug . Log ( "Map Mask: " + LayerMask . GetMask ( "Default" , "Water" , "Player" , "NPC" , "PostProcessing" , "Terrain" , "MapMarker" , "GenerateNavmesh" ) ) ;
//- To get first person Camera Mask
Debug . Log ( "First person Mask: " + LayerMask . GetMask ( "Default" , "TransparentFX" , "Ignore Raycast" , "Water" , "UI" , "Player" , "FirstPerson" , "Projectile" , "NPC" , "PostProcessing" , "Terrain" , "ItemInWorld" , "GenerateNavmesh" ) ) ;
//- To get Third person Camera Mask
Debug . Log ( "Third person Mask: " + LayerMask . GetMask ( "Default" , "TransparentFX" , "Ignore Raycast" , "Water" , "UI" , "Player" , "Projectile" , "NPC" , "PostProcessing" , "Terrain" , "ItemInWorld" , "GenerateNavmesh" ) ) ;
2023-04-08 03:11:54 -04:00
* /
2023-03-28 13:16:30 -04:00
}
public void Rotate ( ) {
}
public void Zoom ( ) {
// Cam.GetComponent<Camera>().orthographicSize += Input.GetAxis("Mouse ScrollWheel");
}
public void UpdateMapPosition ( ) {
2023-04-08 03:11:54 -04:00
Vector3 NewPosition = Player . position ;
2023-03-28 13:16:30 -04:00
NewPosition . z = ADJZAxis . value ;
NewPosition . x = ADJXAxis . value ;
transform . position = NewPosition ;
transform . rotation = Quaternion . Euler ( 70.0f , ADJRot . value , 0f ) ;
MapCompass . rotation = Quaternion . Euler ( 0f , 0f , ADJRot . value ) ;
}
}