Firstborn/Assets/Scripts/LargeMapHandler.cs
Schaken-Mods 902e38d0ab Fixed the Color picker and added hairs
The color picker would reset every time you clicked away, - fixed. Added some hairs. I seem to have an issue with them lining up, I will have to fiddle with this.
2023-04-08 02:11:54 -05:00

80 lines
2.5 KiB
C#

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;
}
/*
//- 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"));
*/
}
public void Rotate() {
}
public void Zoom() {
// Cam.GetComponent<Camera>().orthographicSize += Input.GetAxis("Mouse ScrollWheel");
}
public void UpdateMapPosition() {
Vector3 NewPosition = Player.position;
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);
}
}