using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using JSon;
using System.Reflection;
using System.Runtime.CompilerServices;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class Game
{
public void VehicleMaxFuel(float value)
{
bool flag = this._vehicle != null;
if (flag)
{
this._vehicle.maxFuel = value;
}
}
private Game.VehicleData _vehicle = null;
}
using System;
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(EnumFlagsAttribute))]
public class EnumFlagsAttributeDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
bool flag = !property.hasMultipleDifferentValues;
if (flag)
{
property.intValue = EditorGUI.MaskField(position, label, property.intValue, property.enumNames);
}
else
{
EditorGUI.LabelField(position, label);
}
}
}
using System;
public enum AmmoType
{
AmmoNone,
Ammo10mm,
Ammo5_45mm,
Ammo9mm,
Ammo12g,
Ammo7_62mm,
Ammo307cal,
Ammo14_5mm,
Ammo7mm_54R,
AmmoBB,
AmmoBolt,
Ammo356cal,
AmmoPB,
AmmoFuel,
Ammo6_49mm,
AmmoRubber
}
using System;
#if UNITY_EDITOR
using UnityEditor;
#endif
//Эксперимент: Добавил 2 типа патронов, работают, но не видны в Inspector
public enum AmmoType
{
Ammo45g = 16,
Ammo5_7mm = 17
}