Gear Schematic HUD
Created in-flight equipment HUD & schematic display
This commit is contained in:
parent
6db7c65961
commit
1e273d691e
253 changed files with 19369 additions and 6296 deletions
41
Assets/Scripts/Editor/GameplaySettingsEditor.cs
Normal file
41
Assets/Scripts/Editor/GameplaySettingsEditor.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MessagePack;
|
||||
using MessagePack.Formatters;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[CustomEditor(typeof(GameSettings))]
|
||||
public class GameSettingsEditor : Editor
|
||||
{
|
||||
private bool _showIcons;
|
||||
private bool _showProperties;
|
||||
private bool _showDatabase;
|
||||
|
||||
// private ScriptableItem _prefab;
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
var data = (GameSettings) target;
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
DrawDefaultInspector();
|
||||
|
||||
var hardpointNames = Enum.GetNames(typeof(HardpointType));
|
||||
if(data.ItemIcons.Length!=hardpointNames.Length)
|
||||
Array.Resize(ref data.ItemIcons, hardpointNames.Length);
|
||||
|
||||
if (GUILayout.Button("Hardpoint Icons", EditorStyles.toolbarButton))
|
||||
_showIcons = !_showIcons;
|
||||
|
||||
if(_showIcons)
|
||||
for (var i = 0; i < data.ItemIcons.Length; i++)
|
||||
data.ItemIcons[i] = (Sprite) EditorGUILayout.ObjectField(hardpointNames[i], data.ItemIcons[i], typeof(Sprite), false);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Editor/GameplaySettingsEditor.cs.meta
Normal file
11
Assets/Scripts/Editor/GameplaySettingsEditor.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6161c03786aebc645a8d8b814afecee2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in a new issue