Первый коммит
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f26d1788ae62db245b5b1ca68b67a572
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,193 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(RCC_CustomizationApplier))]
|
||||
public class RCC_CustomizationApplierEditor : Editor {
|
||||
|
||||
RCC_CustomizationApplier prop;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
prop = (RCC_CustomizationApplier)target;
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("saveFileName"), new GUIContent("Save File Name", "Save File Name."), false);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("autoLoadLoadout"), new GUIContent("Auto Load Loadout", "Loads all last changes."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("loadout"), new GUIContent("Loadout", "Loadout."), true);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
if (!prop.SpoilerManager) {
|
||||
|
||||
EditorGUILayout.HelpBox("Spoiler Manager not found!", MessageType.Error);
|
||||
|
||||
if (GUILayout.Button("Create")) {
|
||||
|
||||
GameObject create = Instantiate(Resources.Load<GameObject>("Customization Setups/Spoilers"), prop.transform.position, prop.transform.rotation, prop.transform);
|
||||
create.transform.SetParent(Root().transform);
|
||||
create.transform.localPosition = Vector3.zero;
|
||||
create.transform.localRotation = Quaternion.identity;
|
||||
create.name = Resources.Load<GameObject>("Customization Setups/Spoilers").name;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.HelpBox("Spoiler Manager found!", MessageType.None);
|
||||
|
||||
if (GUILayout.Button("Select", GUILayout.Width(150f)))
|
||||
Selection.activeObject = prop.SpoilerManager.gameObject;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
if (!prop.SirenManager) {
|
||||
|
||||
EditorGUILayout.HelpBox("Siren Manager not found!", MessageType.Error);
|
||||
|
||||
if (GUILayout.Button("Create")) {
|
||||
|
||||
GameObject create = Instantiate(Resources.Load<GameObject>("Customization Setups/Sirens"), prop.transform.position, prop.transform.rotation, prop.transform);
|
||||
create.transform.SetParent(Root().transform);
|
||||
create.transform.localPosition = Vector3.zero;
|
||||
create.transform.localRotation = Quaternion.identity;
|
||||
create.name = Resources.Load<GameObject>("Customization Setups/Sirens").name;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.HelpBox("Siren Manager found!", MessageType.None);
|
||||
|
||||
if (GUILayout.Button("Select", GUILayout.Width(150f)))
|
||||
Selection.activeObject = prop.SirenManager.gameObject;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
if (!prop.UpgradeManager) {
|
||||
|
||||
EditorGUILayout.HelpBox("Upgrade Manager not found!", MessageType.Error);
|
||||
|
||||
if (GUILayout.Button("Create")) {
|
||||
|
||||
GameObject create = Instantiate(Resources.Load<GameObject>("Customization Setups/Upgrades"), prop.transform.position, prop.transform.rotation, prop.transform);
|
||||
create.transform.SetParent(Root().transform);
|
||||
create.transform.localPosition = Vector3.zero;
|
||||
create.transform.localRotation = Quaternion.identity;
|
||||
create.name = Resources.Load<GameObject>("Customization Setups/Upgrades").name;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.HelpBox("Upgrade Manager found!", MessageType.None);
|
||||
|
||||
if (GUILayout.Button("Select", GUILayout.Width(150f)))
|
||||
Selection.activeObject = prop.UpgradeManager.gameObject;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
if (!prop.PaintManager) {
|
||||
|
||||
EditorGUILayout.HelpBox("Paint Manager not found!", MessageType.Error);
|
||||
|
||||
if (GUILayout.Button("Create")) {
|
||||
|
||||
GameObject create = Instantiate(Resources.Load<GameObject>("Customization Setups/Paints"), prop.transform.position, prop.transform.rotation, prop.transform);
|
||||
create.transform.SetParent(Root().transform);
|
||||
create.transform.localPosition = Vector3.zero;
|
||||
create.transform.localRotation = Quaternion.identity;
|
||||
create.name = Resources.Load<GameObject>("Customization Setups/Paints").name;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.HelpBox("Paint Manager found!", MessageType.None);
|
||||
|
||||
if (GUILayout.Button("Select", GUILayout.Width(150f)))
|
||||
Selection.activeObject = prop.PaintManager.gameObject;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
if (!prop.WheelManager) {
|
||||
|
||||
EditorGUILayout.HelpBox("Wheel Manager not found!", MessageType.Error);
|
||||
|
||||
if (GUILayout.Button("Create")) {
|
||||
|
||||
GameObject create = Instantiate(Resources.Load<GameObject>("Customization Setups/Wheels"), prop.transform.position, prop.transform.rotation, prop.transform);
|
||||
create.transform.SetParent(Root().transform);
|
||||
create.transform.localPosition = Vector3.zero;
|
||||
create.transform.localRotation = Quaternion.identity;
|
||||
create.name = Resources.Load<GameObject>("Customization Setups/Wheels").name;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.HelpBox("Wheel Manager found!", MessageType.None);
|
||||
|
||||
if (GUILayout.Button("Select", GUILayout.Width(150f)))
|
||||
Selection.activeObject = prop.WheelManager.gameObject;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
private GameObject Root() {
|
||||
|
||||
GameObject root = null;
|
||||
|
||||
if(prop.transform.Find("Customizations"))
|
||||
root = prop.transform.Find("Customizations").gameObject;
|
||||
|
||||
if (root) {
|
||||
|
||||
return root;
|
||||
|
||||
} else {
|
||||
|
||||
root = new GameObject("Customizations");
|
||||
root.transform.SetParent(prop.transform);
|
||||
root.transform.localPosition = Vector3.zero;
|
||||
root.transform.localRotation = Quaternion.identity;
|
||||
return root;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f081193c9464bfd458474c08f8ab4fe4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,46 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(RCC_VehicleUpgrade_PaintManager))]
|
||||
public class RCC_VehicleUpgrade_PaintEditor : Editor {
|
||||
|
||||
RCC_VehicleUpgrade_PaintManager prop;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
prop = (RCC_VehicleUpgrade_PaintManager)target;
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.HelpBox("All painters have target renderers and material index. If your vehicle has multiple paintable renderers, create new painter for each renderer and set their target material indexes. Click 'Get All Paints' after editing painters.", MessageType.None);
|
||||
|
||||
DrawDefaultInspector();
|
||||
|
||||
if (GUILayout.Button("Get All Painters"))
|
||||
prop.paints = prop.GetComponentsInChildren<RCC_VehicleUpgrade_Paint>(true);
|
||||
|
||||
if (GUILayout.Button("Create New Painter")) {
|
||||
|
||||
GameObject newPainter = new GameObject("Painter");
|
||||
newPainter.transform.SetParent(prop.transform);
|
||||
newPainter.transform.localPosition = Vector3.zero;
|
||||
newPainter.transform.localRotation = Quaternion.identity;
|
||||
newPainter.AddComponent<RCC_VehicleUpgrade_Paint>();
|
||||
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4415b0192d4843a4b859c6fbcd98aa0f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,36 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(RCC_VehicleUpgrade_SirenManager))]
|
||||
public class RCC_VehicleUpgrade_SirenEditor : Editor {
|
||||
|
||||
RCC_VehicleUpgrade_SirenManager prop;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
prop = (RCC_VehicleUpgrade_SirenManager)target;
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.HelpBox("All sirens can be used under this manager. Each siren has target index. Click 'Get All Sirens' after editing sirens.", MessageType.None);
|
||||
|
||||
DrawDefaultInspector();
|
||||
|
||||
if (GUILayout.Button("Get All Sirens"))
|
||||
prop.sirens = prop.GetComponentsInChildren<RCC_VehicleUpgrade_Siren>(true);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8f55ca77ed88104bbc450f54b1992dd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,36 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(RCC_VehicleUpgrade_SpoilerManager))]
|
||||
public class RCC_VehicleUpgrade_SpoilerEditor : Editor {
|
||||
|
||||
RCC_VehicleUpgrade_SpoilerManager prop;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
prop = (RCC_VehicleUpgrade_SpoilerManager)target;
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.HelpBox("All spoilers can be used under this manager. Each spoiler has target index and paintable renderer. Click 'Get All Spoilers' after editing spoilers.", MessageType.None);
|
||||
|
||||
DrawDefaultInspector();
|
||||
|
||||
if (GUILayout.Button("Get All Spoilers"))
|
||||
prop.spoilers = prop.GetComponentsInChildren<RCC_VehicleUpgrade_Spoiler>(true);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ecc8787e966ab45469842e8aeeb867e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,36 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(RCC_VehicleUpgrade_WheelManager))]
|
||||
public class RCC_VehicleUpgrade_WheelEditor : Editor {
|
||||
|
||||
RCC_VehicleUpgrade_WheelManager prop;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
prop = (RCC_VehicleUpgrade_WheelManager)target;
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.HelpBox("All wheels are stored in the configure wheels section", MessageType.None);
|
||||
|
||||
DrawDefaultInspector();
|
||||
|
||||
if (GUILayout.Button("Configure Wheels"))
|
||||
Selection.activeObject = RCC_ChangableWheels.Instance;
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1720a95eb672094429133d04ff2fe0e7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/RealisticCarControllerV3/Editor/Font.meta
Normal file
9
Assets/RealisticCarControllerV3/Editor/Font.meta
Normal file
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c5dc615a091b6d46818aac7810a8386
|
||||
folderAsset: yes
|
||||
timeCreated: 1444244025
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,195 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Typodermic Fonts Inc. Freeware Font instructions 2014</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin:30px 20% 120px 20%;
|
||||
padding:0px;
|
||||
font-family:Consolas, Courier, sans-serif;
|
||||
color:#4c4b44;
|
||||
background-color:#c2c1b3;
|
||||
|
||||
/* IE10 Consumer Preview */
|
||||
background-image: -ms-linear-gradient(top left, #DEDDD6 0%, #9D9B87 100%);
|
||||
|
||||
/* Mozilla Firefox */
|
||||
background-image: -moz-linear-gradient(top left, #DEDDD6 0%, #9D9B87 100%);
|
||||
|
||||
/* Opera */
|
||||
background-image: -o-linear-gradient(top left, #DEDDD6 0%, #9D9B87 100%);
|
||||
|
||||
/* Webkit (Safari/Chrome 10) */
|
||||
background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0, #DEDDD6), color-stop(1, #9D9B87));
|
||||
|
||||
/* Webkit (Chrome 11+) */
|
||||
background-image: -webkit-linear-gradient(top left, #DEDDD6 0%, #9D9B87 100%);
|
||||
|
||||
/* W3C Markup, IE10 Release Preview */
|
||||
background-image: linear-gradient(to bottom right, #DEDDD6 0%, #9D9B87 100%);
|
||||
|
||||
}
|
||||
h2 {color:#6d6c61;}
|
||||
a {color:#8f5b54;}
|
||||
a:hover {color:#ffffff; background-color:#9a998c;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<svg width="350px" height="30px">
|
||||
<path fill="#69685D" d="M0,4.006L0.554,0h20.674l-0.553,4.006l-2.559,2.772h-4.688l-0.682,4.816l-2.515,3.026l1.663,3.07
|
||||
l-1.62,11.594H4.987l-1.448-1.79l2.94-20.716H1.791L0,4.006z"/>
|
||||
<path fill="#69685D" d="M35.8,0h5.285l1.408,1.791l-1.876,13.343l-2.515,3.111h-4.264l-1.534,11.04h-5.286l-1.449-1.79l1.322-9.25
|
||||
h-4.263l-1.705-3.111l1.875-13.343L24.76,0h5.242l-1.706,12.064h5.799L35.8,0z"/>
|
||||
<path fill="#69685D" d="M62.09,0l2.899,3.453L63.412,14.58l-3.496,3.962h-9.805l-1.491,10.742h-5.244l-1.493-1.79l3.625-25.704
|
||||
L47.469,0H62.09z M50.965,12.362h5.797l0.81-5.583h-5.799L50.965,12.362z"/>
|
||||
<path fill="#69685D" d="M64.256,26.642l3.367-24.041L70.523,0h14.664l2.132,2.601l-3.368,24.041l-2.856,2.643H66.431L64.256,26.642
|
||||
z M73.335,11.595l-2.514,3.026l1.663,3.07l-0.683,4.816H77.6l0.68-4.816l2.516-3.07l-1.663-3.026l0.681-4.816h-5.796L73.335,11.595
|
||||
z"/>
|
||||
<path fill="#69685D" d="M86.926,29.285L91.017,0h15.518l3.581,4.307l-2.899,20.673l-4.774,4.305H86.926z M96.345,11.595
|
||||
l-2.515,3.026l1.664,3.07l-0.683,4.816h5.798l0.681-4.816l2.516-3.07l-1.663-3.026l0.681-4.816h-5.796L96.345,11.595z"/>
|
||||
<path fill="#69685D" d="M127.114,29.285h-15.473l-1.492-1.79l3.624-25.704L115.731,0h15.389l-0.554,4.006l-2.557,2.772h-7.971
|
||||
l-0.684,4.816h6.906l1.662,3.026l-2.515,3.111h-6.905l-0.683,4.775h8.057l1.791,2.771L127.114,29.285z"/>
|
||||
<path fill="#69685D" d="M150.21,0l2.898,3.453l-1.405,9.977l-3.881,3.452l2.217,10.613l-1.748,1.79h-4.944l-2.387-11.553h-2.6
|
||||
l-1.622,11.553h-5.241l-1.493-1.79l3.624-25.704L135.588,0H150.21z M145.691,6.779h-5.796l-0.683,4.816h5.799L145.691,6.779z"/>
|
||||
<path fill="#69685D" d="M159.92,29.285h-5.242l-1.492-1.79l3.41-24.042L160.432,0h21.911l2.897,3.453l-3.409,24.042l-1.876,1.79
|
||||
h-5.284l1.617-11.594l2.517-3.07l-1.662-3.026l0.681-4.816h-4.092l-3.154,22.506h-6.522l3.155-22.506h-4.134l-0.683,4.816
|
||||
l-2.515,3.026l1.663,3.07L159.92,29.285z"/>
|
||||
<path fill="#69685D" d="M191.879,29.285h-5.244l-1.492-1.79l3.624-25.704L190.728,0h5.242l-1.619,11.595l-2.516,3.026l1.663,3.07
|
||||
L191.879,29.285z"/>
|
||||
<path fill="#69685D" d="M213.018,25.279l-0.554,4.006h-13.854l-2.899-3.494l3.156-22.338L202.702,0h13.854l-0.555,4.006
|
||||
l-2.558,2.772h-8.1l-0.683,4.816l-2.515,3.026l1.663,3.07l-0.683,4.816h8.1L213.018,25.279z"/>
|
||||
<path fill="#69685D" d="M226.007,29.285l-1.492-1.79l3.624-25.704L230.1,0h15.473l-0.554,4.006l-2.557,2.772h-8.058l-0.724,5.115
|
||||
h6.818l1.664,3.07l-2.557,3.11h-6.82l-1.535,11.211H226.007z"/>
|
||||
<path fill="#69685D" d="M243.903,26.642l3.368-24.041L250.17,0h14.663l2.131,2.601l-3.367,24.041l-2.855,2.643h-14.664
|
||||
L243.903,26.642z M252.983,11.595l-2.516,3.026l1.662,3.07l-0.681,4.816h5.796l0.684-4.816l2.515-3.07l-1.664-3.026l0.684-4.816
|
||||
h-5.798L252.983,11.595z"/>
|
||||
<path fill="#69685D" d="M280.639,19.822l-4.731-7.758l-2.516,3.069l1.662,3.069l-1.533,11.082h-5.244l-1.493-1.79l3.626-25.704
|
||||
L272.37,0h4.773l4.902,9.677L283.41,0h5.285l1.407,1.791l-3.623,25.704l-1.877,1.79h-5.285L280.639,19.822z"/>
|
||||
<path fill="#69685D" d="M291.926,4.006L292.48,0h20.674l-0.554,4.006l-2.557,2.772h-4.691l-0.681,4.816l-2.516,3.026l1.664,3.07
|
||||
l-1.621,11.594h-5.285l-1.451-1.79l2.942-20.716h-4.689L291.926,4.006z"/>
|
||||
<path fill="#69685D" d="M325.168,17.478h-9.209l-2.387-3.923l1.45-10.102L318.857,0h14.452l-0.682,4.86l-1.621,1.918h-9.506
|
||||
l-0.64,4.561h9.208l2.388,3.878l-1.493,10.572l-3.836,3.494h-14.579l-1.107-1.917l0.682-4.86h12.362L325.168,17.478z"/>
|
||||
</svg>
|
||||
|
||||
<br>
|
||||
|
||||
<p translate="no">
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=de&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhivq6___mill12Uw6fPvMWyJxstkw">Deutsch</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=es&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhjAt3cpinDeMTX6Ro8UcZFqaE8K5Q">Español</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=fr&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhjObLPhFyyhwigF-dBoOZ3eXYdDsw">Français</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=ar&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhg2hs-st3zodt-AjmoeuPHfyJsTEg">العربية</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=zh-CN&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhiilVnjG1Ks0DN7UyRqbKExhxAT-Q">中国简体</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=zh-TW&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhiSCPRAYToARlHI4kxIK9eCIFKQhw">簡體字</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=cs&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhj3z2HOOmCXLT-ApYW2SCeBvTGvTA">Čeština</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=el&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhhoORG-43TvZ2NVrll3T0oyOZE0VA">Ελληνικά</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=iw&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhiP4kLXdDxVNuV6-9tHJ8Tbt-1xKw">עִבְרִית</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=hi&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhhJmUufReWrMTSaGKPPOqV7q5jpGQ">हिन्दी</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=hu&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhgfcL_UwP3jkr6Vvq35rkhETFuTug">Magyar</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=is&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhjpK9lELyRP50Vv3RNgqCJDb6d-GQ">Íslenska</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=id&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhiExV3gmyXBUVqcwNiGiUWQSRrgIQ">Indonesia</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=it&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhgMr2_uulaLYRSFz8C34rtcbN6XEg">Italiano</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=ko&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhhl_nNXiOMIiBERq879UXH1XYfZGw">한국말</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&ie=UTF8&prev=_t&sl=en&tl=ja&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhi2FvSFgSUub72-Sq2moIRAosCiLA">日本語</a>
|
||||
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=no&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhhnf9AGd5hfxwA04e1w-tfYPha1ww">Norsk</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=pl&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhjZTe5eJRrZffLe0zgqEHPrMb8pOQ">Język Polski</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=pt-BR&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhg-zp3i6AcZCv02ONjZ5YvkcCFDBw">Português</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=pa&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhhPEMoYvW59_DJT7y6fxgG2IMh23A">ਪੰਜਾਬੀ</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=ro&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhgD0R8zxuQQh-YmFpQTJdvjhAYm2A">Română</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=ru&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhgI6c7Pd-FCcipT4xc2NPTefj5JJg">Русский</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=sv&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhhA8gW_-rjCbZQ5TK46zFMB3_StEQ">Svenska</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=ta&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhiwxxCEPzu3pHBXP-fbTZaOzYqe3g">தமிழ்</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=th&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhjP1N1DRUB1M81k5mi5KnRtt5C2-Q">ภาษาไทย</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=tr&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhiTYbD039OWznCcGyQnMy89_v-1gA">Türkçe</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=uk&u=http%3A%2F%2Ftypodermicfonts.com%2Fwp-content%2Fuploads%2F2014%2F02%2Fread-this.html">Українська мова</a>
|
||||
<a href="http://translate.google.com/translate?hl=en&sl=en&tl=vi&u=http://typodermicfonts.com/wp-content/uploads/2014/02/read-this.html&sandbox=0&usg=ALkJrhirTQPOLCZognLpxOvJQT_158y07A">Tiếng Việt</a>
|
||||
</p>
|
||||
|
||||
|
||||
<p>Thanks for downloading a free font from <span translate="no">Typodermic Fonts Inc.</span> This font is <em>free for commercial use</em>. Read the attached license agreement for details.</p>
|
||||
|
||||
|
||||
<h2>Installation</h2>
|
||||
|
||||
<ul>
|
||||
<li>Windows 8/7/Vista: Get the font out of the ZIP. Right-click on the font and <em>Install</em>
|
||||
<li>Windows XP: Get the font out of the ZIP. Put it into <cite translate="no">Start Menu/Control Panel/Appearance and Themes/Fonts</cite>
|
||||
<li>Mac OS X: Get the font out of the ZIP. Put it into <cite translate="no">/Library/Fonts</cite> or <cite translate="no">/Users/Your_username/Library/Fonts</cite>
|
||||
<li>Mac OS X 10.3 or above: Double-click the font file and <em>Install font</em>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Allowed</h2>
|
||||
|
||||
<ul>
|
||||
<li>art
|
||||
<li>sign
|
||||
<li>poster
|
||||
<li>banner
|
||||
<li>book
|
||||
<li>business card
|
||||
<li>album
|
||||
<li>movie
|
||||
<li>television
|
||||
<li>logo
|
||||
<li>trademarked logo
|
||||
<li>clothing
|
||||
<li>sticker
|
||||
<li>stamp
|
||||
<li>product label
|
||||
<li>web page (not embedded)
|
||||
<li>app (not embedded)
|
||||
<li>PDF (not editable)
|
||||
</ul>
|
||||
|
||||
<h2>Not allowed</h2>
|
||||
|
||||
<ul>
|
||||
<li>ebook
|
||||
<li>app (embedded)
|
||||
<li>web page (embedded)
|
||||
<li>product creation platform
|
||||
<li>alphabet stamps
|
||||
<li>advertisment server
|
||||
<li>web template
|
||||
<li>PDF (editable)
|
||||
<li>OEM
|
||||
<li>device embedding
|
||||
</ul>
|
||||
|
||||
<p>It’s easy to get a different license agreement. Read the <a href="http://typodermicfonts.com/custom/">this page</a> for details.</p>
|
||||
|
||||
<h2>Other styles</h2>
|
||||
|
||||
<p>Many of my free fonts have other styles available. Please visit <a href="http://typodermicfonts.com">Typodermic Fonts</a> and search for the name of this font in the search bar.</p>
|
||||
|
||||
|
||||
<h2>About me</h2>
|
||||
|
||||
<p>My name is <span translate="no">Ray Larabie</span> and I’ve been creating fonts since 1996.</p>
|
||||
|
||||
<p>Please visit <a href="http://typodermicfonts.com">typodermicfonts.com</a> to find out more.</p>
|
||||
|
||||
<p translate="no"><a href="https://www.facebook.com/pages/Typodermic-Fonts/7153899975">Facebook</a></p>
|
||||
<p translate="no"><a href="http://about.me/raylarabie/#">About.me</a></p>
|
||||
<p translate="no"><p><a href="https://twitter.com/typodermic">Twitter</a></p>
|
||||
<p translate="no"><p><a href="http://www.pinterest.com/plywood747/">Pinterest</a></p>
|
||||
|
||||
</body>
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b288c88f1960c154c955c29de92a5faf
|
||||
timeCreated: 1433377084
|
||||
licenseType: Store
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/RealisticCarControllerV3/Editor/Font/good times rg.ttf
Normal file
BIN
Assets/RealisticCarControllerV3/Editor/Font/good times rg.ttf
Normal file
Binary file not shown.
@ -0,0 +1,22 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 785355b5b16010247bb360cd2c286bd8
|
||||
TrueTypeFontImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
fontSize: 12
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 0
|
||||
characterPadding: 1
|
||||
includeFontData: 1
|
||||
fontName: Good Times
|
||||
fontNames:
|
||||
- Good Times
|
||||
fallbackFontReferences: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
ascentCalculationMode: 1
|
||||
useLegacyBoundsCalculation: 0
|
||||
shouldRoundAdvanceValue: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
101
Assets/RealisticCarControllerV3/Editor/RCC_AIBZEditor.cs
Normal file
101
Assets/RealisticCarControllerV3/Editor/RCC_AIBZEditor.cs
Normal file
@ -0,0 +1,101 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CustomEditor(typeof(RCC_AIBrakeZonesContainer))]
|
||||
public class RCC_AIBZEditor : Editor {
|
||||
|
||||
RCC_AIBrakeZonesContainer bzScript;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
bzScript = (RCC_AIBrakeZonesContainer)target;
|
||||
serializedObject.Update();
|
||||
|
||||
if (GUILayout.Button("Delete Brake Zones")) {
|
||||
|
||||
foreach (Transform t in bzScript.brakeZones)
|
||||
DestroyImmediate(t.gameObject);
|
||||
|
||||
bzScript.brakeZones.Clear();
|
||||
EditorUtility.SetDirty(bzScript);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("brakeZones"), new GUIContent("Brake Zones", "Brake Zones"), true);
|
||||
|
||||
EditorGUILayout.HelpBox("Create BrakeZones By Shift + Left Mouse Button On Your Road", MessageType.Info);
|
||||
|
||||
if (GUI.changed)
|
||||
EditorUtility.SetDirty(bzScript);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
private void OnSceneGUI() {
|
||||
|
||||
Event e = Event.current;
|
||||
bzScript = (RCC_AIBrakeZonesContainer)target;
|
||||
|
||||
if (e != null) {
|
||||
|
||||
if (e.isMouse && e.shift && e.type == EventType.MouseDown) {
|
||||
|
||||
Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
|
||||
RaycastHit hit = new RaycastHit();
|
||||
if (Physics.Raycast(ray, out hit, 5000.0f)) {
|
||||
|
||||
Vector3 newTilePosition = hit.point;
|
||||
|
||||
GameObject wp = new GameObject("Brake Zone " + bzScript.brakeZones.Count.ToString());
|
||||
|
||||
wp.transform.position = newTilePosition;
|
||||
wp.transform.gameObject.layer = LayerMask.NameToLayer("Ignore Raycast");
|
||||
wp.AddComponent<RCC_AIBrakeZone>();
|
||||
wp.AddComponent<BoxCollider>();
|
||||
wp.GetComponent<BoxCollider>().isTrigger = true;
|
||||
wp.GetComponent<BoxCollider>().size = new Vector3(1, 1, 1);
|
||||
wp.transform.SetParent(bzScript.transform);
|
||||
GetBrakeZones();
|
||||
Event.current.Use();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (bzScript)
|
||||
Selection.activeGameObject = bzScript.gameObject;
|
||||
|
||||
}
|
||||
|
||||
GetBrakeZones();
|
||||
|
||||
}
|
||||
|
||||
public void GetBrakeZones() {
|
||||
|
||||
bzScript.brakeZones = new List<Transform>();
|
||||
|
||||
Transform[] allTransforms = bzScript.transform.GetComponentsInChildren<Transform>();
|
||||
|
||||
foreach (Transform t in allTransforms) {
|
||||
|
||||
if (t != bzScript.transform)
|
||||
bzScript.brakeZones.Add(t);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27a1b35817b330446870f5f91a6cb59c
|
||||
timeCreated: 1437774984
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
96
Assets/RealisticCarControllerV3/Editor/RCC_AIEditor.cs
Normal file
96
Assets/RealisticCarControllerV3/Editor/RCC_AIEditor.cs
Normal file
@ -0,0 +1,96 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CustomEditor(typeof(RCC_AICarController)), CanEditMultipleObjects]
|
||||
public class RCC_AIEditor : Editor {
|
||||
|
||||
RCC_AICarController aiController;
|
||||
|
||||
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
aiController = (RCC_AICarController)target;
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("navigationMode"), new GUIContent("Navigation Mode", "Navigation Mode."), false);
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
|
||||
if (aiController.navigationMode == RCC_AICarController.NavigationMode.FollowWaypoints) {
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("waypointsContainer"), new GUIContent("Waypoints Container", "Waypoints Container."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("currentWaypointIndex"), new GUIContent("Current Waypoint Index", "Current Waypoint Index."), false);
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("targetTag"), new GUIContent("Target Tag For Chase/Follow", "Target Tag For Chase/Follow."), false);
|
||||
|
||||
}
|
||||
|
||||
switch (aiController.navigationMode) {
|
||||
|
||||
case RCC_AICarController.NavigationMode.FollowWaypoints:
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("stopAfterLap"), new GUIContent("Stop After Target Lap", "Stops the vehicle if target lap achieved."), false);
|
||||
if (aiController.stopAfterLap)
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("stopLap"), new GUIContent("Stop After Target Lap", "Stops the vehicle if target lap achieved."), false);
|
||||
break;
|
||||
|
||||
case RCC_AICarController.NavigationMode.ChaseTarget:
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("detectorRadius"), new GUIContent("Detector Radius", "Detector radius."), false);
|
||||
break;
|
||||
|
||||
case RCC_AICarController.NavigationMode.FollowTarget:
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("startFollowDistance"), new GUIContent("Start Follow Distance", "Start follow distance."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("stopFollowDistance"), new GUIContent("Stop Follow Distance", "Stop follow distance."), false);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useRaycasts"), new GUIContent("Use Raycasts", "Use Raycasts For Avoid Dynamic Objects."), false);
|
||||
|
||||
if (aiController.useRaycasts) {
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("obstacleLayers"), new GUIContent("Obstacle Layers", "Obstacle Layers For Avoid Dynamic Objects."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("raycastLength"), new GUIContent("Ray Distance", "Rays For Avoid Dynamic Objects."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("raycastAngle"), new GUIContent("Ray Angle", "Ray Angles."), false);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("limitSpeed"), new GUIContent("Limit Speed", "Limits The Speed."), false);
|
||||
|
||||
if (aiController.limitSpeed)
|
||||
EditorGUILayout.Slider(serializedObject.FindProperty("maximumSpeed"), 0f, aiController.GetComponent<RCC_CarControllerV3>().maxspeed);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("smoothedSteer"), new GUIContent("Smooth Steering", "Smooth Steering."), false);
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.LabelField("Current Waypoint: ", aiController.currentWaypointIndex.ToString());
|
||||
EditorGUILayout.LabelField("Laps: ", aiController.lap.ToString());
|
||||
EditorGUILayout.LabelField("Total Waypoints Passed: ", aiController.totalWaypointPassed.ToString());
|
||||
EditorGUILayout.LabelField("Obstacle: ", aiController.obstacle != null ? aiController.obstacle.ToString() : "None");
|
||||
EditorGUILayout.LabelField("Ignoring Waypoint Due To Unexpected Obstacle: ", aiController.ignoreWaypointNow.ToString());
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
if (GUI.changed)
|
||||
EditorUtility.SetDirty(aiController);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
}
|
12
Assets/RealisticCarControllerV3/Editor/RCC_AIEditor.cs.meta
Normal file
12
Assets/RealisticCarControllerV3/Editor/RCC_AIEditor.cs.meta
Normal file
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44e9aa209f7c0b142994d86fdc1c7486
|
||||
timeCreated: 1437564577
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
103
Assets/RealisticCarControllerV3/Editor/RCC_AIWPEditor.cs
Normal file
103
Assets/RealisticCarControllerV3/Editor/RCC_AIWPEditor.cs
Normal file
@ -0,0 +1,103 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CustomEditor(typeof(RCC_AIWaypointsContainer))]
|
||||
public class RCC_AIWPEditor : Editor {
|
||||
|
||||
RCC_AIWaypointsContainer wpScript;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
wpScript = (RCC_AIWaypointsContainer)target;
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.HelpBox("Create Waypoints By Shift + Left Mouse Button On Your Road", MessageType.Info);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("waypoints"), new GUIContent("Waypoints", "Waypoints"), true);
|
||||
|
||||
foreach (Transform item in wpScript.transform) {
|
||||
|
||||
if (item.gameObject.GetComponent<RCC_Waypoint>() == null)
|
||||
item.gameObject.AddComponent<RCC_Waypoint>();
|
||||
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Delete Waypoints")) {
|
||||
|
||||
foreach (RCC_Waypoint t in wpScript.waypoints)
|
||||
DestroyImmediate(t.gameObject);
|
||||
|
||||
wpScript.waypoints.Clear();
|
||||
EditorUtility.SetDirty(wpScript);
|
||||
|
||||
}
|
||||
|
||||
if (GUI.changed)
|
||||
EditorUtility.SetDirty(wpScript);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
private void OnSceneGUI() {
|
||||
|
||||
Event e = Event.current;
|
||||
wpScript = (RCC_AIWaypointsContainer)target;
|
||||
|
||||
if (e != null) {
|
||||
|
||||
if (e.isMouse && e.shift && e.type == EventType.MouseDown) {
|
||||
|
||||
Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
|
||||
RaycastHit hit = new RaycastHit();
|
||||
if (Physics.Raycast(ray, out hit, 5000.0f)) {
|
||||
|
||||
Vector3 newTilePosition = hit.point;
|
||||
|
||||
GameObject wp = new GameObject("Waypoint " + wpScript.waypoints.Count.ToString());
|
||||
wp.AddComponent<RCC_Waypoint>();
|
||||
wp.transform.position = newTilePosition;
|
||||
wp.transform.SetParent(wpScript.transform);
|
||||
|
||||
GetWaypoints();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (wpScript)
|
||||
Selection.activeGameObject = wpScript.gameObject;
|
||||
|
||||
}
|
||||
|
||||
GetWaypoints();
|
||||
|
||||
}
|
||||
|
||||
public void GetWaypoints() {
|
||||
|
||||
wpScript.waypoints = new List<RCC_Waypoint>();
|
||||
|
||||
RCC_Waypoint[] allTransforms = wpScript.transform.GetComponentsInChildren<RCC_Waypoint>();
|
||||
|
||||
foreach (RCC_Waypoint t in allTransforms) {
|
||||
|
||||
if (t != wpScript.transform)
|
||||
wpScript.waypoints.Add(t);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82db4392be03c57478db78491ce31368
|
||||
timeCreated: 1437566453
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
257
Assets/RealisticCarControllerV3/Editor/RCC_CameraEditor.cs
Normal file
257
Assets/RealisticCarControllerV3/Editor/RCC_CameraEditor.cs
Normal file
@ -0,0 +1,257 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CustomEditor(typeof(RCC_Camera))]
|
||||
public class RCC_CameraEditor : Editor {
|
||||
|
||||
RCC_Camera RCCCam;
|
||||
Color orgColor;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
RCCCam = (RCC_Camera)target;
|
||||
serializedObject.Update();
|
||||
orgColor = GUI.color;
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.HelpBox("Main Camera designed for RCC. Includes 6 different camera modes. Doesn't use many cameras for different modes like other assets. Just one single camera handles them.", MessageType.Info);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("cameraTarget"), new GUIContent("Camera Target", "Camera Target."), true);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("pivot"), new GUIContent("Pivot of the Camera", "Pivot of the Camera."), false);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("cameraMode"), new GUIContent("Current Camera Mode", "Current camera mode."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useAutoChangeCamera"), new GUIContent("Auto Change Camera Mode", "Auto changes camera mode with timer."), false);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.LabelField("TPS", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSDistance"), new GUIContent("TPS Distance", "TPS distance."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSHeight"), new GUIContent("TPS Height", "TPS height."), false);
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
float org = EditorGUIUtility.labelWidth;
|
||||
EditorGUIUtility.labelWidth = 125f;
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSLockX"), new GUIContent("TPS Lock X Angle", "TPS lock x angle."), false, GUILayout.MaxWidth(150f));
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSLockY"), new GUIContent("TPS Lock Y Angle", "TPS lock y angle."), false, GUILayout.MaxWidth(150f));
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSLockZ"), new GUIContent("TPS Lock Z Angle", "TPS lock z angle."), false, GUILayout.MaxWidth(150f));
|
||||
EditorGUIUtility.labelWidth = org;
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSFreeFall"), new GUIContent("TPS Free Fall", "TPS free fall."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSDynamic"), new GUIContent("TPS Dynamic", "TPS dynamic."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSRotationDamping"), new GUIContent("TPS Rotation Damping", "TPS rotation damping."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSMinimumFOV"), new GUIContent("TPS Minimum FOV", "TPS minimum FOV."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSMaximumFOV"), new GUIContent("TPS Maximum FOV", "TPS maximum FOV."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSTiltMaximum"), new GUIContent("TPS Tilt Maximum", "TPS tilt maximum."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSTiltMultiplier"), new GUIContent("TPS Tilt Multiplier", "TPS tilt multiplier."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSYaw"), new GUIContent("TPS Yaw Angle", "TPS yaw angle."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSPitch"), new GUIContent("TPS Pitch Angle", "TPS pitch angle."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("zoomScrollMultiplier"), new GUIContent("Zoom Scroll Multiplier", "Zoom scroll multiplier."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("minimumScroll"), new GUIContent("Zoom Scroll Minimum", "Zoom scroll minimum."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maximumScroll"), new GUIContent("Zoom Scroll Maximum", "Zoom scroll maximum."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSAutoFocus"), new GUIContent("Use Auto Focus", "Use auto focus."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSAutoReverse"), new GUIContent("Use Reverse", "Use reverse."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useOrbitInTPSCameraMode"), new GUIContent("Use Orbit", "Use Orbit in TPS camera mode."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSCollision"), new GUIContent("TPS Collision", "TPS collision."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSOffset"), new GUIContent("TPS Offset", "TPS offset."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("TPSStartRotation"), new GUIContent("TPS Start Rotation", "TPS start rotation."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useOcclusion"), new GUIContent("Use Occlusion", "Use Occlusion."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("occlusionLayerMask"), new GUIContent("Occlusion LayerMask", "Occlusion layerMask."), false);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.LabelField("FPS", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useHoodCameraMode"), new GUIContent("Use Hood Camera Mode", "Shall we use hood damera mode?"), false);
|
||||
|
||||
if (RCCCam.useHoodCameraMode) {
|
||||
|
||||
EditorGUILayout.HelpBox("Be sure your vehicle has ''Hood Camera''. Camera will be parented to this gameobject. You can create it from Tools --> BCG --> RCC --> Camera --> Add Hood Camera.", MessageType.Info);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("hoodCameraFOV"), new GUIContent("Hood Camera FOV", "Hood damera FOV."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useOrbitInHoodCameraMode"), new GUIContent("Use Orbit", "Use orbit in hood camera mode."), false);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.LabelField("Wheel", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useWheelCameraMode"), new GUIContent("Use Wheel Camera Mode", "Shall we use wheel camera mode?"), false);
|
||||
|
||||
if (RCCCam.useWheelCameraMode) {
|
||||
|
||||
EditorGUILayout.HelpBox("Be sure your vehicle has ''Wheel Camera''. Camera will be parented to this gameobject. You can create it from Tools --> BCG --> RCC --> Camera --> Add Wheel Camera.", MessageType.Info);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("wheelCameraFOV"), new GUIContent("Wheel Camera FOV", "Wheel camera FOV."), false);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.LabelField("Fixed", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useFixedCameraMode"), new GUIContent("Use Fixed Camera Mode", "Shall we use fixed camera mode?"), false);
|
||||
|
||||
if (RCCCam.useFixedCameraMode) {
|
||||
|
||||
EditorGUILayout.HelpBox("Fixed Camera is overrided by ''Fixed Camera System'' on your scene.", MessageType.Info);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (!FindObjectOfType<RCC_FixedCamera>()) {
|
||||
|
||||
GUI.color = Color.green;
|
||||
|
||||
if (GUILayout.Button("Create Fixed Camera System")) {
|
||||
|
||||
GameObject fixedCamera = new GameObject("RCC_FixedCamera");
|
||||
fixedCamera.transform.position = Vector3.zero;
|
||||
fixedCamera.transform.rotation = Quaternion.identity;
|
||||
fixedCamera.AddComponent<RCC_FixedCamera>();
|
||||
EditorUtility.SetDirty(RCCCam);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
GUI.color = orgColor;
|
||||
|
||||
if (GUILayout.Button("Select Fixed Camera System"))
|
||||
Selection.activeGameObject = FindObjectOfType<RCC_FixedCamera>().gameObject;
|
||||
|
||||
}
|
||||
|
||||
GUI.color = orgColor;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.LabelField("Cinematic", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useCinematicCameraMode"), new GUIContent("Use Cinematic Camera Mode", "Shall we use cinematic camera mode?"), false);
|
||||
|
||||
if (RCCCam.useCinematicCameraMode) {
|
||||
|
||||
EditorGUILayout.HelpBox("Cinematic Camera is overrided by ''Cinematic Camera System'' on your scene.", MessageType.Info);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (!FindObjectOfType<RCC_CinematicCamera>()) {
|
||||
|
||||
GUI.color = Color.green;
|
||||
|
||||
if (GUILayout.Button("Create Cinematic Camera System")) {
|
||||
|
||||
Instantiate(RCC_Settings.Instance.cinematicCamera, Vector3.zero, Quaternion.identity);
|
||||
EditorUtility.SetDirty(RCCCam);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
GUI.color = orgColor;
|
||||
|
||||
if (GUILayout.Button("Select Cinematic Camera System"))
|
||||
Selection.activeGameObject = FindObjectOfType<RCC_CinematicCamera>().gameObject;
|
||||
|
||||
}
|
||||
|
||||
GUI.color = orgColor;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.LabelField("Orbit", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("orbitXSpeed"), new GUIContent("Orbit X Speed", "Orbit X speed."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("orbitYSpeed"), new GUIContent("Orbit Y Speed", "Orbit Y speed."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("orbitSmooth"), new GUIContent("Orbit Smooth", "Orbit smooth."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("minOrbitY"), new GUIContent("Min Orbit Y", "Min orbit Y."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maxOrbitY"), new GUIContent("Max Orbit Y", "Max orbit Y."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("orbitReset"), new GUIContent("Resets orbit rotation after 2 seconds."), false);
|
||||
|
||||
GUI.color = orgColor;
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.LabelField("Top-Down", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useTopCameraMode"), new GUIContent("Use Top Camera Mode", "Shall we use top camera mode?"), false);
|
||||
|
||||
if (RCCCam.useTopCameraMode) {
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useOrthoForTopCamera"), new GUIContent("Use Ortho Mode", "Use ortho mode."), false);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("topCameraDistance"), new GUIContent("Top Camera Distance", "Top camera distance"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("topCameraAngle"), new GUIContent("Top Camera Angle", "Top camera angle"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maximumZDistanceOffset"), new GUIContent("Top Camera Maximum Z Distance", "Top camera maximum Z distance"), false);
|
||||
|
||||
if (RCCCam.useOrthoForTopCamera) {
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("minimumOrtSize"), new GUIContent("Minimum Ortho Size", "Minimum ortho size related with vehicle speed."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maximumOrtSize"), new GUIContent("Maximum Ortho Size", "Maximum ortho size related with vehicle speed."), false);
|
||||
} else {
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("minimumOrtSize"), new GUIContent("Minimum FOV", "Minimum FOV related with vehicle speed."), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maximumOrtSize"), new GUIContent("Maximum FOV", "Maximum FOV related with vehicle speed."), false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
if (GUI.changed)
|
||||
EditorUtility.SetDirty(RCCCam);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d19e98ba283a8f14f9b31e6cf447b81a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,66 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// ensure class initializer is called whenever scripts recompile
|
||||
[InitializeOnLoadAttribute]
|
||||
public static class PlayModeStateChangedExample {
|
||||
|
||||
// register an event handler when the class is initialized
|
||||
static PlayModeStateChangedExample() {
|
||||
|
||||
EditorApplication.playModeStateChanged += LogPlayModeState;
|
||||
|
||||
}
|
||||
|
||||
private static void LogPlayModeState(PlayModeStateChange state) {
|
||||
|
||||
if (state != PlayModeStateChange.ExitingEditMode)
|
||||
return;
|
||||
|
||||
if (EditorPrefs.GetBool("RCC_IgnorePlatformWarnings", false) == false) {
|
||||
|
||||
int i = -1;
|
||||
|
||||
if (!RCC_Settings.Instance.mobileControllerEnabled && (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android || EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS)) {
|
||||
|
||||
i = EditorUtility.DisplayDialogComplex("Mobile Controller.", "Your target platform is mobile, but it's not enabled in RCC Settings yet.", "Enable it", "Ignore", "Ignore and don't warn me again");
|
||||
|
||||
switch (i) {
|
||||
|
||||
case 0:
|
||||
RCC_Settings.Instance.mobileControllerEnabled = true;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
EditorPrefs.SetBool("RCC_IgnorePlatformWarnings", true);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (RCC_Settings.Instance.mobileControllerEnabled && (EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android && EditorUserBuildSettings.activeBuildTarget != BuildTarget.iOS)) {
|
||||
|
||||
i = EditorUtility.DisplayDialogComplex("Mobile Controller.", "Your target platform is not mobile, but it's still enabled in RCC Settings yet.", "Disable it", "Ignore", "Ignore and don't warn me again");
|
||||
|
||||
switch (i) {
|
||||
|
||||
case 0:
|
||||
RCC_Settings.Instance.mobileControllerEnabled = false;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
EditorPrefs.SetBool("RCC_IgnorePlatformWarnings", true);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48fbf2676a1cabc498456a2176c56914
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,50 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CustomEditor(typeof(RCC_DemoMaterials))]
|
||||
public class RCC_DemoMaterialsEditor : Editor {
|
||||
|
||||
RCC_DemoMaterials prop;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
prop = (RCC_DemoMaterials)target;
|
||||
serializedObject.Update();
|
||||
|
||||
DrawDefaultInspector();
|
||||
|
||||
if (GUILayout.Button("Select All Demo Materials For Converting To URP")) {
|
||||
|
||||
EditorUtility.DisplayDialog("Converting All Demo Materials To URP", "All demo materials will be selected in your project now. After that, you'll need to convert them to URP shaders while they have been selected. You can convert them from the Edit --> Render Pipeline --> Universal Render Pipeline --> Convert Selected Materials.", "Close");
|
||||
|
||||
UnityEngine.Object[] objects = new UnityEngine.Object[prop.demoMaterials.Length];
|
||||
|
||||
for (int i = 0; i < objects.Length; i++)
|
||||
objects[i] = prop.demoMaterials[i];
|
||||
|
||||
Selection.objects = objects;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.LabelField("Created by Buğra Özdoğanlar\nBoneCrackerGames", EditorStyles.centeredGreyMiniLabel, GUILayout.MaxHeight(50f));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
if (GUI.changed)
|
||||
EditorUtility.SetDirty(prop);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 94747401909a9fa43ae202897f5c3c53
|
||||
timeCreated: 1461599362
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
2040
Assets/RealisticCarControllerV3/Editor/RCC_Editor.cs
Normal file
2040
Assets/RealisticCarControllerV3/Editor/RCC_Editor.cs
Normal file
File diff suppressed because it is too large
Load Diff
11
Assets/RealisticCarControllerV3/Editor/RCC_Editor.cs.meta
Normal file
11
Assets/RealisticCarControllerV3/Editor/RCC_Editor.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea22798d60b05f04796cb21895ab13f0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
679
Assets/RealisticCarControllerV3/Editor/RCC_EditorWindows.cs
Normal file
679
Assets/RealisticCarControllerV3/Editor/RCC_EditorWindows.cs
Normal file
@ -0,0 +1,679 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class RCC_EditorWindows : Editor {
|
||||
|
||||
private static RCC_CarControllerV3 SelectedCar() {
|
||||
|
||||
if (Selection.activeGameObject == null)
|
||||
return null;
|
||||
|
||||
return Selection.activeGameObject.GetComponentInParent<RCC_CarControllerV3>();
|
||||
|
||||
}
|
||||
|
||||
#region Edit Settings
|
||||
#if RCC_SHORTCUTS
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Edit RCC Settings #s", false, -100)]
|
||||
public static void OpenRCCSettings() {
|
||||
Selection.activeObject = RCC_Settings.Instance;
|
||||
}
|
||||
#else
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Edit RCC Settings", false, -100)]
|
||||
public static void OpenRCCSettings() {
|
||||
Selection.activeObject = RCC_Settings.Instance;
|
||||
}
|
||||
#endif
|
||||
#endregion
|
||||
|
||||
#region Configure
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Configure/Configure Demo Vehicles", false, -65)]
|
||||
public static void OpenDemoVehiclesSettings() {
|
||||
Selection.activeObject = RCC_DemoVehicles.Instance;
|
||||
}
|
||||
|
||||
#if RCC_PHOTON && PHOTON_UNITY_NETWORKING
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Configure/Configure Photon Demo Vehicles", false, -65)]
|
||||
public static void OpenPhotonDemoVehiclesSettings() {
|
||||
Selection.activeObject = RCC_PhotonDemoVehicles.Instance;
|
||||
}
|
||||
#endif
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Configure/Configure Ground Materials", false, -65)]
|
||||
public static void OpenGroundMaterialsSettings() {
|
||||
Selection.activeObject = RCC_GroundMaterials.Instance;
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Configure/Configure Changable Wheels", false, -65)]
|
||||
public static void OpenChangableWheelSettings() {
|
||||
Selection.activeObject = RCC_ChangableWheels.Instance;
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Configure/Configure Recorded Clips", false, -65)]
|
||||
public static void OpenRecordSettings() {
|
||||
Selection.activeObject = RCC_Records.Instance;
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Configure/Configure Initial Vehicle Setup Settings", false, -65)]
|
||||
public static void OpenInitialSettings() {
|
||||
Selection.activeObject = RCC_InitialSettings.Instance;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Managers
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Managers/Add RCC Scene Manager", false, -50)]
|
||||
public static void AddRCCSceneManager() {
|
||||
Selection.activeObject = RCC_SceneManager.Instance.gameObject;
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Managers/Add RCC Skidmarks Manager", false, -50)]
|
||||
public static void AddRCCSkidmarksManager() {
|
||||
Selection.activeObject = RCC_SkidmarksManager.Instance.gameObject;
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Managers/Add RCC Customization Manager", false, -50)]
|
||||
public static void AddCustomizationManager() {
|
||||
Selection.activeObject = RCC_CustomizationManager.Instance.gameObject;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Add Cameras
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Cameras/Add RCC Camera To Scene", false, -50)]
|
||||
public static void CreateRCCCamera() {
|
||||
|
||||
if (FindObjectOfType<RCC_Camera>()) {
|
||||
|
||||
EditorUtility.DisplayDialog("Scene has RCC Camera already!", "Scene has RCC Camera already!", "Close");
|
||||
Selection.activeGameObject = FindObjectOfType<RCC_Camera>().gameObject;
|
||||
|
||||
} else {
|
||||
|
||||
GameObject cam = Instantiate(RCC_Settings.Instance.RCCMainCamera.gameObject);
|
||||
cam.name = RCC_Settings.Instance.RCCMainCamera.name;
|
||||
Selection.activeGameObject = cam.gameObject;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Cameras/Add Hood Camera To Vehicle", false, -50)]
|
||||
public static void CreateHoodCamera() {
|
||||
|
||||
if (SelectedCar() == null) {
|
||||
|
||||
EditorUtility.DisplayDialog("Select a vehicle controlled by Realistic Car Controller!", "Select a vehicle controlled by Realistic Car Controller!", "Close");
|
||||
|
||||
} else {
|
||||
|
||||
if (SelectedCar().gameObject.GetComponentInChildren<RCC_HoodCamera>()) {
|
||||
|
||||
EditorUtility.DisplayDialog("Your Vehicle Has Hood Camera Already!", "Your vehicle has hood camera already!", "Close");
|
||||
Selection.activeGameObject = SelectedCar().gameObject.GetComponentInChildren<RCC_HoodCamera>().gameObject;
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
GameObject hoodCam = (GameObject)Instantiate(RCC_Settings.Instance.hoodCamera, SelectedCar().transform.position, SelectedCar().transform.rotation);
|
||||
hoodCam.name = RCC_Settings.Instance.hoodCamera.name;
|
||||
hoodCam.transform.SetParent(SelectedCar().transform, true);
|
||||
hoodCam.GetComponent<ConfigurableJoint>().connectedBody = SelectedCar().gameObject.GetComponent<Rigidbody>();
|
||||
hoodCam.GetComponent<ConfigurableJoint>().connectedMassScale = 0f;
|
||||
Selection.activeGameObject = hoodCam;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Cameras/Add Hood Camera To Vehicle", true)]
|
||||
public static bool CheckCreateHoodCamera() {
|
||||
|
||||
if (!Selection.activeGameObject)
|
||||
return false;
|
||||
|
||||
if (Selection.gameObjects.Length > 1)
|
||||
return false;
|
||||
|
||||
if (!Selection.activeTransform.gameObject.activeSelf)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Cameras/Add Wheel Camera To Vehicle", false, -50)]
|
||||
public static void CreateWheelCamera() {
|
||||
|
||||
if (SelectedCar() == null) {
|
||||
|
||||
EditorUtility.DisplayDialog("Select a vehicle controlled by Realistic Car Controller!", "Select a vehicle controlled by Realistic Car Controller!", "Close");
|
||||
|
||||
} else {
|
||||
|
||||
if (SelectedCar().gameObject.GetComponentInChildren<RCC_WheelCamera>()) {
|
||||
EditorUtility.DisplayDialog("Your Vehicle Has Wheel Camera Already!", "Your vehicle has wheel camera already!", "Close");
|
||||
Selection.activeGameObject = SelectedCar().gameObject.GetComponentInChildren<RCC_WheelCamera>().gameObject;
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject wheelCam = new GameObject("WheelCamera");
|
||||
wheelCam.transform.SetParent(SelectedCar().transform, false);
|
||||
wheelCam.AddComponent<RCC_WheelCamera>();
|
||||
Selection.activeGameObject = wheelCam;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Cameras/Add Wheel Camera To Vehicle", true)]
|
||||
public static bool CheckCreateWheelCamera() {
|
||||
|
||||
if (!Selection.activeGameObject)
|
||||
return false;
|
||||
|
||||
if (Selection.gameObjects.Length > 1)
|
||||
return false;
|
||||
|
||||
if (!Selection.activeTransform.gameObject.activeSelf)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Add Lights
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Lights/Add Lights To Vehicle/HeadLight", false, -50)]
|
||||
public static void CreateHeadLight() {
|
||||
|
||||
if (SelectedCar() == null) {
|
||||
|
||||
EditorUtility.DisplayDialog("Select a vehicle controlled by Realistic Car Controller!", "Select a vehicle controlled by Realistic Car Controller!", "Close");
|
||||
|
||||
} else {
|
||||
|
||||
GameObject lightsMain;
|
||||
|
||||
if (!SelectedCar().transform.Find("Lights")) {
|
||||
|
||||
lightsMain = new GameObject("Lights");
|
||||
lightsMain.transform.SetParent(SelectedCar().transform, false);
|
||||
|
||||
} else {
|
||||
|
||||
lightsMain = SelectedCar().transform.Find("Lights").gameObject;
|
||||
|
||||
}
|
||||
|
||||
GameObject headLight = Instantiate(RCC_Settings.Instance.headLights, lightsMain.transform.position, lightsMain.transform.rotation) as GameObject;
|
||||
headLight.name = RCC_Settings.Instance.headLights.name;
|
||||
headLight.transform.SetParent(lightsMain.transform);
|
||||
headLight.transform.localRotation = Quaternion.identity;
|
||||
headLight.transform.localPosition = new Vector3(0f, 0f, 2f);
|
||||
Selection.activeGameObject = headLight;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Lights/Add Lights To Vehicle/HeadLight", true)]
|
||||
public static bool CheckHeadLight() {
|
||||
|
||||
if (!Selection.activeGameObject)
|
||||
return false;
|
||||
|
||||
if (Selection.gameObjects.Length > 1)
|
||||
return false;
|
||||
|
||||
if (!Selection.activeTransform.gameObject.activeSelf)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Lights/Add Lights To Vehicle/Brake", false, -50)]
|
||||
public static void CreateBrakeLight() {
|
||||
|
||||
if (SelectedCar() == null) {
|
||||
|
||||
EditorUtility.DisplayDialog("Select a vehicle controlled by Realistic Car Controller!", "Select a vehicle controlled by Realistic Car Controller!", "Close");
|
||||
|
||||
} else {
|
||||
|
||||
GameObject lightsMain;
|
||||
|
||||
if (!SelectedCar().transform.Find("Lights")) {
|
||||
|
||||
lightsMain = new GameObject("Lights");
|
||||
lightsMain.transform.SetParent(SelectedCar().transform, false);
|
||||
|
||||
} else {
|
||||
|
||||
lightsMain = SelectedCar().transform.Find("Lights").gameObject;
|
||||
|
||||
}
|
||||
|
||||
GameObject brakeLight = Instantiate(RCC_Settings.Instance.brakeLights, lightsMain.transform.position, lightsMain.transform.rotation) as GameObject;
|
||||
brakeLight.name = RCC_Settings.Instance.brakeLights.name;
|
||||
brakeLight.transform.SetParent(lightsMain.transform);
|
||||
brakeLight.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
|
||||
brakeLight.transform.localPosition = new Vector3(0f, 0f, -2f);
|
||||
Selection.activeGameObject = brakeLight;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Lights/Add Lights To Vehicle/Brake", true)]
|
||||
public static bool CheckBrakeLight() {
|
||||
|
||||
if (!Selection.activeGameObject)
|
||||
return false;
|
||||
|
||||
if (Selection.gameObjects.Length > 1)
|
||||
return false;
|
||||
|
||||
if (!Selection.activeTransform.gameObject.activeSelf)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Lights/Add Lights To Vehicle/Reverse", false, -50)]
|
||||
public static void CreateReverseLight() {
|
||||
|
||||
if (SelectedCar() == null) {
|
||||
|
||||
EditorUtility.DisplayDialog("Select a vehicle controlled by Realistic Car Controller!", "Select a vehicle controlled by Realistic Car Controller!", "Close");
|
||||
|
||||
} else {
|
||||
|
||||
GameObject lightsMain;
|
||||
|
||||
if (!SelectedCar().transform.Find("Lights")) {
|
||||
|
||||
lightsMain = new GameObject("Lights");
|
||||
lightsMain.transform.SetParent(SelectedCar().transform, false);
|
||||
|
||||
} else {
|
||||
|
||||
lightsMain = SelectedCar().transform.Find("Lights").gameObject;
|
||||
|
||||
}
|
||||
|
||||
GameObject reverseLight = Instantiate(RCC_Settings.Instance.reverseLights, lightsMain.transform.position, lightsMain.transform.rotation) as GameObject;
|
||||
reverseLight.name = RCC_Settings.Instance.reverseLights.name;
|
||||
reverseLight.transform.SetParent(lightsMain.transform);
|
||||
reverseLight.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
|
||||
reverseLight.transform.localPosition = new Vector3(0f, 0f, -2f);
|
||||
Selection.activeGameObject = reverseLight;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Lights/Add Lights To Vehicle/Reverse", true)]
|
||||
public static bool CheckReverseLight() {
|
||||
|
||||
if (!Selection.activeGameObject)
|
||||
return false;
|
||||
|
||||
if (Selection.gameObjects.Length > 1)
|
||||
return false;
|
||||
|
||||
if (!Selection.activeTransform.gameObject.activeSelf)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Lights/Add Lights To Vehicle/Indicator", false, -50)]
|
||||
public static void CreateIndicatorLight() {
|
||||
|
||||
if (SelectedCar() == null) {
|
||||
|
||||
EditorUtility.DisplayDialog("Select a vehicle controlled by Realistic Car Controller!", "Select a vehicle controlled by Realistic Car Controller!", "Close");
|
||||
|
||||
} else {
|
||||
|
||||
GameObject lightsMain;
|
||||
|
||||
if (!SelectedCar().transform.Find("Lights")) {
|
||||
|
||||
lightsMain = new GameObject("Lights");
|
||||
lightsMain.transform.SetParent(SelectedCar().transform, false);
|
||||
|
||||
} else {
|
||||
|
||||
lightsMain = SelectedCar().transform.Find("Lights").gameObject;
|
||||
|
||||
}
|
||||
|
||||
GameObject indicatorLight = Instantiate(RCC_Settings.Instance.indicatorLights, lightsMain.transform.position, lightsMain.transform.rotation) as GameObject;
|
||||
Vector3 relativePos = SelectedCar().transform.InverseTransformPoint(indicatorLight.transform.position);
|
||||
indicatorLight.name = RCC_Settings.Instance.indicatorLights.name;
|
||||
indicatorLight.transform.SetParent(lightsMain.transform);
|
||||
|
||||
if (relativePos.z > 0f)
|
||||
indicatorLight.transform.localRotation = Quaternion.identity;
|
||||
else
|
||||
indicatorLight.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
|
||||
|
||||
indicatorLight.transform.localPosition = new Vector3(0f, 0f, -2f);
|
||||
Selection.activeGameObject = indicatorLight;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Lights/Add Lights To Vehicle/Indicator", true)]
|
||||
public static bool CheckIndicatorLight() {
|
||||
|
||||
if (!Selection.activeGameObject)
|
||||
return false;
|
||||
|
||||
if (Selection.gameObjects.Length > 1)
|
||||
return false;
|
||||
|
||||
if (!Selection.activeTransform.gameObject.activeSelf)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Lights/Duplicate Selected Light", false, -50)]
|
||||
public static void DuplicateLight() {
|
||||
|
||||
GameObject duplicatedLight = Instantiate(Selection.activeGameObject);
|
||||
|
||||
duplicatedLight.transform.name = Selection.activeGameObject.transform.name + "_D";
|
||||
duplicatedLight.transform.SetParent(Selection.activeGameObject.transform.parent);
|
||||
duplicatedLight.transform.localPosition = new Vector3(-Selection.activeGameObject.transform.localPosition.x, Selection.activeGameObject.transform.localPosition.y, Selection.activeGameObject.transform.localPosition.z);
|
||||
duplicatedLight.transform.localRotation = Selection.activeGameObject.transform.localRotation;
|
||||
duplicatedLight.transform.localScale = Selection.activeGameObject.transform.localScale;
|
||||
|
||||
Selection.activeGameObject = duplicatedLight;
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Lights/Duplicate Selected Light", true)]
|
||||
public static bool CheckDuplicateLight() {
|
||||
|
||||
if (!Selection.activeGameObject)
|
||||
return false;
|
||||
|
||||
if (Selection.gameObjects.Length > 1)
|
||||
return false;
|
||||
|
||||
if (!Selection.activeTransform.gameObject.activeSelf)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Add UI
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/UI/Add RCC Canvas To Scene", false, -50)]
|
||||
public static void CreateRCCCanvas() {
|
||||
|
||||
if (FindObjectOfType<RCC_DashboardInputs>()) {
|
||||
|
||||
EditorUtility.DisplayDialog("Scene has RCC Canvas already!", "Scene has RCC Canvas already!", "Close");
|
||||
Selection.activeGameObject = FindObjectOfType<RCC_DashboardInputs>().gameObject;
|
||||
|
||||
} else {
|
||||
|
||||
GameObject canvas = Instantiate(RCC_Settings.Instance.RCCCanvas);
|
||||
canvas.name = RCC_Settings.Instance.RCCCanvas.name;
|
||||
Selection.activeGameObject = canvas;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/UI/Add RCC Modification Canvas To Scene", false, -50)]
|
||||
public static void CreateRCCModificationCanvas() {
|
||||
|
||||
GameObject canvas = Instantiate(RCC_Settings.Instance.RCCModificationCanvas);
|
||||
canvas.name = RCC_Settings.Instance.RCCModificationCanvas.name;
|
||||
Selection.activeGameObject = canvas;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Add Exhausts
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Misc/Add Exhaust To Vehicle", false, -50)]
|
||||
public static void CreateExhaust() {
|
||||
|
||||
if (SelectedCar() == null) {
|
||||
|
||||
EditorUtility.DisplayDialog("Select a vehicle controlled by Realistic Car Controller!", "Select a vehicle controlled by Realistic Car Controller!", "Close");
|
||||
|
||||
} else {
|
||||
|
||||
GameObject exhaustsMain;
|
||||
|
||||
if (!SelectedCar().transform.Find("Exhausts")) {
|
||||
exhaustsMain = new GameObject("Exhausts");
|
||||
exhaustsMain.transform.SetParent(SelectedCar().transform, false);
|
||||
} else {
|
||||
exhaustsMain = SelectedCar().transform.Find("Exhausts").gameObject;
|
||||
}
|
||||
|
||||
GameObject exhaust = (GameObject)Instantiate(RCC_Settings.Instance.exhaustGas, SelectedCar().transform.position, SelectedCar().transform.rotation * Quaternion.Euler(0f, 180f, 0f));
|
||||
exhaust.name = RCC_Settings.Instance.exhaustGas.name;
|
||||
exhaust.transform.SetParent(exhaustsMain.transform);
|
||||
exhaust.transform.localPosition = new Vector3(1f, 0f, -2f);
|
||||
Selection.activeGameObject = exhaust;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Misc/Add Exhaust To Vehicle", true)]
|
||||
public static bool CheckCreateExhaust() {
|
||||
|
||||
if (!Selection.activeGameObject)
|
||||
return false;
|
||||
|
||||
if (Selection.gameObjects.Length > 1)
|
||||
return false;
|
||||
|
||||
if (!Selection.activeTransform.gameObject.activeSelf)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Add Mirrors
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Misc/Add Mirrors To Vehicle", false, -50)]
|
||||
public static void CreateBehavior() {
|
||||
|
||||
if (SelectedCar() == null)
|
||||
EditorUtility.DisplayDialog("Select a vehicle controlled by Realistic Car Controller!", "Select a vehicle controlled by Realistic Car Controller!", "Close");
|
||||
else
|
||||
CreateMirrors(SelectedCar().gameObject);
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Misc/Add Mirrors To Vehicle", true)]
|
||||
public static bool CheckCreateBehavior() {
|
||||
|
||||
if (!Selection.activeGameObject)
|
||||
return false;
|
||||
|
||||
if (Selection.gameObjects.Length > 1)
|
||||
return false;
|
||||
|
||||
if (!Selection.activeTransform.gameObject.activeSelf)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region AI
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/AI/Add AI Controller To Vehicle", false)]
|
||||
static void CreateAIBehavior() {
|
||||
|
||||
if (!Selection.activeGameObject.GetComponentInParent<RCC_CarControllerV3>()) {
|
||||
|
||||
EditorUtility.DisplayDialog("Your Vehicle Has Not RCC_CarControllerV3", "Your Vehicle Has Not RCC_CarControllerV3.", "Close");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (Selection.activeGameObject.GetComponentInParent<RCC_AICarController>()) {
|
||||
|
||||
EditorUtility.DisplayDialog("Your Vehicle Already Has AI Car Controller", "Your Vehicle Already Has AI Car Controller", "Close");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
Selection.activeGameObject.GetComponentInParent<RCC_CarControllerV3>().gameObject.AddComponent<RCC_AICarController>();
|
||||
GameObject vehicle = Selection.activeGameObject.GetComponentInParent<RCC_CarControllerV3>().gameObject;
|
||||
Selection.activeGameObject = vehicle;
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/AI/Add AI Controller To Vehicle", true)]
|
||||
static bool CheckAIBehavior() {
|
||||
|
||||
if (Selection.gameObjects.Length > 1 || !Selection.activeTransform)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/AI/Add Waypoints Container To Scene", false)]
|
||||
static void CreateWaypointsContainer() {
|
||||
|
||||
GameObject wp = new GameObject("Waypoints Container");
|
||||
wp.transform.position = Vector3.zero;
|
||||
wp.transform.rotation = Quaternion.identity;
|
||||
wp.AddComponent<RCC_AIWaypointsContainer>();
|
||||
Selection.activeGameObject = wp;
|
||||
|
||||
}
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/AI/Add BrakeZones Container To Scene", false)]
|
||||
static void CreateBrakeZonesContainer() {
|
||||
|
||||
if (FindObjectOfType<RCC_AIBrakeZonesContainer>() == null) {
|
||||
|
||||
GameObject bz = new GameObject("Brake Zones Container");
|
||||
bz.transform.position = Vector3.zero;
|
||||
bz.transform.rotation = Quaternion.identity;
|
||||
bz.AddComponent<RCC_AIBrakeZonesContainer>();
|
||||
Selection.activeGameObject = bz;
|
||||
|
||||
} else {
|
||||
|
||||
EditorUtility.DisplayDialog("Your Scene Already Has Brake Zones Container", "Your Scene Already Has Brake Zones", "Close");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region URP
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/URP/Convert All Materials To URP", false, 10000)]
|
||||
public static void URP() {
|
||||
|
||||
EditorUtility.DisplayDialog("Converting All Demo Materials To URP", "All demo materials will be selected in your project now. After that, you'll need to convert them to URP shaders while they have been selected. You can convert them from the Edit --> Render Pipeline --> Universal Render Pipeline --> Convert Selected Materials.", "Close");
|
||||
|
||||
UnityEngine.Object[] objects = new UnityEngine.Object[RCC_DemoMaterials.Instance.demoMaterials.Length];
|
||||
|
||||
for (int i = 0; i < objects.Length; i++) {
|
||||
objects[i] = RCC_DemoMaterials.Instance.demoMaterials[i];
|
||||
}
|
||||
|
||||
Selection.objects = objects;
|
||||
|
||||
}
|
||||
#endregion URP
|
||||
|
||||
#region Pro
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Upgrade to Realistic Car Controller Pro", false, 10000)]
|
||||
public static void Pro() {
|
||||
|
||||
string url = "http://u3d.as/22Bf";
|
||||
Application.OpenURL(url);
|
||||
|
||||
}
|
||||
#endregion Help
|
||||
|
||||
#region Help
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Help", false, 10000)]
|
||||
public static void Help() {
|
||||
|
||||
EditorUtility.DisplayDialog("Contact", "Please include your invoice number while sending a contact form.", "Close");
|
||||
|
||||
string url = "http://www.bonecrackergames.com/contact/";
|
||||
Application.OpenURL(url);
|
||||
|
||||
}
|
||||
#endregion Help
|
||||
|
||||
#region Static Methods
|
||||
public static void CreateMirrors(GameObject vehicle) {
|
||||
|
||||
if (!vehicle.transform.GetComponentInChildren<RCC_Mirror>()) {
|
||||
|
||||
GameObject mirrors = (GameObject)Instantiate(RCC_Settings.Instance.mirrors, vehicle.transform.position, vehicle.transform.rotation);
|
||||
mirrors.transform.SetParent(vehicle.GetComponent<RCC_CarControllerV3>().transform, true);
|
||||
mirrors.name = "Mirrors";
|
||||
Selection.activeGameObject = mirrors;
|
||||
EditorUtility.DisplayDialog("Created Mirrors!", "Created mirrors. Adjust their positions.", "Close");
|
||||
|
||||
} else {
|
||||
|
||||
EditorUtility.DisplayDialog("Vehicle Has Mirrors Already", "Vehicle has mirrors already!", "Close");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Logitech
|
||||
#if RCC_LOGITECH
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Create/Logitech/Logitech Manager", false, -50)]
|
||||
public static void CreateLogitech() {
|
||||
|
||||
//RCC_LogitechSteeringWheel logi = RCC_LogitechSteeringWheel.Instance;
|
||||
//Selection.activeGameObject = logi.gameObject;
|
||||
|
||||
}
|
||||
#endif
|
||||
#endregion
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Export Project Settings", false, 1000)]
|
||||
public static void ExportProjectSettings() {
|
||||
|
||||
string[] projectContent = new string[] { "ProjectSettings/TagManager.asset" };
|
||||
AssetDatabase.ExportPackage(projectContent, "RCC_ProjectSettings.unitypackage", ExportPackageOptions.Interactive | ExportPackageOptions.Recurse | ExportPackageOptions.IncludeDependencies);
|
||||
Debug.Log("Project Exported");
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0b8d826ceab00c4bbe9cf29717c37c5
|
||||
timeCreated: 1455152851
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
189
Assets/RealisticCarControllerV3/Editor/RCC_FixAxisWindow.cs
Normal file
189
Assets/RealisticCarControllerV3/Editor/RCC_FixAxisWindow.cs
Normal file
@ -0,0 +1,189 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using System.IO;
|
||||
|
||||
[InitializeOnLoad]
|
||||
public class RCC_FixAxisWindow : EditorWindow {
|
||||
|
||||
private GUISkin skin;
|
||||
public MeshFilter target;
|
||||
|
||||
private const int windowWidth = 450;
|
||||
private const int windowHeight = 250;
|
||||
|
||||
public string savedInstanceLocation = "";
|
||||
|
||||
private Mesh tempMesh;
|
||||
private bool saved = false;
|
||||
|
||||
private void OnEnable() {
|
||||
|
||||
titleContent = new GUIContent("Fix Axis And Rotate Mesh Origin");
|
||||
maxSize = new Vector2(windowWidth, windowHeight);
|
||||
minSize = maxSize;
|
||||
|
||||
InitStyle();
|
||||
saved = false;
|
||||
|
||||
}
|
||||
|
||||
private void InitStyle() {
|
||||
|
||||
if (!skin)
|
||||
skin = Resources.Load("RCC_WindowSkin") as GUISkin;
|
||||
|
||||
}
|
||||
|
||||
private void OnGUI() {
|
||||
|
||||
GUI.skin = skin;
|
||||
|
||||
if (tempMesh == null)
|
||||
tempMesh = (Mesh)Instantiate(target.sharedMesh);
|
||||
|
||||
savedInstanceLocation = "Assets/RealisticCarControllerV3/Fixed Meshes";
|
||||
|
||||
EditorGUILayout.LabelField("Fixing axis of the " + target.name + ".");
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Model will not be overwritten, new mesh data will be saved as another instance.");
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Saved location of the mesh: ");
|
||||
EditorGUILayout.LabelField(savedInstanceLocation);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
bool fixedRotation = 1 - Mathf.Abs(Quaternion.Dot(target.transform.rotation, target.transform.root.rotation)) < .01f;
|
||||
|
||||
if (!fixedRotation) {
|
||||
|
||||
EditorGUILayout.BeginHorizontal(GUI.skin.box);
|
||||
|
||||
if (GUILayout.Button("Reset Pivot Rotation"))
|
||||
target.transform.rotation = target.transform.root.rotation;
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
}
|
||||
|
||||
//if (target.transform.rotation != target.transform.root.rotation)
|
||||
// fixedRotation = false;
|
||||
|
||||
GUI.enabled = fixedRotation;
|
||||
|
||||
if (!fixedRotation)
|
||||
EditorGUILayout.HelpBox("Reset pivot rotation to rotate mesh.", MessageType.Info);
|
||||
|
||||
EditorGUILayout.BeginHorizontal(GUI.skin.box);
|
||||
|
||||
if (GUILayout.Button("Mesh Rotate X")) {
|
||||
|
||||
Vector3[] vertices = tempMesh.vertices;
|
||||
Vector3[] newVertices = new Vector3[vertices.Length];
|
||||
Quaternion rotation = Quaternion.Euler(-90f, 0f, 0f);
|
||||
|
||||
for (int i = 0; i < vertices.Length; i++)
|
||||
newVertices[i] = rotation * vertices[i];
|
||||
|
||||
tempMesh.vertices = newVertices;
|
||||
tempMesh.RecalculateNormals();
|
||||
tempMesh.RecalculateBounds();
|
||||
target.mesh = tempMesh;
|
||||
EditorUtility.SetDirty(target);
|
||||
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Mesh Rotate Y")) {
|
||||
|
||||
Vector3[] vertices = tempMesh.vertices;
|
||||
Vector3[] newVertices = new Vector3[vertices.Length];
|
||||
Quaternion rotation = Quaternion.Euler(0f, -90f, 0f);
|
||||
|
||||
for (int i = 0; i < vertices.Length; i++)
|
||||
newVertices[i] = rotation * vertices[i];
|
||||
|
||||
tempMesh.vertices = newVertices;
|
||||
tempMesh.RecalculateNormals();
|
||||
tempMesh.RecalculateBounds();
|
||||
target.mesh = tempMesh;
|
||||
EditorUtility.SetDirty(target);
|
||||
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Mesh Rotate Z")) {
|
||||
|
||||
Vector3[] vertices = tempMesh.vertices;
|
||||
Vector3[] newVertices = new Vector3[vertices.Length];
|
||||
Quaternion rotation = Quaternion.Euler(0f, 0f, -90f);
|
||||
|
||||
for (int i = 0; i < vertices.Length; i++)
|
||||
newVertices[i] = rotation * vertices[i];
|
||||
|
||||
tempMesh.vertices = newVertices;
|
||||
tempMesh.RecalculateNormals();
|
||||
tempMesh.RecalculateBounds();
|
||||
target.mesh = tempMesh;
|
||||
EditorUtility.SetDirty(target);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
GUI.enabled = true;
|
||||
|
||||
if (GUILayout.Button("Save Mesh & Close")) {
|
||||
|
||||
saved = true;
|
||||
Mesh tmp = SaveMesh(target.sharedMesh);
|
||||
target.mesh = tmp;
|
||||
CheckMeshCollider();
|
||||
Close();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Mesh SaveMesh(Mesh mesh) {
|
||||
|
||||
Mesh tmp = (Mesh)Instantiate(mesh);
|
||||
|
||||
if (!AssetDatabase.IsValidFolder(savedInstanceLocation + "/" + target.transform.root.name))
|
||||
AssetDatabase.CreateFolder("Assets/RealisticCarControllerV3/Fixed Meshes", target.transform.root.name);
|
||||
|
||||
AssetDatabase.CreateAsset(tmp, savedInstanceLocation + "/" + target.transform.root.name + "/" + mesh.name + ".mesh");
|
||||
return tmp;
|
||||
|
||||
}
|
||||
|
||||
private void CheckMeshCollider() {
|
||||
|
||||
MeshCollider mCol = target.GetComponent<MeshCollider>();
|
||||
|
||||
if (mCol)
|
||||
mCol.sharedMesh = target.sharedMesh;
|
||||
|
||||
}
|
||||
|
||||
private void OnDisable() {
|
||||
|
||||
target = null;
|
||||
|
||||
int goBack = 0;
|
||||
|
||||
if (!saved)
|
||||
goBack = EditorUtility.DisplayDialogComplex("Mesh not saved", "Mesh is not saved yet. You will need to click save mesh button to save fixed mesh.", "Back", "Don't Save", "");
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23dc8521a83d1a14583215407690525e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,150 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
[CustomEditor(typeof(RCC_GroundMaterials))]
|
||||
public class RCC_GroundMaterialsEditor : Editor {
|
||||
|
||||
private RCC_GroundMaterials prop;
|
||||
|
||||
private Vector2 scrollPos;
|
||||
private List<RCC_GroundMaterials.GroundMaterialFrictions> GroundMaterials = new List<RCC_GroundMaterials.GroundMaterialFrictions>();
|
||||
|
||||
private Color orgColor;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
prop = (RCC_GroundMaterials)target;
|
||||
serializedObject.Update();
|
||||
orgColor = GUI.color;
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Wheels Editor", EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField("This editor will keep update necessary .asset files in your project. Don't change directory of the ''Resources/RCC Assets''.", EditorStyles.helpBox);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
scrollPos = EditorGUILayout.BeginScrollView(scrollPos, false, false);
|
||||
|
||||
EditorGUIUtility.labelWidth = 110f;
|
||||
|
||||
GUILayout.Label("Ground Materials", EditorStyles.boldLabel);
|
||||
|
||||
for (int i = 0; i < prop.frictions.Length; i++) {
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
if (prop.frictions[i].groundMaterial)
|
||||
EditorGUILayout.LabelField(prop.frictions[i].groundMaterial.name + (i == 0 ? " (Default)" : ""), EditorStyles.boldLabel);
|
||||
|
||||
GUI.color = Color.red; if (GUILayout.Button("X", GUILayout.Width(25f))) { RemoveGroundMaterial(i); }
|
||||
GUI.color = orgColor;
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
prop.frictions[i].groundMaterial = (PhysicMaterial)EditorGUILayout.ObjectField("Physic Material", prop.frictions[i].groundMaterial, typeof(PhysicMaterial), false, GUILayout.Width(250f));
|
||||
prop.frictions[i].forwardStiffness = EditorGUILayout.FloatField("Forward Stiffness", prop.frictions[i].forwardStiffness, GUILayout.Width(150f));
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
prop.frictions[i].groundSound = (AudioClip)EditorGUILayout.ObjectField("Wheel Sound", prop.frictions[i].groundSound, typeof(AudioClip), false, GUILayout.Width(250f));
|
||||
prop.frictions[i].sidewaysStiffness = EditorGUILayout.FloatField("Sideways Stiffness", prop.frictions[i].sidewaysStiffness, GUILayout.Width(150f));
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
prop.frictions[i].volume = EditorGUILayout.Slider("Volume", prop.frictions[i].volume, 0f, 1f, GUILayout.Width(250f));
|
||||
prop.frictions[i].deflate = EditorGUILayout.Toggle("Deflate", prop.frictions[i].deflate, GUILayout.Width(250f));
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
prop.frictions[i].groundParticles = (GameObject)EditorGUILayout.ObjectField("Wheel Particles", prop.frictions[i].groundParticles, typeof(GameObject), false, GUILayout.Width(200f));
|
||||
prop.frictions[i].skidmark = (RCC_Skidmarks)EditorGUILayout.ObjectField("Wheel Skidmarks", prop.frictions[i].skidmark, typeof(RCC_Skidmarks), false, GUILayout.Width(200f));
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
prop.frictions[i].slip = EditorGUILayout.FloatField("Slip", prop.frictions[i].slip, GUILayout.Width(150f));
|
||||
prop.frictions[i].damp = EditorGUILayout.FloatField("Damp", prop.frictions[i].damp, GUILayout.Width(150f));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
GUILayout.Label("Terrain Ground Materials", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("terrainFrictions"), new GUIContent("Terrain Physic Material"), true);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
GUI.color = Color.cyan;
|
||||
|
||||
if (GUILayout.Button("Create New Ground Material"))
|
||||
AddNewWheel();
|
||||
|
||||
if (GUILayout.Button("--< Return To Asset Settings"))
|
||||
OpenGeneralSettings();
|
||||
|
||||
GUI.color = orgColor;
|
||||
|
||||
EditorGUILayout.EndScrollView();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.LabelField("Created by Buğra Özdoğanlar\nBoneCrackerGames", EditorStyles.centeredGreyMiniLabel, GUILayout.MaxHeight(50f));
|
||||
|
||||
if (GUI.changed)
|
||||
EditorUtility.SetDirty(prop);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
private void AddNewWheel() {
|
||||
|
||||
GroundMaterials.Clear();
|
||||
GroundMaterials.AddRange(prop.frictions);
|
||||
RCC_GroundMaterials.GroundMaterialFrictions newGroundMaterial = new RCC_GroundMaterials.GroundMaterialFrictions();
|
||||
GroundMaterials.Add(newGroundMaterial);
|
||||
prop.frictions = GroundMaterials.ToArray();
|
||||
|
||||
}
|
||||
|
||||
private void RemoveGroundMaterial(int index) {
|
||||
|
||||
GroundMaterials.Clear();
|
||||
GroundMaterials.AddRange(prop.frictions);
|
||||
GroundMaterials.RemoveAt(index);
|
||||
prop.frictions = GroundMaterials.ToArray();
|
||||
|
||||
}
|
||||
|
||||
private void OpenGeneralSettings() {
|
||||
|
||||
Selection.activeObject = RCC_Settings.Instance;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a9574804ef388d4591841dc7a384381
|
||||
timeCreated: 1457867609
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
46
Assets/RealisticCarControllerV3/Editor/RCC_InitLoad.cs
Normal file
46
Assets/RealisticCarControllerV3/Editor/RCC_InitLoad.cs
Normal file
@ -0,0 +1,46 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class RCC_InitLoad : EditorWindow {
|
||||
|
||||
[InitializeOnLoadMethod]
|
||||
static void InitOnLoad() {
|
||||
|
||||
EditorApplication.delayCall += EditorUpdate;
|
||||
|
||||
}
|
||||
|
||||
public static void EditorUpdate() {
|
||||
|
||||
bool hasKey = false;
|
||||
|
||||
#if BCG_RCC
|
||||
hasKey = true;
|
||||
#endif
|
||||
|
||||
if (!hasKey) {
|
||||
|
||||
EditorUtility.DisplayDialog("Regards from BoneCracker Games", "Thank you for purchasing and using Realistic Car Controller. Please read the documentation before use. Also check out the online documentation for updated info. Have fun :)", "Let's get started!");
|
||||
EditorUtility.DisplayDialog("New Input System", "RCC is using new input system. Legacy input system is deprecated. Make sure your project has Input System installed through the Package Manager. Import screen will ask you to install dependencies, choose Yes.", "Ok");
|
||||
RCC_WelcomeWindow.OpenWindow();
|
||||
|
||||
}
|
||||
|
||||
RCC_Installation.Check();
|
||||
RCC_SetScriptingSymbol.SetEnabled("BCG_RCC", true);
|
||||
|
||||
}
|
||||
|
||||
}
|
12
Assets/RealisticCarControllerV3/Editor/RCC_InitLoad.cs.meta
Normal file
12
Assets/RealisticCarControllerV3/Editor/RCC_InitLoad.cs.meta
Normal file
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec77af92fa104b041aaabe59da503264
|
||||
timeCreated: 1464820891
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
219
Assets/RealisticCarControllerV3/Editor/RCC_LightEditor.cs
Normal file
219
Assets/RealisticCarControllerV3/Editor/RCC_LightEditor.cs
Normal file
@ -0,0 +1,219 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CustomEditor(typeof(RCC_Light)), CanEditMultipleObjects]
|
||||
public class RCC_LightEditor : Editor {
|
||||
|
||||
RCC_Light prop;
|
||||
|
||||
Color originalGUIColor;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
originalGUIColor = GUI.color;
|
||||
prop = (RCC_Light)target;
|
||||
serializedObject.Update();
|
||||
|
||||
CheckLights();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("RCC lights will receive inputs from the parent car controller and adjusts intensity for lights. You can choose which type of light you want to use below. You won't need to specify left or right indicator lights.", EditorStyles.helpBox);
|
||||
|
||||
if (!prop.overrideRenderMode)
|
||||
EditorGUILayout.LabelField("''Important'' or ''Not Important'' modes (Pixel or Vertex) overrided by RCC_Settings.", EditorStyles.helpBox);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("lightType"), new GUIContent("Light Type"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("inertia"), new GUIContent("Inertia"), false);
|
||||
|
||||
prop.overrideRenderMode = EditorGUILayout.Toggle(new GUIContent("Override RenderMode", "Ignore selected settings in RCC Settings about lights as vertex / pixel lights."), prop.overrideRenderMode);
|
||||
|
||||
if (!prop.overrideRenderMode)
|
||||
GUI.enabled = false;
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("renderMode"), new GUIContent("Render Mode"), false);
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
GUI.enabled = true;
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("flare"), new GUIContent("Lens Flare"), false);
|
||||
|
||||
if (!prop.GetComponent<LensFlare>()) {
|
||||
|
||||
if (GUILayout.Button("Create LensFlare")) {
|
||||
|
||||
GameObject[] lights = Selection.gameObjects;
|
||||
|
||||
for (int i = 0; i < lights.Length; i++) {
|
||||
|
||||
if (!lights[i].GetComponent<LensFlare>()) {
|
||||
|
||||
LensFlare lf = lights[i].AddComponent<LensFlare>();
|
||||
lf.brightness = 0f;
|
||||
lf.color = Color.white;
|
||||
lf.fadeSpeed = 20f;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EditorUtility.SetDirty(prop);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("RCC uses ''Interpolation'' mode for all rigidbodies. Therefore, lights at front of the vehicle will blink while on high speeds. To fix this, select your RCC layer in the LensFlare component as ignored layer. RCC_Light script will simulate lens flares depending on camera distance and angle.''", EditorStyles.helpBox);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("flareBrightness"), new GUIContent("Lens Flare Brightness"), false);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useEmissionTexture"), new GUIContent("Use Emission Texture"), false);
|
||||
|
||||
if (prop.useEmissionTexture) {
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("emission"), new GUIContent("Emission"), true);
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("isBreakable"), new GUIContent("Is Breakable"), false);
|
||||
|
||||
if (prop.isBreakable) {
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("strength"), new GUIContent("Strength"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("breakPoint"), new GUIContent("Break Point"), false);
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
}
|
||||
|
||||
if (!prop.GetComponentInChildren<TrailRenderer>()) {
|
||||
|
||||
if (GUILayout.Button("Create Trail")) {
|
||||
|
||||
GameObject[] lights = Selection.gameObjects;
|
||||
|
||||
for (int i = 0; i < lights.Length; i++) {
|
||||
|
||||
if (!lights[i].GetComponentInChildren<TrailRenderer>()) {
|
||||
|
||||
GameObject newTrail = Instantiate(RCC_Settings.Instance.lightTrailers, lights[i].transform.position, lights[i].transform.rotation, lights[i].transform);
|
||||
newTrail.name = RCC_Settings.Instance.lightTrailers.name;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EditorUtility.SetDirty(prop);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (GUILayout.Button("Select Trail"))
|
||||
Selection.activeGameObject = prop.GetComponentInChildren<TrailRenderer>().gameObject;
|
||||
|
||||
}
|
||||
|
||||
if (GUI.changed)
|
||||
EditorUtility.SetDirty(prop);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
private void CheckLights() {
|
||||
|
||||
if (!prop.gameObject.activeInHierarchy)
|
||||
return;
|
||||
|
||||
if (prop.GetComponentInParent<RCC_CarControllerV3>() == null)
|
||||
return;
|
||||
|
||||
Vector3 relativePos = prop.GetComponentInParent<RCC_CarControllerV3>().transform.InverseTransformPoint(prop.transform.position);
|
||||
|
||||
if (relativePos.z > 0f) {
|
||||
|
||||
if (Mathf.Abs(prop.transform.localRotation.y) > .5f) {
|
||||
|
||||
GUI.color = Color.red;
|
||||
EditorGUILayout.HelpBox("Lights is facing to wrong direction!", MessageType.Error);
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
GUI.color = Color.green;
|
||||
|
||||
if (GUILayout.Button("Fix Rotation")) {
|
||||
|
||||
prop.transform.localRotation = Quaternion.identity;
|
||||
EditorUtility.SetDirty(prop);
|
||||
|
||||
}
|
||||
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (Mathf.Abs(prop.transform.localRotation.y) < .5f) {
|
||||
|
||||
GUI.color = Color.red;
|
||||
EditorGUILayout.HelpBox("Lights is facing to wrong direction!", MessageType.Error);
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
GUI.color = Color.green;
|
||||
|
||||
if (GUILayout.Button("Fix Rotation")) {
|
||||
|
||||
prop.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
|
||||
EditorUtility.SetDirty(prop);
|
||||
|
||||
}
|
||||
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!EditorApplication.isPlaying) {
|
||||
|
||||
GameObject[] lights = Selection.gameObjects;
|
||||
|
||||
for (int i = 0; i < lights.Length; i++) {
|
||||
|
||||
if (lights[i].GetComponent<Light>().flare != null)
|
||||
lights[i].GetComponent<Light>().flare = null;
|
||||
|
||||
if (lights[i].GetComponent<LensFlare>())
|
||||
lights[i].GetComponent<LensFlare>().brightness = 0f;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 020d92fc540ab954dbca8b802168a6e7
|
||||
timeCreated: 1461599362
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
165
Assets/RealisticCarControllerV3/Editor/RCC_RecordsEditor.cs
Normal file
165
Assets/RealisticCarControllerV3/Editor/RCC_RecordsEditor.cs
Normal file
@ -0,0 +1,165 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CustomEditor(typeof(RCC_Records))]
|
||||
public class RCC_RecordsEditor : Editor {
|
||||
|
||||
RCC_Records prop;
|
||||
|
||||
Color originalGUIColor;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
originalGUIColor = GUI.color;
|
||||
prop = (RCC_Records)target;
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("RCC Records Editor Window", EditorStyles.boldLabel);
|
||||
GUI.color = new Color(.75f, 1f, .75f);
|
||||
EditorGUILayout.LabelField("This editor will keep update necessary .asset files in your project for RCC. Don't change directory of the ''Resources/RCC Assets''.", EditorStyles.helpBox);
|
||||
GUI.color = originalGUIColor;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
GUI.color = new Color(.75f, 1f, .75f);
|
||||
EditorGUILayout.LabelField("All recorded clips are stored here. Replaying any recorded clip is so easy. Just use ''RCC.StartStopReplay(recordIndex or recordClip)'' in your script!", EditorStyles.helpBox);
|
||||
GUI.color = originalGUIColor;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
GUILayout.Label("Recorded Clips", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
|
||||
for (int i = 0; i < prop.records.Count; i++) {
|
||||
|
||||
EditorGUILayout.BeginHorizontal(GUI.skin.box);
|
||||
|
||||
EditorGUILayout.LabelField(prop.records[i].recordName);
|
||||
|
||||
GUI.color = Color.red;
|
||||
|
||||
if (GUILayout.Button("X", GUILayout.Width(25f)))
|
||||
DeleteRecord(prop.records[i]);
|
||||
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
}
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
GUI.color = Color.red;
|
||||
|
||||
if (GUILayout.Button("Delete All Records"))
|
||||
DeleteAllRecords();
|
||||
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.LabelField("Created by Buğra Özdoğanlar\nBoneCrackerGames", EditorStyles.centeredGreyMiniLabel, GUILayout.MaxHeight(50f));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
if (GUI.changed)
|
||||
EditorUtility.SetDirty(prop);
|
||||
|
||||
}
|
||||
|
||||
private void DeleteRecord(RCC_Recorder.RecordedClip record) {
|
||||
|
||||
prop.records.Remove(record);
|
||||
|
||||
}
|
||||
|
||||
private void DeleteAllRecords() {
|
||||
|
||||
prop.records.Clear();
|
||||
|
||||
}
|
||||
|
||||
// void CheckLights(){
|
||||
//
|
||||
// if (!prop.gameObject.activeInHierarchy)
|
||||
// return;
|
||||
//
|
||||
// Vector3 relativePos = prop.GetComponentInParent<RCC_CarControllerV3>().transform.InverseTransformPoint (prop.transform.position);
|
||||
//
|
||||
// if (relativePos.z > 0f) {
|
||||
//
|
||||
// if (Mathf.Abs (prop.transform.localRotation.y) > .5f) {
|
||||
//
|
||||
// GUI.color = Color.red;
|
||||
// EditorGUILayout.HelpBox ("Lights is facing to wrong direction!", MessageType.Error);
|
||||
// GUI.color = originalGUIColor;
|
||||
//
|
||||
// GUI.color = Color.green;
|
||||
//
|
||||
// if (GUILayout.Button ("Fix Rotation"))
|
||||
// prop.transform.localRotation = Quaternion.identity;
|
||||
//
|
||||
// GUI.color = originalGUIColor;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
// if (Mathf.Abs (prop.transform.localRotation.y) < .5f) {
|
||||
//
|
||||
// GUI.color = Color.red;
|
||||
// EditorGUILayout.HelpBox ("Lights is facing to wrong direction!", MessageType.Error);
|
||||
// GUI.color = originalGUIColor;
|
||||
//
|
||||
// GUI.color = Color.green;
|
||||
//
|
||||
// if (GUILayout.Button ("Fix Rotation"))
|
||||
// prop.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
|
||||
//
|
||||
// GUI.color = originalGUIColor;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// if (!EditorApplication.isPlaying) {
|
||||
//
|
||||
// GameObject[] lights = Selection.gameObjects;
|
||||
//
|
||||
// for (int i = 0; i < lights.Length; i++) {
|
||||
//
|
||||
// if (lights[i].GetComponent<Light> ().flare != null)
|
||||
// lights[i].GetComponent<Light> ().flare = null;
|
||||
//
|
||||
// if (lights[i].GetComponent<LensFlare> ())
|
||||
// lights[i].GetComponent<LensFlare> ().brightness = 0f;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46aa832494ee9e044a4e6b957f417a02
|
||||
timeCreated: 1461599362
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
180
Assets/RealisticCarControllerV3/Editor/RCC_SceneGUI.cs
Normal file
180
Assets/RealisticCarControllerV3/Editor/RCC_SceneGUI.cs
Normal file
@ -0,0 +1,180 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class RCC_SceneGUI : EditorWindow {
|
||||
|
||||
static bool enabled;
|
||||
static GUISkin skin;
|
||||
|
||||
static Texture2D cameraIcon;
|
||||
static Texture2D canvasIcon;
|
||||
static Texture2D hoodCameraIcon;
|
||||
static Texture2D wheelCameraIcon;
|
||||
static Texture2D headlightIcon;
|
||||
static Texture2D brakelightIcon;
|
||||
static Texture2D reverselightIcon;
|
||||
static Texture2D indicatorlightIcon;
|
||||
static Texture2D exhaustIcon;
|
||||
static Texture2D mirrorIcon;
|
||||
|
||||
public static void GetImages() {
|
||||
|
||||
skin = Resources.Load("RCC_WindowSkin") as GUISkin;
|
||||
|
||||
cameraIcon = Resources.Load("Editor/CameraIcon", typeof(Texture2D)) as Texture2D;
|
||||
canvasIcon = Resources.Load("Editor/CanvasIcon", typeof(Texture2D)) as Texture2D;
|
||||
hoodCameraIcon = Resources.Load("Editor/HoodCameraIcon", typeof(Texture2D)) as Texture2D;
|
||||
wheelCameraIcon = Resources.Load("Editor/WheelCameraIcon", typeof(Texture2D)) as Texture2D;
|
||||
headlightIcon = Resources.Load("Editor/HeadlightIcon", typeof(Texture2D)) as Texture2D;
|
||||
brakelightIcon = Resources.Load("Editor/BrakelightIcon", typeof(Texture2D)) as Texture2D;
|
||||
reverselightIcon = Resources.Load("Editor/ReverselightIcon", typeof(Texture2D)) as Texture2D;
|
||||
indicatorlightIcon = Resources.Load("Editor/IndicatorlightIcon", typeof(Texture2D)) as Texture2D;
|
||||
exhaustIcon = Resources.Load("Editor/ExhaustIcon", typeof(Texture2D)) as Texture2D;
|
||||
mirrorIcon = Resources.Load("Editor/MirrorIcon", typeof(Texture2D)) as Texture2D;
|
||||
|
||||
}
|
||||
|
||||
#if RCC_SHORTCUTS
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Enable In-Scene Buttons #e", false, 5000)]
|
||||
public static void Enable() {
|
||||
|
||||
GetImages();
|
||||
|
||||
if (!enabledMenu)
|
||||
SceneView.duringSceneGui += OnScene;
|
||||
|
||||
}
|
||||
#else
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Enable In-Scene Buttons", false, 5000)]
|
||||
public static void Enable() {
|
||||
|
||||
if (enabled)
|
||||
return;
|
||||
|
||||
GetImages();
|
||||
SceneView.duringSceneGui += OnScene;
|
||||
enabled = true;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Disable In-Scene Buttons", false, 5000)]
|
||||
public static void Disable() {
|
||||
|
||||
SceneView.duringSceneGui -= OnScene;
|
||||
enabled = false;
|
||||
|
||||
}
|
||||
|
||||
private static void OnScene(SceneView sceneview) {
|
||||
|
||||
GUI.skin = skin;
|
||||
|
||||
Handles.BeginGUI();
|
||||
|
||||
// Scene buttons panel.
|
||||
GUILayout.BeginArea(new Rect(10f, 10f, 75f, 200f));
|
||||
|
||||
GUILayout.BeginVertical("window");
|
||||
|
||||
GUILayout.BeginHorizontal("box");
|
||||
GUILayout.Label("Scene");
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(4);
|
||||
|
||||
if (GUILayout.Button(new GUIContent(cameraIcon, "Add / Select RCC Camera")))
|
||||
RCC_EditorWindows.CreateRCCCamera();
|
||||
|
||||
if (GUILayout.Button(new GUIContent(canvasIcon, "Add / Select RCC Canvas")))
|
||||
RCC_EditorWindows.CreateRCCCanvas();
|
||||
|
||||
|
||||
|
||||
Color defColor = GUI.color;
|
||||
GUI.color = Color.red;
|
||||
|
||||
if (GUILayout.Button(new GUIContent(" X ", "Close the in-scene window. You can enable in Tools --> BCG --> RCC")))
|
||||
Disable();
|
||||
|
||||
GUI.color = defColor;
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.EndArea();
|
||||
|
||||
// Vehicle buttons panel
|
||||
GUILayout.BeginArea(new Rect(10f, 200f, 75f, 1000f));
|
||||
|
||||
GUILayout.BeginVertical("window");
|
||||
|
||||
GUILayout.BeginHorizontal("box");
|
||||
GUILayout.Label("Vehicle");
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
if (Selection.activeGameObject != null) {
|
||||
|
||||
if (Selection.activeGameObject.GetComponentInParent<RCC_CarControllerV3>()) {
|
||||
|
||||
if (GUILayout.Button(new GUIContent(hoodCameraIcon, "Add/Select Hood Camera attached to selected vehicle")))
|
||||
RCC_EditorWindows.CreateHoodCamera();
|
||||
|
||||
if (GUILayout.Button(new GUIContent(wheelCameraIcon, "Add/Select Wheel Camera attached to selected vehicle")))
|
||||
RCC_EditorWindows.CreateWheelCamera();
|
||||
|
||||
if (GUILayout.Button(new GUIContent(headlightIcon, "Add headlights to selected vehicle")))
|
||||
RCC_EditorWindows.CreateHeadLight();
|
||||
|
||||
if (GUILayout.Button(new GUIContent(brakelightIcon, "Add brakelights to selected vehicle")))
|
||||
RCC_EditorWindows.CreateBrakeLight();
|
||||
|
||||
if (GUILayout.Button(new GUIContent(reverselightIcon, "Add reverselights to selected vehicle")))
|
||||
RCC_EditorWindows.CreateReverseLight();
|
||||
|
||||
if (GUILayout.Button(new GUIContent(indicatorlightIcon, "Add Indicatorlights to selected vehicle")))
|
||||
RCC_EditorWindows.CreateIndicatorLight();
|
||||
|
||||
if (GUILayout.Button(new GUIContent(exhaustIcon, "Add exhaust attached to selected vehicle")))
|
||||
RCC_EditorWindows.CreateExhaust();
|
||||
|
||||
if (GUILayout.Button(new GUIContent(mirrorIcon, "Add/Select mirrors attached to selected vehicle")))
|
||||
RCC_EditorWindows.CreateMirrors(Selection.activeGameObject.GetComponentInParent<RCC_CarControllerV3>().gameObject);
|
||||
|
||||
if (Selection.activeGameObject.GetComponent<RCC_Light>()) {
|
||||
|
||||
if (GUILayout.Button(new GUIContent(indicatorlightIcon, "Duplicate light to opposite direction")))
|
||||
RCC_EditorWindows.DuplicateLight();
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
GUILayout.Label("Select a RCC vehicle first");
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
GUILayout.Label("Select a RCC vehicle first");
|
||||
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.EndArea();
|
||||
|
||||
Handles.EndGUI();
|
||||
|
||||
}
|
||||
|
||||
}
|
11
Assets/RealisticCarControllerV3/Editor/RCC_SceneGUI.cs.meta
Normal file
11
Assets/RealisticCarControllerV3/Editor/RCC_SceneGUI.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7aef2869d0f4719459a11975760a42d4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,61 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CustomEditor(typeof(RCC_SceneManager))]
|
||||
public class RCC_SceneManagerEditor : Editor {
|
||||
|
||||
RCC_SceneManager prop;
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
prop = (RCC_SceneManager)target;
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.HelpBox("Scene manager that contains current player vehicle, current player camera, current player UI Canvas, current player character, recording/playing mechanim, and other vehicles as well.", MessageType.Info);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("registerLastSpawnedVehicleAsPlayerVehicle"), new GUIContent("Register Last Spawned Vehicle As Player Vehicle"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("disableUIWhenNoPlayerVehicle"), new GUIContent("Disable UI When No Player Vehicle"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("loadCustomizationAtFirst"), new GUIContent("Load Customization At First"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useRecord"), new GUIContent("Use Record / Replay"), false);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Debug", EditorStyles.boldLabel);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("activePlayerVehicle"), new GUIContent("Active Player Vehicle"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("activePlayerCamera"), new GUIContent("Active Player Camera"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("activePlayerCanvas"), new GUIContent("Active Player UI Canvas"), false);
|
||||
#if BCG_ENTEREXIT
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("activePlayerCharacter"), new GUIContent("Active Player FPS / TPS Character"), false);
|
||||
#endif
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("recordMode"), new GUIContent("Record Mode"), false);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("allVehicles"), new GUIContent("All Vehicles"), true);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
if (GUI.changed)
|
||||
EditorUtility.SetDirty(prop);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14f19dbcdeb9a234e8328f354229e88b
|
||||
timeCreated: 1514899951
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,36 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
|
||||
public static class RCC_SetControllerAuto {
|
||||
|
||||
|
||||
public static void GetPlatform() {
|
||||
|
||||
BuildTarget currentPlatform = EditorUserBuildSettings.activeBuildTarget;
|
||||
|
||||
switch (currentPlatform) {
|
||||
|
||||
case BuildTarget.Android:
|
||||
case BuildTarget.iOS:
|
||||
RCC_Settings.Instance.mobileControllerEnabled = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
RCC_Settings.Instance.mobileControllerEnabled = false;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 839eee0d17300d244ac1b24340b9da82
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,54 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public class RCC_SetScriptingSymbol {
|
||||
|
||||
public static void SetEnabled(string defineName, bool enable) {
|
||||
|
||||
foreach (BuildTarget buildTarget in Enum.GetValues(typeof(BuildTarget))) {
|
||||
|
||||
BuildTargetGroup group = BuildPipeline.GetBuildTargetGroup(buildTarget);
|
||||
|
||||
if (group == BuildTargetGroup.Unknown)
|
||||
continue;
|
||||
|
||||
var curDefineSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(group).Split(';').Select(d => d.Trim()).ToList();
|
||||
|
||||
if (enable) {
|
||||
|
||||
if (!curDefineSymbols.Contains(defineName)) {
|
||||
curDefineSymbols.Add(defineName);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (curDefineSymbols.Contains(defineName))
|
||||
curDefineSymbols.Remove(defineName);
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(group, string.Join(";", curDefineSymbols.ToArray()));
|
||||
} catch (Exception e) {
|
||||
Debug.Log("Could not set " + defineName + " scripting define symbol for build target: " + buildTarget + " group: " + group + " " + e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dd58f86e3fcf6304b8094faf4fb6d460
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
434
Assets/RealisticCarControllerV3/Editor/RCC_SettingsEditor.cs
Normal file
434
Assets/RealisticCarControllerV3/Editor/RCC_SettingsEditor.cs
Normal file
@ -0,0 +1,434 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CustomEditor(typeof(RCC_Settings))]
|
||||
public class RCC_SettingsEditor : Editor {
|
||||
|
||||
private RCC_Settings RCCSettingsAsset;
|
||||
|
||||
private Color originalGUIColor;
|
||||
private Vector2 scrollPos;
|
||||
private PhysicMaterial[] physicMaterials;
|
||||
|
||||
private bool foldGeneralSettings = false;
|
||||
private bool foldBehaviorSettings = false;
|
||||
private bool foldControllerSettings = false;
|
||||
private bool foldUISettings = false;
|
||||
private bool foldWheelPhysics = false;
|
||||
private bool foldSFX = false;
|
||||
private bool foldOptimization = false;
|
||||
private bool foldTagsAndLayers = false;
|
||||
|
||||
public bool RCC_Shortcuts {
|
||||
|
||||
get {
|
||||
|
||||
bool _bool = RCC_Settings.Instance.useShortcuts;
|
||||
return _bool;
|
||||
|
||||
}
|
||||
|
||||
set {
|
||||
|
||||
bool _bool = RCC_Settings.Instance.useShortcuts;
|
||||
|
||||
if (_bool == value)
|
||||
return;
|
||||
|
||||
RCC_Settings.Instance.useShortcuts = value;
|
||||
RCC_SetScriptingSymbol.SetEnabled("RCC_SHORTCUTS", value);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnEnable() {
|
||||
|
||||
foldGeneralSettings = RCC_Settings.Instance.foldGeneralSettings;
|
||||
foldBehaviorSettings = RCC_Settings.Instance.foldBehaviorSettings;
|
||||
foldControllerSettings = RCC_Settings.Instance.foldControllerSettings;
|
||||
foldUISettings = RCC_Settings.Instance.foldUISettings;
|
||||
foldWheelPhysics = RCC_Settings.Instance.foldWheelPhysics;
|
||||
foldSFX = RCC_Settings.Instance.foldSFX;
|
||||
foldOptimization = RCC_Settings.Instance.foldOptimization;
|
||||
foldTagsAndLayers = RCC_Settings.Instance.foldTagsAndLayers;
|
||||
|
||||
}
|
||||
|
||||
private void OnDestroy() {
|
||||
|
||||
RCC_Settings.Instance.foldBehaviorSettings = foldBehaviorSettings;
|
||||
RCC_Settings.Instance.foldControllerSettings = foldControllerSettings;
|
||||
RCC_Settings.Instance.foldUISettings = foldUISettings;
|
||||
RCC_Settings.Instance.foldWheelPhysics = foldWheelPhysics;
|
||||
RCC_Settings.Instance.foldSFX = foldSFX;
|
||||
RCC_Settings.Instance.foldOptimization = foldOptimization;
|
||||
RCC_Settings.Instance.foldTagsAndLayers = foldTagsAndLayers;
|
||||
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
|
||||
RCCSettingsAsset = (RCC_Settings)target;
|
||||
serializedObject.Update();
|
||||
|
||||
originalGUIColor = GUI.color;
|
||||
EditorGUIUtility.labelWidth = 250;
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("RCC Settings Editor Window", EditorStyles.boldLabel);
|
||||
GUI.color = new Color(.75f, 1f, .75f);
|
||||
EditorGUILayout.LabelField("This editor will keep update necessary .asset files in your project for RCC. Don't change directory of the ''Resources/RCC Assets''.", EditorStyles.helpBox);
|
||||
GUI.color = originalGUIColor;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
|
||||
scrollPos = EditorGUILayout.BeginScrollView(scrollPos, false, false);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
foldGeneralSettings = EditorGUILayout.Foldout(foldGeneralSettings, "General Settings");
|
||||
|
||||
if (foldGeneralSettings) {
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
GUILayout.Label("General Settings", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("overrideFixedTimeStep"), new GUIContent("Override FixedTimeStep"));
|
||||
|
||||
if (RCCSettingsAsset.overrideFixedTimeStep)
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("fixedTimeStep"), new GUIContent("Fixed Timestep"));
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maxAngularVelocity"), new GUIContent("Maximum Angular Velocity"));
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("overrideFPS"), new GUIContent("Override FPS"));
|
||||
|
||||
if (RCCSettingsAsset.overrideFPS)
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maxFPS"), new GUIContent("Maximum FPS"));
|
||||
|
||||
EditorGUILayout.HelpBox("You can find all references to any mode. Open up ''RCC_Settings.cs'' and right click to any mode. Hit ''Find references'' to find all modifications.", MessageType.Info);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useFixedWheelColliders"), new GUIContent("Use Fixed WheelColliders", "Improves stability by increasing mass of the WheelColliders."));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("lockAndUnlockCursor"), new GUIContent("Locks Cursor", "Locks Cursor."));
|
||||
|
||||
RCC_Shortcuts = EditorGUILayout.Toggle(new GUIContent("Use Editor Shortcuts", "It will enable shortcuts. Shift + E = In-Scene GUI, Shift + R = Add Main Car Controller, Shift + S = RCC Settings."), RCC_Shortcuts);
|
||||
|
||||
if (RCC_Shortcuts)
|
||||
EditorGUILayout.HelpBox("Shift + E = In-Scene GUI, Shift + R = Add Main Car Controller, Shift + S = RCC Settings.", MessageType.None, true);
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
foldBehaviorSettings = EditorGUILayout.Foldout(foldBehaviorSettings, "Behavior Settings");
|
||||
|
||||
if (foldBehaviorSettings) {
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
GUILayout.Label("Behavior Settings", EditorStyles.boldLabel);
|
||||
|
||||
GUI.color = new Color(.75f, 1f, .75f);
|
||||
EditorGUILayout.HelpBox("Using behavior preset will override wheelcollider settings, chassis joint, antirolls, and other stuff.", MessageType.Info);
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
RCCSettingsAsset.overrideBehavior = EditorGUILayout.BeginToggleGroup("Override Behavior", RCCSettingsAsset.overrideBehavior);
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("behaviorTypes"), new GUIContent("Behavior Types"), true);
|
||||
|
||||
List<string> behaviorTypeStrings = new List<string>();
|
||||
|
||||
GUI.color = new Color(.5f, 1f, 1f, 1f);
|
||||
|
||||
for (int i = 0; i < RCCSettingsAsset.behaviorTypes.Length; i++)
|
||||
behaviorTypeStrings.Add(RCCSettingsAsset.behaviorTypes[i].behaviorName);
|
||||
|
||||
RCCSettingsAsset.behaviorSelectedIndex = GUILayout.Toolbar(RCCSettingsAsset.behaviorSelectedIndex, behaviorTypeStrings.ToArray());
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
EditorGUILayout.EndToggleGroup();
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
foldControllerSettings = EditorGUILayout.Foldout(foldControllerSettings, "Controller Settings");
|
||||
|
||||
if (foldControllerSettings) {
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (GUILayout.Button("Edit Inputs"))
|
||||
Selection.activeObject = Resources.Load(RCC_AssetPaths.inputsPath);
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
GUILayout.Label("Mobile Controller Settings", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("mobileControllerEnabled"), new GUIContent("Mobile Controller Enabled"));
|
||||
|
||||
if (RCCSettingsAsset.mobileControllerEnabled) {
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.HelpBox("Mobile UI controller buttons will be used.", MessageType.Info);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("mobileController"), new GUIContent("Mobile Controller Type"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("UIButtonSensitivity"), new GUIContent("Mobile UI Button Sensitivity"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("UIButtonGravity"), new GUIContent("Mobile UI Button Gravity"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("gyroSensitivity"), new GUIContent("Mobile Gyro Sensitivity"));
|
||||
EditorGUI.indentLevel--;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
GUILayout.Label("Main Controller Settings", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("units"), new GUIContent("Units"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("autoReset"), new GUIContent("Auto Reset"));
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
foldUISettings = EditorGUILayout.Foldout(foldUISettings, "UI Settings");
|
||||
|
||||
if (foldUISettings) {
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
GUILayout.Label("UI Dashboard Settings", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useTelemetry"), new GUIContent("Use Telemetry"));
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
foldWheelPhysics = EditorGUILayout.Foldout(foldWheelPhysics, "Wheel Physics Settings");
|
||||
|
||||
if (foldWheelPhysics) {
|
||||
|
||||
if (RCC_GroundMaterials.Instance.frictions != null && RCC_GroundMaterials.Instance.frictions.Length > 0) {
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
GUILayout.Label("Ground Physic Materials", EditorStyles.boldLabel);
|
||||
|
||||
physicMaterials = new PhysicMaterial[RCC_GroundMaterials.Instance.frictions.Length];
|
||||
|
||||
for (int i = 0; i < physicMaterials.Length; i++) {
|
||||
physicMaterials[i] = RCC_GroundMaterials.Instance.frictions[i].groundMaterial;
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
EditorGUILayout.ObjectField("Ground Physic Materials " + i, physicMaterials[i], typeof(PhysicMaterial), false);
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
}
|
||||
|
||||
GUI.color = new Color(.5f, 1f, 1f, 1f);
|
||||
|
||||
if (GUILayout.Button("Configure Ground Physic Materials")) {
|
||||
Selection.activeObject = RCC_GroundMaterials.Instance;
|
||||
}
|
||||
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
foldSFX = EditorGUILayout.Foldout(foldSFX, "SFX Settings");
|
||||
|
||||
if (foldSFX) {
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
GUILayout.Label("Sound FX", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
GUI.color = new Color(.5f, 1f, 1f, 1f);
|
||||
|
||||
if (GUILayout.Button("Configure Wheel Slip Sounds"))
|
||||
Selection.activeObject = RCC_GroundMaterials.Instance;
|
||||
|
||||
GUI.color = originalGUIColor;
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("audioMixer"), new GUIContent("Main Audio Mixer"), false);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("crashClips"), new GUIContent("Crashing Sounds"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("gearShiftingClips"), new GUIContent("Gear Shifting Sounds"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("indicatorClip"), new GUIContent("Indicator Clip"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("bumpClip"), new GUIContent("Wheel Bump Clip"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("exhaustFlameClips"), new GUIContent("Exhaust Flame Clips"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("NOSClip"), new GUIContent("NOS Clip"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("turboClip"), new GUIContent("Turbo Clip"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("blowoutClip"), new GUIContent("Turbo Blowout Clip"), true);
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("reversingClip"), new GUIContent("Reverse Transmission Sound"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("windClip"), new GUIContent("Wind Sound"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("brakeClip"), new GUIContent("Brake Sound"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("wheelDeflateClip"), new GUIContent("Wheel Deflate Sound"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("wheelInflateClip"), new GUIContent("Wheel Inflate Sound"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("wheelFlatClip"), new GUIContent("Wheel Flat Sound"), true);
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maxGearShiftingSoundVolume"), new GUIContent("Max Gear Shifting Sound Volume"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maxCrashSoundVolume"), new GUIContent("Max Crash Sound Volume"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maxWindSoundVolume"), new GUIContent("Max Wind Sound Volume"), true);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("maxBrakeSoundVolume"), new GUIContent("Max Brake Sound Volume"), true);
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
foldOptimization = EditorGUILayout.Foldout(foldOptimization, "Optimization");
|
||||
|
||||
if (foldOptimization) {
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
GUILayout.Label("Optimization", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useHeadLightsAsVertexLights"), new GUIContent("Head Lights As Vertex Lights"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useBrakeLightsAsVertexLights"), new GUIContent("Brake Lights As Vertex Lights"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useReverseLightsAsVertexLights"), new GUIContent("Reverse Lights As Vertex Lights"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useIndicatorLightsAsVertexLights"), new GUIContent("Indicator Lights As Vertex Lights"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("useOtherLightsAsVertexLights"), new GUIContent("Other Lights As Vertex Lights"));
|
||||
GUI.color = new Color(.75f, 1f, .75f);
|
||||
EditorGUILayout.HelpBox("Always use vertex lights for mobile platform. Even only one pixel light will drop your performance dramaticaly.", MessageType.Info);
|
||||
GUI.color = originalGUIColor;
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("dontUseAnyParticleEffects"), new GUIContent("Do Not Use Any Particle Effects"));
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("dontUseSkidmarks"), new GUIContent("Do Not Use Skidmarks"));
|
||||
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
foldTagsAndLayers = EditorGUILayout.Foldout(foldTagsAndLayers, "Tags & Layers");
|
||||
|
||||
if (foldTagsAndLayers) {
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
GUILayout.Label("Tags & Layers", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("setLayers"), new GUIContent("Set Layers Auto"), false);
|
||||
|
||||
if (RCCSettingsAsset.setLayers) {
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("RCCLayer"), new GUIContent("Vehicle Layer"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("WheelColliderLayer"), new GUIContent("WheelCollider Layer"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("DetachablePartLayer"), new GUIContent("DetachablePart Layer"), false);
|
||||
GUI.color = new Color(.75f, 1f, .75f);
|
||||
EditorGUILayout.HelpBox("Be sure you have that tag and layer in your Tags & Layers", MessageType.Warning);
|
||||
EditorGUILayout.HelpBox("All vehicles powered by Realistic Car Controller are using this layer. What does this layer do? It was used for masking wheel rays, light masks, and projector masks. Just create a new layer for vehicles from Edit --> Project Settings --> Tags & Layers, and select the layer here.", MessageType.Info);
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
GUILayout.Label("Resources", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("headLights"), new GUIContent("Head Lights"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("brakeLights"), new GUIContent("Brake Lights"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("reverseLights"), new GUIContent("Reverse Lights"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("indicatorLights"), new GUIContent("Indicator Lights"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("lightTrailers"), new GUIContent("Light Trailers"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("mirrors"), new GUIContent("Mirrors"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("skidmarksManager"), new GUIContent("Skidmarks Manager"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("exhaustGas"), new GUIContent("Exhaust Gas"), false);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("RCCMainCamera"), new GUIContent("RCC Main Camera"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("hoodCamera"), new GUIContent("Hood Camera"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("cinematicCamera"), new GUIContent("Cinematic Camera"), false);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("RCCCanvas"), new GUIContent("RCC UI Canvas"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("RCCTelemetry"), new GUIContent("RCC Telemetry Canvas"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("RCCModificationCanvas"), new GUIContent("RCC Modification Canvas"), false);
|
||||
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("contactParticles"), new GUIContent("Contact Particles On Collisions"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("scratchParticles"), new GUIContent("Scratch Particles On Collisions"), false);
|
||||
EditorGUILayout.PropertyField(serializedObject.FindProperty("wheelDeflateParticles"), new GUIContent("Wheel Deflate Particles"), false);
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.EndScrollView();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.button);
|
||||
|
||||
GUI.color = new Color(.5f, 1f, 1f, 1f);
|
||||
|
||||
if (GUILayout.Button("Open PDF Documentation")) {
|
||||
|
||||
string url = "http://www.bonecrackergames.com/realistic-car-controller";
|
||||
Application.OpenURL(url);
|
||||
|
||||
}
|
||||
|
||||
GUI.color = originalGUIColor;
|
||||
|
||||
EditorGUILayout.LabelField("Realistic Car Controller " + RCC_Version.version + " \nBoneCracker Games", EditorStyles.centeredGreyMiniLabel, GUILayout.MaxHeight(50f));
|
||||
|
||||
EditorGUILayout.LabelField("Created by Buğra Özdoğanlar", EditorStyles.centeredGreyMiniLabel, GUILayout.MaxHeight(50f));
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
if (GUI.changed)
|
||||
EditorUtility.SetDirty(RCCSettingsAsset);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b7a9461ce3929c42b6203d6c89821b6
|
||||
timeCreated: 1461599362
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,495 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public class RCC_VehicleCreateWizard : EditorWindow {
|
||||
|
||||
private GameObject currentSelectedObject;
|
||||
private RCC_CarControllerV3 currentSelectedVehicle;
|
||||
private int wheelSetup = 0;
|
||||
private Color guiColor;
|
||||
|
||||
private const int windowWidth = 450;
|
||||
private const int windowHeight = 850;
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Open Vehicle Create Wizard", false, -80)]
|
||||
public static void OpenWindow() {
|
||||
|
||||
GetWindow<RCC_VehicleCreateWizard>(true);
|
||||
|
||||
}
|
||||
|
||||
private void OnEnable() {
|
||||
|
||||
titleContent = new GUIContent("Vehicle Create Wizard");
|
||||
maxSize = new Vector2(windowWidth, windowHeight);
|
||||
minSize = maxSize;
|
||||
guiColor = GUI.color;
|
||||
|
||||
}
|
||||
|
||||
private void OnGUI() {
|
||||
|
||||
EditorGUILayout.LabelField("This wizard will guide to create new vehicles just in a few seconds.", EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField("Please follow below steps carefully and build your new vehicle.", EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField("Be sure your model is eligible for vehicle physics. Info in the documentations.", EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField("Once you completed all steps, you won't need to use the wizard anymore.", EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField("You can configure your vehicle from the inspector panel afterwards.", EditorStyles.boldLabel);
|
||||
|
||||
if (EditorApplication.isPlaying)
|
||||
return;
|
||||
|
||||
if (Selection.gameObjects.Length > 1) {
|
||||
|
||||
if (!EditorApplication.isPlaying)
|
||||
Repaint();
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (Selection.activeGameObject != null && !Selection.activeGameObject.activeSelf) {
|
||||
|
||||
if (!EditorApplication.isPlaying)
|
||||
Repaint();
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
currentSelectedObject = Selection.activeGameObject;
|
||||
|
||||
if (currentSelectedObject != null && currentSelectedObject.GetComponentInParent<RCC_CarControllerV3>())
|
||||
currentSelectedVehicle = currentSelectedObject.GetComponentInParent<RCC_CarControllerV3>();
|
||||
else
|
||||
currentSelectedVehicle = null;
|
||||
|
||||
bool isPersistent = EditorUtility.IsPersistent(currentSelectedObject);
|
||||
|
||||
if (isPersistent) {
|
||||
|
||||
EditorGUILayout.LabelField("Please select the model on your scene, not in the project.");
|
||||
EditorGUILayout.LabelField("Drag and drop your model to the scene to get started.");
|
||||
|
||||
if (!EditorApplication.isPlaying)
|
||||
Repaint();
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
EditorGUILayout.LabelField("1. RCC_CarControllerV3", EditorStyles.boldLabel);
|
||||
|
||||
if (currentSelectedVehicle == null)
|
||||
EditorGUILayout.LabelField("Please select the parent vehicle gameobject to add main controller.");
|
||||
|
||||
if (currentSelectedVehicle != null)
|
||||
EditorGUILayout.ObjectField("Vehicle", currentSelectedVehicle, typeof(GameObject), true);
|
||||
|
||||
if (currentSelectedObject != null && currentSelectedVehicle == null && GUILayout.Button("Create & Add Main Controller To " + "[" + currentSelectedObject.name + "]")) {
|
||||
|
||||
bool verify = EditorUtility.DisplayDialog("Verify the model", "Are you sure selected gameobject is parent of your vehicle? Please don't select child gameobject of the model.", "Yes, it's parent object", "No, it's child object");
|
||||
|
||||
if (verify)
|
||||
AddMainController(currentSelectedObject);
|
||||
|
||||
EditorUtility.SetDirty(currentSelectedVehicle);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
if (!currentSelectedVehicle) {
|
||||
|
||||
if (!EditorApplication.isPlaying)
|
||||
Repaint();
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
EditorGUILayout.LabelField("2. Wheels", EditorStyles.boldLabel);
|
||||
|
||||
wheelSetup = 0;
|
||||
|
||||
if (currentSelectedVehicle.FrontLeftWheelTransform != null)
|
||||
wheelSetup++;
|
||||
|
||||
if (currentSelectedVehicle.FrontRightWheelTransform != null)
|
||||
wheelSetup++;
|
||||
|
||||
if (currentSelectedVehicle.RearLeftWheelTransform != null)
|
||||
wheelSetup++;
|
||||
|
||||
if (currentSelectedVehicle.RearRightWheelTransform != null)
|
||||
wheelSetup++;
|
||||
|
||||
switch (wheelSetup) {
|
||||
|
||||
case 0:
|
||||
|
||||
EditorGUILayout.LabelField("Please select the proper wheel model of the vehicle and click the button.");
|
||||
EditorGUILayout.LabelField("Once you selected all wheel models, you can create their wheelcolliders.");
|
||||
|
||||
if (GUILayout.Button("I've Selected [Front Left Wheel Model] Now")) {
|
||||
|
||||
currentSelectedVehicle.FrontLeftWheelTransform = Selection.activeGameObject.transform;
|
||||
EditorUtility.SetDirty(currentSelectedVehicle);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
if (GUILayout.Button("I've Selected [Front Right Wheel Model] Now")) {
|
||||
|
||||
currentSelectedVehicle.FrontRightWheelTransform = Selection.activeGameObject.transform;
|
||||
EditorUtility.SetDirty(currentSelectedVehicle);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
||||
if (GUILayout.Button("I've Selected [Rear Left Wheel Model] Now")) {
|
||||
|
||||
currentSelectedVehicle.RearLeftWheelTransform = Selection.activeGameObject.transform;
|
||||
EditorUtility.SetDirty(currentSelectedVehicle);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
||||
if (GUILayout.Button("I've Selected [Rear Right Wheel Model] Now")) {
|
||||
|
||||
currentSelectedVehicle.RearRightWheelTransform = Selection.activeGameObject.transform;
|
||||
EditorUtility.SetDirty(currentSelectedVehicle);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Select All Wheels Again")) {
|
||||
|
||||
currentSelectedVehicle.FrontLeftWheelTransform = null;
|
||||
currentSelectedVehicle.FrontRightWheelTransform = null;
|
||||
currentSelectedVehicle.RearLeftWheelTransform = null;
|
||||
currentSelectedVehicle.RearRightWheelTransform = null;
|
||||
wheelSetup = 0;
|
||||
|
||||
bool hasWheelColliders = false;
|
||||
|
||||
if (currentSelectedVehicle.transform.Find("Wheel Colliders"))
|
||||
hasWheelColliders = true;
|
||||
|
||||
if (hasWheelColliders)
|
||||
DestroyImmediate(currentSelectedVehicle.transform.Find("Wheel Colliders").gameObject);
|
||||
|
||||
EditorUtility.SetDirty(currentSelectedVehicle);
|
||||
|
||||
}
|
||||
|
||||
if (currentSelectedVehicle.FrontLeftWheelTransform)
|
||||
EditorGUILayout.ObjectField("Front Left Wheel", currentSelectedVehicle.FrontLeftWheelTransform.gameObject, typeof(GameObject), true);
|
||||
|
||||
if (currentSelectedVehicle.FrontRightWheelTransform)
|
||||
EditorGUILayout.ObjectField("Front Right Wheel", currentSelectedVehicle.FrontRightWheelTransform.gameObject, typeof(GameObject), true);
|
||||
|
||||
if (currentSelectedVehicle.RearLeftWheelTransform)
|
||||
EditorGUILayout.ObjectField("Rear Left Wheel", currentSelectedVehicle.RearLeftWheelTransform.gameObject, typeof(GameObject), true);
|
||||
|
||||
if (currentSelectedVehicle.RearRightWheelTransform)
|
||||
EditorGUILayout.ObjectField("Rear Right Wheel", currentSelectedVehicle.RearRightWheelTransform.gameObject, typeof(GameObject), true);
|
||||
|
||||
if (currentSelectedVehicle.FrontLeftWheelTransform && currentSelectedVehicle.FrontRightWheelTransform && currentSelectedVehicle.RearLeftWheelTransform && currentSelectedVehicle.RearRightWheelTransform) {
|
||||
|
||||
bool hasWheelColliders = false;
|
||||
|
||||
if (currentSelectedVehicle.transform.Find("Wheel Colliders"))
|
||||
hasWheelColliders = true;
|
||||
|
||||
if (!hasWheelColliders) {
|
||||
|
||||
if (GUILayout.Button("Create WheelColliders")) {
|
||||
|
||||
currentSelectedVehicle.CreateWheelColliders();
|
||||
|
||||
bool createCenter = EditorUtility.DisplayDialog("Create WheelColliders", "Do you want to create wheelcollider at the center of the wheel, or with suspension distance?", "Center", "With Suspension Distance");
|
||||
|
||||
if (createCenter) {
|
||||
|
||||
RCC_WheelCollider[] wheels = currentSelectedVehicle.GetComponentsInChildren<RCC_WheelCollider>();
|
||||
|
||||
foreach (RCC_WheelCollider wc in wheels)
|
||||
wc.transform.position += currentSelectedVehicle.transform.up * (wc.WheelCollider.suspensionDistance / 2f);
|
||||
|
||||
}
|
||||
|
||||
EditorUtility.SetDirty(currentSelectedVehicle);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (GUILayout.Button("Delete WheelColliders")) {
|
||||
|
||||
DestroyImmediate(currentSelectedVehicle.transform.Find("Wheel Colliders").gameObject);
|
||||
EditorUtility.SetDirty(currentSelectedVehicle);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
EditorGUILayout.LabelField("3. COM", EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField("Please place the COM (Center of mass) correctly.");
|
||||
EditorGUILayout.LabelField("If you are not sure how to place it, you can use the auto place button.");
|
||||
|
||||
if (GUILayout.Button("Select And Place COM"))
|
||||
Selection.activeGameObject = currentSelectedVehicle.COM.gameObject;
|
||||
|
||||
if (GUILayout.Button("Auto Place COM")) {
|
||||
|
||||
Selection.activeGameObject = currentSelectedVehicle.COM.gameObject;
|
||||
currentSelectedVehicle.COM.transform.localPosition = new Vector3(0f, currentSelectedVehicle.FrontLeftWheelCollider.transform.localPosition.y - (currentSelectedVehicle.FrontLeftWheelCollider.GetComponent<WheelCollider>().suspensionDistance / 2f), currentSelectedVehicle.FrontLeftWheelCollider.transform.localPosition.z + currentSelectedVehicle.RearLeftWheelCollider.transform.localPosition.z);
|
||||
EditorUtility.SetDirty(currentSelectedVehicle);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
EditorGUILayout.LabelField("4. Collider", EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField("Be sure your vehicle has a mesh collider or box collider.");
|
||||
EditorGUILayout.LabelField("You can select main part of the vehicle and a mesh / box collider.");
|
||||
|
||||
Collider[] colliders = currentSelectedVehicle.GetComponentsInChildren<Collider>();
|
||||
bool colliderFound = false;
|
||||
|
||||
for (int i = 0; i < colliders.Length; i++) {
|
||||
|
||||
if (!(colliders[i] as WheelCollider)) {
|
||||
|
||||
colliderFound = true;
|
||||
EditorGUILayout.ObjectField("Found Collider ", colliders[i].gameObject, typeof(GameObject), true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
EditorGUILayout.LabelField("5. Addons", EditorStyles.boldLabel);
|
||||
EditorGUILayout.LabelField("You can add cameras, lights, exhausts, and all other essentials with in-screen UI.");
|
||||
|
||||
if (GUILayout.Button("Enable In-Scene UI Buttons")) {
|
||||
|
||||
RCC_SceneGUI.Enable();
|
||||
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Disable In-Scene UI Buttons")) {
|
||||
|
||||
RCC_SceneGUI.Disable();
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUI.skin.box);
|
||||
|
||||
EditorGUILayout.LabelField("6. Status", EditorStyles.boldLabel);
|
||||
|
||||
if (currentSelectedVehicle)
|
||||
GUI.color = Color.green;
|
||||
else
|
||||
GUI.color = Color.red;
|
||||
|
||||
EditorGUILayout.LabelField("Car Controller", EditorStyles.boldLabel);
|
||||
|
||||
if (currentSelectedVehicle.FrontLeftWheelTransform && currentSelectedVehicle.FrontRightWheelTransform && currentSelectedVehicle.RearLeftWheelTransform && currentSelectedVehicle.RearRightWheelTransform && currentSelectedVehicle.FrontLeftWheelCollider && currentSelectedVehicle.FrontRightWheelCollider && currentSelectedVehicle.RearLeftWheelCollider && currentSelectedVehicle.RearRightWheelCollider)
|
||||
GUI.color = Color.green;
|
||||
else
|
||||
GUI.color = Color.red;
|
||||
|
||||
EditorGUILayout.LabelField("Wheel Models & Wheel Colliders", EditorStyles.boldLabel);
|
||||
|
||||
GUI.color = guiColor;
|
||||
|
||||
if (colliderFound)
|
||||
GUI.color = Color.green;
|
||||
else
|
||||
GUI.color = Color.red;
|
||||
|
||||
EditorGUILayout.LabelField("Colliders", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
if (!EditorApplication.isPlaying)
|
||||
Repaint();
|
||||
|
||||
}
|
||||
|
||||
private void AddMainController(GameObject currentSelectedObject) {
|
||||
|
||||
wheelSetup = 0;
|
||||
|
||||
if (!currentSelectedObject.GetComponentInParent<RCC_CarControllerV3>()) {
|
||||
|
||||
bool isPrefab = PrefabUtility.IsAnyPrefabInstanceRoot(currentSelectedObject);
|
||||
|
||||
if (isPrefab) {
|
||||
|
||||
bool isModelPrefab = PrefabUtility.IsPartOfModelPrefab(currentSelectedObject);
|
||||
bool unpackPrefab = EditorUtility.DisplayDialog("Unpack Prefab", "This gameobject is connected to a " + (isModelPrefab ? "model" : "") + " prefab. Would you like to unpack the prefab completely? If you don't unpack it, you won't be able to move, reorder, or delete any children instance of the prefab.", "Unpack", "Don't Unpack");
|
||||
|
||||
if (unpackPrefab)
|
||||
PrefabUtility.UnpackPrefabInstance(currentSelectedObject, PrefabUnpackMode.Completely, InteractionMode.AutomatedAction);
|
||||
|
||||
}
|
||||
|
||||
bool fixPivot = EditorUtility.DisplayDialog("Fix Pivot Position Of The Vehicle", "Would you like to fix pivot position of the vehicle? If your vehicle has correct pivot position, select no.", "Fix", "No");
|
||||
|
||||
if (fixPivot) {
|
||||
|
||||
GameObject pivot = new GameObject(currentSelectedObject.name);
|
||||
pivot.transform.position = RCC_GetBounds.GetBoundsCenter(currentSelectedObject.transform);
|
||||
pivot.transform.rotation = currentSelectedObject.transform.rotation;
|
||||
|
||||
pivot.AddComponent<RCC_CarControllerV3>();
|
||||
|
||||
Rigidbody rigid = pivot.GetComponent<Rigidbody>();
|
||||
rigid.mass = RCC_InitialSettings.Instance.mass;
|
||||
rigid.drag = RCC_InitialSettings.Instance.drag;
|
||||
rigid.angularDrag = RCC_InitialSettings.Instance.angularDrag;
|
||||
rigid.interpolation = RCC_InitialSettings.Instance.interpolation;
|
||||
|
||||
currentSelectedObject.transform.SetParent(pivot.transform);
|
||||
Selection.activeGameObject = pivot;
|
||||
|
||||
} else {
|
||||
|
||||
currentSelectedObject.AddComponent<RCC_CarControllerV3>();
|
||||
|
||||
Rigidbody rigid = currentSelectedObject.GetComponent<Rigidbody>();
|
||||
rigid.mass = RCC_InitialSettings.Instance.mass;
|
||||
rigid.drag = RCC_InitialSettings.Instance.drag;
|
||||
rigid.angularDrag = RCC_InitialSettings.Instance.angularDrag;
|
||||
rigid.interpolation = RCC_InitialSettings.Instance.interpolation;
|
||||
|
||||
Selection.activeGameObject = currentSelectedObject;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
EditorUtility.DisplayDialog("Your Gameobject Already Has Realistic Car Controller", "Your Gameobject Already Has Realistic Car Controller", "Close");
|
||||
Selection.activeGameObject = currentSelectedObject;
|
||||
|
||||
}
|
||||
|
||||
if (currentSelectedObject.GetComponentInParent<RCC_CarControllerV3>())
|
||||
currentSelectedVehicle = currentSelectedObject.GetComponentInParent<RCC_CarControllerV3>();
|
||||
|
||||
if (RCC_Settings.Instance.setLayers && !EditorApplication.isPlaying)
|
||||
SetLayers();
|
||||
|
||||
if (currentSelectedVehicle.autoGenerateEngineRPMCurve)
|
||||
currentSelectedVehicle.ReCreateEngineTorqueCurve();
|
||||
|
||||
}
|
||||
|
||||
private void SetLayers() {
|
||||
|
||||
if (string.IsNullOrEmpty(RCC_Settings.Instance.RCCLayer)) {
|
||||
|
||||
Debug.LogError("RCC Layer is missing in RCC Settings. Go to Tools --> BoneCracker Games --> RCC --> Edit Settings, and set the layer of RCC.");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
Transform[] allTransforms = currentSelectedVehicle.GetComponentsInChildren<Transform>(true);
|
||||
|
||||
foreach (Transform t in allTransforms) {
|
||||
|
||||
int layerInt = LayerMask.NameToLayer(RCC_Settings.Instance.RCCLayer);
|
||||
|
||||
if (layerInt >= 0 && layerInt <= 31) {
|
||||
|
||||
if (!t.GetComponent<RCC_Light>()) {
|
||||
|
||||
t.gameObject.layer = LayerMask.NameToLayer(RCC_Settings.Instance.RCCLayer);
|
||||
|
||||
if (t.GetComponent<RCC_WheelCollider>())
|
||||
t.gameObject.layer = LayerMask.NameToLayer(RCC_Settings.Instance.WheelColliderLayer);
|
||||
|
||||
if (t.GetComponent<RCC_DetachablePart>())
|
||||
t.gameObject.layer = LayerMask.NameToLayer(RCC_Settings.Instance.DetachablePartLayer);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
Debug.LogError("RCC layers selected in RCC Settings doesn't exist on your Tags & Layers. Go to Edit --> Project Settings --> Tags & Layers, and create a new layer named ''" + RCC_Settings.Instance.RCCLayer + " " + RCC_Settings.Instance.WheelColliderLayer + " " + RCC_Settings.Instance.DetachablePartLayer + "''.");
|
||||
Debug.LogError("From now on, ''Setting Layers'' disabled in RCC Settings! You can enable this when you created this layer.");
|
||||
|
||||
foreach (Transform tr in allTransforms)
|
||||
tr.gameObject.layer = LayerMask.NameToLayer("Default");
|
||||
|
||||
RCC_Settings.Instance.setLayers = false;
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 792cbdd681b9ce14aabef511f03ec357
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
617
Assets/RealisticCarControllerV3/Editor/RCC_WelcomeWindow.cs
Normal file
617
Assets/RealisticCarControllerV3/Editor/RCC_WelcomeWindow.cs
Normal file
@ -0,0 +1,617 @@
|
||||
//----------------------------------------------
|
||||
// Realistic Car Controller
|
||||
//
|
||||
// Copyright © 2014 - 2023 BoneCracker Games
|
||||
// https://www.bonecrackergames.com
|
||||
// Buğra Özdoğanlar
|
||||
//
|
||||
//----------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
|
||||
[InitializeOnLoad]
|
||||
public class RCC_WelcomeWindow : EditorWindow {
|
||||
|
||||
public class ToolBar {
|
||||
|
||||
public string title;
|
||||
public UnityEngine.Events.UnityAction Draw;
|
||||
|
||||
/// <summary>
|
||||
/// Create New Toolbar
|
||||
/// </summary>
|
||||
/// <param name="title">Title</param>
|
||||
/// <param name="onDraw">Method to draw when toolbar is selected</param>
|
||||
public ToolBar(string title, UnityEngine.Events.UnityAction onDraw) {
|
||||
|
||||
this.title = title;
|
||||
this.Draw = onDraw;
|
||||
|
||||
}
|
||||
|
||||
public static implicit operator string(ToolBar tool) {
|
||||
return tool.title;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Index of selected toolbar.
|
||||
/// </summary>
|
||||
public int toolBarIndex = 0;
|
||||
|
||||
/// <summary>
|
||||
/// List of Toolbars
|
||||
/// </summary>
|
||||
public ToolBar[] toolBars = new ToolBar[]{
|
||||
|
||||
new ToolBar("Welcome", WelcomePageContent),
|
||||
new ToolBar("Demos", DemosPageContent),
|
||||
new ToolBar("Updates", UpdatePageContent),
|
||||
new ToolBar("Addons", Addons),
|
||||
new ToolBar("DOCS", Documentations)
|
||||
|
||||
};
|
||||
|
||||
public static Texture2D bannerTexture = null;
|
||||
|
||||
private GUISkin skin;
|
||||
|
||||
private const int windowWidth = 600;
|
||||
private const int windowHeight = 750;
|
||||
|
||||
[MenuItem("Tools/BoneCracker Games/Realistic Car Controller/Welcome Window", false, 10000)]
|
||||
public static void OpenWindow() {
|
||||
|
||||
GetWindow<RCC_WelcomeWindow>(true);
|
||||
|
||||
}
|
||||
|
||||
private void OnEnable() {
|
||||
|
||||
titleContent = new GUIContent("Realistic Car Controller");
|
||||
maxSize = new Vector2(windowWidth, windowHeight);
|
||||
minSize = maxSize;
|
||||
|
||||
InitStyle();
|
||||
|
||||
}
|
||||
|
||||
private void InitStyle() {
|
||||
|
||||
if (!skin)
|
||||
skin = Resources.Load("RCC_WindowSkin") as GUISkin;
|
||||
|
||||
bannerTexture = (Texture2D)Resources.Load("Editor/RCCBanner", typeof(Texture2D));
|
||||
|
||||
}
|
||||
|
||||
private void OnGUI() {
|
||||
|
||||
GUI.skin = skin;
|
||||
|
||||
DrawHeader();
|
||||
DrawMenuButtons();
|
||||
DrawToolBar();
|
||||
DrawFooter();
|
||||
|
||||
if (!EditorApplication.isPlaying)
|
||||
Repaint();
|
||||
|
||||
}
|
||||
|
||||
private void DrawHeader() {
|
||||
|
||||
GUILayout.Label(bannerTexture, GUILayout.Height(120));
|
||||
|
||||
}
|
||||
|
||||
private void DrawMenuButtons() {
|
||||
|
||||
GUILayout.Space(-10);
|
||||
toolBarIndex = GUILayout.Toolbar(toolBarIndex, ToolbarNames());
|
||||
|
||||
}
|
||||
|
||||
#region ToolBars
|
||||
|
||||
public static void WelcomePageContent() {
|
||||
|
||||
EditorGUILayout.BeginVertical("window");
|
||||
GUILayout.Label("Welcome!");
|
||||
EditorGUILayout.BeginHorizontal("box");
|
||||
GUILayout.Label("<b>Thank you for purchasing and using Realistic Car Controller. Please read the documentation before use. Also check out the online documentation for updated info. Have fun :)</b>");
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
EditorGUILayout.HelpBox("Realistic Car Controller needs configured Tags & Layers in your Project Settings. Importing them will overwrite your Project Settings!", MessageType.Warning, true);
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
if (GUILayout.Button("Import Project Settings (Tags & Layers)"))
|
||||
AssetDatabase.ImportPackage(RCC_AssetPaths.projectSettingsPath, true);
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginHorizontal("box");
|
||||
GUILayout.Label("<b>If you don't want to overwrite your project settings, you can create these layers and select them in RCC Settings (Tools --> BCG --> RCC --> Edit Settings --> Tags & Layers section.) \n \n RCC \n RCC_WheelCollider \n RCC_DetachablePart \n \n More info can be found in documentation (First To Do).</b>");
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (GUILayout.Button("Add Demo Scenes To Build Settings"))
|
||||
AddDemoScenesToBuildSettings();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.HelpBox("If you want to add Photon PUN2 scenes, import and install Photon PUN2 & integration first. Then click again to add those scenes to your Build Settings.", MessageType.Info, true);
|
||||
EditorGUILayout.HelpBox("If you want to add Enter / Exit scenes, import BCG Shared Assets to your project first. Then click again to add those scenes to your Build Settings.", MessageType.Info, true);
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
GUI.color = Color.red;
|
||||
|
||||
if (GUILayout.Button("Delete all demo contents from the project")) {
|
||||
|
||||
if (EditorUtility.DisplayDialog("Warning", "You are about to delete all demo contents such as vehicle models, vehicle prefabs, vehicle textures, all scenes, scene models, scene prefabs, scene textures!", "Delete", "Cancel"))
|
||||
DeleteDemoContent();
|
||||
|
||||
}
|
||||
|
||||
GUI.color = Color.white;
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
public static void UpdatePageContent() {
|
||||
|
||||
EditorGUILayout.BeginVertical("window");
|
||||
GUILayout.Label("Updates");
|
||||
|
||||
EditorGUILayout.BeginHorizontal("box");
|
||||
GUILayout.Label("<b>Installed Version: </b>" + RCC_Version.version.ToString());
|
||||
EditorGUILayout.EndHorizontal();
|
||||
GUILayout.Space(6);
|
||||
|
||||
EditorGUILayout.BeginHorizontal("box");
|
||||
GUILayout.Label("<b>1</b>- Always backup your project before updating RCC or any asset in your project!");
|
||||
EditorGUILayout.EndHorizontal();
|
||||
GUILayout.Space(6);
|
||||
|
||||
EditorGUILayout.BeginHorizontal("box");
|
||||
GUILayout.Label("<b>2</b>- If you have own assets such as prefabs, audioclips, models, scripts in RealisticCarControllerV3 folder, keep your own asset outside from RealisticCarControllerV3 folder.");
|
||||
EditorGUILayout.EndHorizontal();
|
||||
GUILayout.Space(6);
|
||||
|
||||
EditorGUILayout.BeginHorizontal("box");
|
||||
GUILayout.Label("<b>3</b>- Delete RealisticCarControllerV3 folder, and import latest version to your project.");
|
||||
EditorGUILayout.EndHorizontal();
|
||||
GUILayout.Space(6);
|
||||
|
||||
if (GUILayout.Button("Check Updates"))
|
||||
Application.OpenURL(RCC_AssetPaths.assetStorePath);
|
||||
|
||||
GUILayout.Space(6);
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
public static void DemosPageContent() {
|
||||
|
||||
EditorGUILayout.BeginVertical("window");
|
||||
|
||||
GUILayout.Label("Demo Scenes");
|
||||
|
||||
bool BCGInstalled = false;
|
||||
|
||||
#if BCG_ENTEREXIT
|
||||
BCGInstalled = true;
|
||||
#endif
|
||||
|
||||
bool photonInstalled = false;
|
||||
|
||||
#if RCC_PHOTON && PHOTON_UNITY_NETWORKING
|
||||
photonInstalled = true;
|
||||
#endif
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.HelpBox("All scenes must be in your Build Settings to run AIO demo.", MessageType.Warning, true);
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
if (GUILayout.Button("RCC City AIO"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_AIO, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC City"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_City, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC City Car Selection"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_CarSelection, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC City Car Selection with Load Next Scene"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_CarSelectionLoadNextScene, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC City Car Selection with Loaded Scene"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_CarSelectionLoadedScene, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC Blank Override Inputs"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_OverrideInputs, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC Blank Customization"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_Customization, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC Blank API"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_APIBlank, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC Blank Test Scene"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_BlankMobile, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC Damage Test Scene"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_Damage, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC Multiple Terrain Test Scene"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_MultipleTerrain, OpenSceneMode.Single);
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
if (BCGInstalled) {
|
||||
|
||||
if (GUILayout.Button("RCC City Enter-Exit FPS"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_CityFPS, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC City Enter-Exit TPS"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_CityTPS, OpenSceneMode.Single);
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.HelpBox("You have to import latest BCG Shared Assets to your project first.", MessageType.Warning);
|
||||
|
||||
if (GUILayout.Button("Download and import BCG Shared Assets"))
|
||||
AssetDatabase.ImportPackage(RCC_AssetPaths.BCGSharedAssetsPath, true);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
if (photonInstalled) {
|
||||
|
||||
if (GUILayout.Button("RCC Lobby Photon PUN 2"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_PUN2Lobby, OpenSceneMode.Single);
|
||||
|
||||
if (GUILayout.Button("RCC City Photon PUN 2"))
|
||||
EditorSceneManager.OpenScene(RCC_AssetPaths.demo_PUN2City, OpenSceneMode.Single);
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.HelpBox("You have to import latest Photon PUN2 to your project first.", MessageType.Warning);
|
||||
|
||||
if (GUILayout.Button("Download and import Photon PUN2"))
|
||||
Application.OpenURL(RCC_AssetPaths.photonPUN2);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
public static void Addons() {
|
||||
|
||||
EditorGUILayout.BeginVertical("window");
|
||||
GUILayout.Label("Addons");
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
GUILayout.Label("<b>Photon PUN2</b>");
|
||||
|
||||
bool photonInstalled = false;
|
||||
|
||||
#if PHOTON_UNITY_NETWORKING
|
||||
photonInstalled = true;
|
||||
#endif
|
||||
|
||||
bool photonAndRCCInstalled = false;
|
||||
|
||||
#if RCC_PHOTON && PHOTON_UNITY_NETWORKING
|
||||
photonAndRCCInstalled = true;
|
||||
#endif
|
||||
|
||||
if (!photonAndRCCInstalled) {
|
||||
|
||||
if (!photonInstalled) {
|
||||
|
||||
EditorGUILayout.HelpBox("You have to import latest Photon PUN2 to your project first.", MessageType.Warning);
|
||||
|
||||
if (GUILayout.Button("Download and import Photon PUN2"))
|
||||
Application.OpenURL(RCC_AssetPaths.photonPUN2);
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.HelpBox("Found Photon PUN2, You can import integration package and open Photon demo scenes now.", MessageType.Info);
|
||||
|
||||
if (GUILayout.Button("Import Photon PUN2 Integration"))
|
||||
AssetDatabase.ImportPackage(RCC_AssetPaths.PUN2AssetsPath, true);
|
||||
|
||||
}
|
||||
|
||||
} else if (photonInstalled) {
|
||||
|
||||
EditorGUILayout.HelpBox("Installed Photon PUN2 with RCC, You can open Photon demo scenes now.", MessageType.Info);
|
||||
|
||||
}
|
||||
|
||||
#if RCC_PHOTON && PHOTON_UNITY_NETWORKING
|
||||
if (photonInstalled) {
|
||||
|
||||
EditorGUILayout.LabelField("Photon PUN2 Version: " + System.Reflection.Assembly.GetAssembly(typeof(ExitGames.Client.Photon.PhotonPeer)).GetName().Version.ToString(), EditorStyles.centeredGreyMiniLabel);
|
||||
GUILayout.Space(6);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
bool BCGInstalled = false;
|
||||
|
||||
#if BCG_ENTEREXIT
|
||||
BCGInstalled = true;
|
||||
#endif
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
GUILayout.Label("<b>BCG Shared Assets (Enter / Exit)</b>");
|
||||
|
||||
if (!BCGInstalled) {
|
||||
|
||||
EditorGUILayout.HelpBox("You have to import latest BCG Shared Assets to your project first.", MessageType.Warning);
|
||||
|
||||
if (GUILayout.Button("Download and import BCG Shared Assets"))
|
||||
AssetDatabase.ImportPackage(RCC_AssetPaths.BCGSharedAssetsPath, true);
|
||||
|
||||
} else {
|
||||
|
||||
EditorGUILayout.HelpBox("Found BCG Shared Assets, You can open Enter / Exit demo scenes now.", MessageType.Info);
|
||||
|
||||
#if BCG_ENTEREXIT
|
||||
EditorGUILayout.LabelField("BCG Shared Assets Version: " + BCG_Version.version, EditorStyles.centeredGreyMiniLabel);
|
||||
#endif
|
||||
GUILayout.Space(6);
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
GUILayout.Label("<b>Logitech</b>");
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
if (GUILayout.Button("Download and import Logitech SDK"))
|
||||
Application.OpenURL(RCC_AssetPaths.logitech);
|
||||
|
||||
if (GUILayout.Button("Import Logitech Integration"))
|
||||
AssetDatabase.ImportPackage(RCC_AssetPaths.LogiAssetsPath, true);
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
GUILayout.Label("<b>ProFlares</b>");
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
if (GUILayout.Button("Download and import ProFlares"))
|
||||
Application.OpenURL(RCC_AssetPaths.proFlares);
|
||||
|
||||
if (GUILayout.Button("Import ProFlares Integration"))
|
||||
AssetDatabase.ImportPackage(RCC_AssetPaths.ProFlareAssetsPath, true);
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
|
||||
GUILayout.Label("<b>URP</b>");
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
|
||||
if (GUILayout.Button("Convert All Materials To URP")) {
|
||||
|
||||
EditorUtility.DisplayDialog("Converting All Demo Materials To URP", "All demo materials will be selected in your project now. After that, you'll need to convert them to URP shaders while they have been selected. You can convert them from the Edit --> Render Pipeline --> Universal Render Pipeline --> Convert Selected Materials.", "Close");
|
||||
|
||||
UnityEngine.Object[] objects = new UnityEngine.Object[RCC_DemoMaterials.Instance.demoMaterials.Length];
|
||||
|
||||
for (int i = 0; i < objects.Length; i++)
|
||||
objects[i] = RCC_DemoMaterials.Instance.demoMaterials[i];
|
||||
|
||||
Selection.objects = objects;
|
||||
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
public static void Documentations() {
|
||||
|
||||
EditorGUILayout.BeginVertical("window");
|
||||
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
EditorGUILayout.HelpBox("Latest online documentations for scripts, settings, setup, how to do, and API.", MessageType.Info);
|
||||
|
||||
if (GUILayout.Button("Documentation"))
|
||||
Application.OpenURL(RCC_AssetPaths.documentations);
|
||||
|
||||
if (GUILayout.Button("Youtube Tutorial Videos"))
|
||||
Application.OpenURL(RCC_AssetPaths.YTVideos);
|
||||
|
||||
if (GUILayout.Button("Other Assets"))
|
||||
Application.OpenURL(RCC_AssetPaths.otherAssets);
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private string[] ToolbarNames() {
|
||||
|
||||
string[] names = new string[toolBars.Length];
|
||||
|
||||
for (int i = 0; i < toolBars.Length; i++)
|
||||
names[i] = toolBars[i];
|
||||
|
||||
return names;
|
||||
|
||||
}
|
||||
|
||||
private void DrawToolBar() {
|
||||
|
||||
GUILayout.BeginArea(new Rect(4, 140, 592, 540));
|
||||
|
||||
toolBars[toolBarIndex].Draw();
|
||||
|
||||
GUILayout.EndArea();
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
}
|
||||
|
||||
private void DrawFooter() {
|
||||
|
||||
EditorGUILayout.BeginHorizontal("box");
|
||||
|
||||
EditorGUILayout.LabelField("BoneCracker Games", EditorStyles.centeredGreyMiniLabel);
|
||||
EditorGUILayout.LabelField("Realistic Car Controller " + RCC_Version.version, EditorStyles.centeredGreyMiniLabel);
|
||||
EditorGUILayout.LabelField("Buğra Özdoğanlar", EditorStyles.centeredGreyMiniLabel);
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
}
|
||||
|
||||
private static void ImportPackage(string package) {
|
||||
|
||||
try {
|
||||
AssetDatabase.ImportPackage(package, true);
|
||||
} catch (Exception) {
|
||||
Debug.LogError("Failed to import package: " + package);
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void DeleteDemoContent() {
|
||||
|
||||
Debug.LogWarning("Deleting demo contents...");
|
||||
|
||||
foreach (var item in RCC_AssetPaths.demoAssetPaths)
|
||||
FileUtil.DeleteFileOrDirectory(item);
|
||||
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
Debug.LogWarning("Deleted demo contents!");
|
||||
EditorUtility.DisplayDialog("Deleted Demo Contents", "All demo contents have been removed from the project!", "Ok");
|
||||
|
||||
}
|
||||
|
||||
private static void AddDemoScenesToBuildSettings() {
|
||||
|
||||
List<string> demoScenePaths = new List<string>();
|
||||
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_AIO);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_City);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_CarSelection);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_CarSelectionLoadNextScene);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_CarSelectionLoadedScene);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_OverrideInputs);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_Customization);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_APIBlank);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_BlankMobile);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_Damage);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_MultipleTerrain);
|
||||
|
||||
bool BCGInstalled = false;
|
||||
|
||||
#if BCG_ENTEREXIT
|
||||
BCGInstalled = true;
|
||||
#endif
|
||||
|
||||
if (BCGInstalled) {
|
||||
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_CityFPS);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_CityTPS);
|
||||
|
||||
}
|
||||
|
||||
bool photonAndRCCInstalled = false;
|
||||
|
||||
#if RCC_PHOTON && PHOTON_UNITY_NETWORKING
|
||||
photonAndRCCInstalled = true;
|
||||
#endif
|
||||
|
||||
if (photonAndRCCInstalled) {
|
||||
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_PUN2Lobby);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_PUN2City);
|
||||
demoScenePaths.Add(RCC_AssetPaths.demo_PUN2CityEnterExit);
|
||||
|
||||
}
|
||||
|
||||
// Find valid Scene paths and make a list of EditorBuildSettingsScene
|
||||
List<EditorBuildSettingsScene> editorBuildSettingsScenes = new List<EditorBuildSettingsScene>();
|
||||
|
||||
foreach (string path in demoScenePaths) {
|
||||
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
editorBuildSettingsScenes.Add(new EditorBuildSettingsScene(path, true));
|
||||
|
||||
}
|
||||
|
||||
// Set the Build Settings window Scene list
|
||||
EditorBuildSettings.scenes = editorBuildSettingsScenes.ToArray();
|
||||
|
||||
EditorUtility.DisplayDialog("Demo Scenes", "All demo scenes have been added to the Build Settings. For Photon and Enter / Exit scenes, you have to import and intregrate them first (Addons). After importing them, click again to add new demo scenes.", "Ok");
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ff539a6c470a2144875d8b7f0340c41
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user