Flatkit 추가 및 설정
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
public class GradientSkyboxEditor : UnityEditor.MaterialEditor {
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
serializedObject.Update();
|
||||
|
||||
var theShader = serializedObject.FindProperty ("m_Shader");
|
||||
|
||||
if (isVisible && !theShader.hasMultipleDifferentValues && theShader.objectReferenceValue != null) {
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
base.OnInspectorGUI();
|
||||
|
||||
if (EditorGUI.EndChangeCheck()) {
|
||||
var dirPitch = GetMaterialProperty(targets, "_DirectionPitch");
|
||||
var dirYaw = GetMaterialProperty(targets, "_DirectionYaw");
|
||||
|
||||
var dirPitchRad = dirPitch.floatValue * Mathf.Deg2Rad;
|
||||
var dirYawRad = dirYaw.floatValue * Mathf.Deg2Rad;
|
||||
|
||||
var direction = new Vector4(Mathf.Sin(dirPitchRad) * Mathf.Sin(dirYawRad), Mathf.Cos(dirPitchRad),
|
||||
Mathf.Sin(dirPitchRad) * Mathf.Cos(dirYawRad), 0.0f);
|
||||
GetMaterialProperty(targets, "_Direction").vectorValue = direction;
|
||||
|
||||
PropertiesChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb06f6d66c6c3423c82d8b5ed585ec3e
|
||||
timeCreated: 1453992704
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user