HUGE CHANGES !!!!Add Assembly definitions for code!!!!

This commit is contained in:
xpeng
2022-07-26 15:36:43 +02:00
parent 642f28b29c
commit 54c392fb39
43 changed files with 152 additions and 0 deletions
@@ -0,0 +1,37 @@
using System;
using System.Runtime.InteropServices;
using UnityEngine;
using WindowsInput.Native;
public class PanelThirdPersonButton : MonoBehaviour
{
public bool isTP;
private Renderer cr;
public GameObject tpCamera;
public AudioSource audioSrc;
void Start()
{
cr = GetComponent<Renderer>();
if (JsonConfiguration.HasKey("ThirdPerson")) SetTP(JsonConfiguration.GetBoolean("ThirdPerson"));
else SetTP(isTP);
}
private void OnTriggerEnter(Collider other)
{
audioSrc.Play();
isTP = !isTP;
SetTP(isTP);
}
private void SetTP(bool state)
{
isTP = state;
cr.material.color = state ? Color.green : Color.red;
tpCamera?.SetActive(state);
JsonConfiguration.SetBoolean("ThirdPerson", state);
}
}