50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using SoulGames.EasyGridBuilderPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering;
|
|
using UnityEngine.Rendering.PostProcessing;
|
|
using Bloom = UnityEngine.Rendering.Universal.Bloom;
|
|
|
|
public class ChangeBuildMode : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private EasyGridBuilderPro gridBuilder;
|
|
|
|
private PostProcessingManager volume;
|
|
private Bloom bloomEffect;
|
|
private Color orgColor;
|
|
|
|
void Start()
|
|
{
|
|
volume = Singleton<PostProcessingManager>.Instance;
|
|
volume._globalVolume.profile.TryGet(out bloomEffect);
|
|
orgColor = bloomEffect.tint.value;
|
|
Debug.Log(orgColor);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.R))
|
|
{
|
|
|
|
|
|
if (gridBuilder.showEditorAndRuntimeCanvasGrid)
|
|
{
|
|
gridBuilder.showEditorAndRuntimeCanvasGrid = false;
|
|
bloomEffect.tint.value = orgColor;
|
|
}
|
|
else
|
|
{
|
|
gridBuilder.showEditorAndRuntimeCanvasGrid = true;
|
|
bloomEffect.tint.value = new Color(0.0f , 0.0f, 1.0f);
|
|
}
|
|
}
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && gridBuilder.showEditorAndRuntimeCanvasGrid)
|
|
{
|
|
gridBuilder.showEditorAndRuntimeCanvasGrid = false;
|
|
bloomEffect.tint.value = orgColor;
|
|
}
|
|
}
|
|
}
|