mirror of
https://github.com/nothke/quality-control.git
synced 2025-08-11 16:13:44 +00:00
Added KCC
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "KCC.Editor",
|
||||
"references": [
|
||||
"GUID:1bf68a6e05395544c9eb0c8d1ab94588"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b7c931d99dfb09428a98748ecfd6169
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,28 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace KinematicCharacterController
|
||||
{
|
||||
[CustomEditor(typeof(KinematicCharacterMotor))]
|
||||
public class KinematicCharacterMotorEditor : Editor
|
||||
{
|
||||
protected virtual void OnSceneGUI()
|
||||
{
|
||||
KinematicCharacterMotor motor = (target as KinematicCharacterMotor);
|
||||
if (motor)
|
||||
{
|
||||
Vector3 characterBottom = motor.transform.position + (motor.Capsule.center + (-Vector3.up * (motor.Capsule.height * 0.5f)));
|
||||
|
||||
Handles.color = Color.yellow;
|
||||
Handles.CircleHandleCap(
|
||||
0,
|
||||
characterBottom + (motor.transform.up * motor.MaxStepHeight),
|
||||
Quaternion.LookRotation(motor.transform.up, motor.transform.forward),
|
||||
motor.Capsule.radius + 0.1f,
|
||||
EventType.Repaint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7db3ed6d74cbf2b489cab5e1586bed7a
|
||||
timeCreated: 1518400757
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace KinematicCharacterController
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
|
||||
public class ReadOnlyPropertyDrawer : PropertyDrawer
|
||||
{
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
return EditorGUI.GetPropertyHeight(property, label, true);
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
GUI.enabled = false;
|
||||
EditorGUI.PropertyField(position, property, label, true);
|
||||
GUI.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d4351ab88853824b85a8f458928d825
|
||||
timeCreated: 1504492796
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user