64 lines
2.3 KiB
C#
64 lines
2.3 KiB
C#
|
using Thousandto.Code.Global;
|
|||
|
using Thousandto.Code.Logic;
|
|||
|
using Thousandto.Code.Logic.WarningField;
|
|||
|
using Thousandto.Core.Asset;
|
|||
|
|
|||
|
using Thousandto.Core.Base;
|
|||
|
using Thousandto.Core.PostEffect;
|
|||
|
using Thousandto.Plugins.Common.UniScene;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using UnityEditor;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace Thousandto.DIY.UniScene
|
|||
|
{
|
|||
|
class FlyEditorCamera
|
|||
|
{
|
|||
|
public static CameraControl Camera = null;
|
|||
|
public static RadiaBlur RadiaBlurEffect = null;
|
|||
|
public static GaussBlur GaussBlurEffect = null;
|
|||
|
public static VFXCameraShaker CameraShaker = null;
|
|||
|
public static Bloom BloomEffect = null;
|
|||
|
|
|||
|
public static float BlinkStartValue = 0f;
|
|||
|
public static float BlinkEndValue = 0f;
|
|||
|
public static float BlinkLifeTime = 0f;
|
|||
|
public static float BlinkTimer = 0f;
|
|||
|
public static bool BlinkIng = false;
|
|||
|
|
|||
|
public static bool CreateCamera(bool editorCamera = true)
|
|||
|
{
|
|||
|
var cameraRoot = GameObject.Find("EditorCameraRoot");
|
|||
|
if (cameraRoot == null)
|
|||
|
{
|
|||
|
cameraRoot = new GameObject("EditorCameraRoot");
|
|||
|
var cameraGo = new GameObject("EditorCamera");
|
|||
|
cameraGo.transform.parent = cameraRoot.transform;
|
|||
|
|
|||
|
Camera = UnityUtils.RequireComponent<CameraControl>(cameraRoot);
|
|||
|
var camera = UnityUtils.RequireComponent<Camera>(cameraGo);
|
|||
|
camera.tag = "MainCamera";
|
|||
|
camera.clearFlags = CameraClearFlags.Skybox;
|
|||
|
camera.renderingPath = RenderingPath.Forward;
|
|||
|
camera.fieldOfView = 35;
|
|||
|
|
|||
|
RadiaBlurEffect = UnityUtils.RequireComponent<RadiaBlur>(cameraGo);
|
|||
|
RadiaBlurEffect.enabled = false;
|
|||
|
GaussBlurEffect = UnityUtils.RequireComponent<GaussBlur>(cameraGo);
|
|||
|
GaussBlurEffect.enabled = false;
|
|||
|
BloomEffect = UnityUtils.RequireComponent<Bloom>(cameraGo);
|
|||
|
BloomEffect.enabled = true;
|
|||
|
|
|||
|
CameraShaker = UnityUtils.RequireComponent<VFXCameraShaker>(cameraGo);
|
|||
|
Camera.CurDis = 5f;
|
|||
|
Camera.CurYaw = -39f;
|
|||
|
UnityUtils.RequireComponent<EditorDrawGrid>(cameraGo);
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|