Weapos Rejiggered

Modified weapon scripts to eliminate specialized projectile behavior - allows charged weapons to have projectiles and modify weapon stats when charged
Added machine gun weapon & VFX
Moved third party code to Plugins folder to improve compile times
This commit is contained in:
Reinier Vens 2021-01-31 03:52:32 +00:00
commit dbc522a224
2105 changed files with 7033 additions and 1141 deletions

View file

@ -0,0 +1,81 @@
using UnityEngine;
using UnityEditor;
using System;
namespace NaughtyAttributes.Editor
{
public static class EditorDrawUtility
{
public static bool DrawLayoutField(object value, string label)
{
GUI.enabled = false;
bool isDrawn = false;
Type valueType = value.GetType();
if (valueType == typeof(int))
{
isDrawn = true;
EditorGUILayout.IntField(label, (int)value);
}
else if (valueType == typeof(long))
{
isDrawn = true;
EditorGUILayout.LongField(label, (long)value);
}
else if (valueType == typeof(float))
{
isDrawn = true;
EditorGUILayout.FloatField(label, (float)value);
}
else if (valueType == typeof(double))
{
isDrawn = true;
EditorGUILayout.DoubleField(label, (double)value);
}
else if (valueType == typeof(string))
{
isDrawn = true;
EditorGUILayout.TextField(label, (string)value);
}
else if (valueType == typeof(Vector2))
{
isDrawn = true;
EditorGUILayout.Vector2Field(label, (Vector2)value);
}
else if (valueType == typeof(Vector3))
{
isDrawn = true;
EditorGUILayout.Vector3Field(label, (Vector3)value);
}
else if (valueType == typeof(Vector4))
{
isDrawn = true;
EditorGUILayout.Vector4Field(label, (Vector4)value);
}
else if (valueType == typeof(Color))
{
isDrawn = true;
EditorGUILayout.ColorField(label, (Color)value);
}
else if (valueType == typeof(Bounds))
{
isDrawn = true;
EditorGUILayout.BoundsField(label, (Bounds)value);
}
else if (valueType == typeof(Rect))
{
isDrawn = true;
EditorGUILayout.RectField(label, (Rect)value);
}
else
{
isDrawn = false;
}
GUI.enabled = true;
return isDrawn;
}
}
}

View file

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 6ff27ff7705d6064e935bb2159a1b453
timeCreated: 1510926159
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,49 @@
using UnityEngine;
using System.IO;
namespace NaughtyAttributes.Editor
{
public static class IOUtility
{
public static string GetPersistentDataPath()
{
return Application.persistentDataPath + "/";
}
public static void WriteToFile(string filePath, string content)
{
using (FileStream fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write))
{
using (StreamWriter streamWriter = new StreamWriter(fileStream, System.Text.Encoding.ASCII))
{
streamWriter.WriteLine(content);
}
}
}
public static string ReadFromFile(string filePath)
{
using (FileStream fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
{
using (StreamReader streamReader = new StreamReader(fileStream, System.Text.Encoding.ASCII))
{
string content = streamReader.ReadToEnd();
return content;
}
}
}
public static bool FileExists(string filePath)
{
return File.Exists(filePath);
}
public static string GetPathRelativeToProjectFolder(string fullPath)
{
int indexOfAssetsWord = fullPath.IndexOf("\\Assets");
string relativePath = fullPath.Substring(indexOfAssetsWord + 1);
return relativePath;
}
}
}

View file

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: bf376371b2951274e823154c03f066e2
timeCreated: 1508232215
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,22 @@
using UnityEditor;
using System;
using System.Reflection;
namespace NaughtyAttributes.Editor
{
public static class PropertyUtility
{
public static T[] GetAttributes<T>(SerializedProperty property) where T : NaughtyAttribute
{
Type targetType = GetTargetObject(property).GetType();
FieldInfo fieldInfo = targetType.GetField(property.name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
return (T[])fieldInfo.GetCustomAttributes(typeof(T), true);
}
public static UnityEngine.Object GetTargetObject(SerializedProperty property)
{
return property.serializedObject.targetObject;
}
}
}

View file

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: e2d50a3c7c8a9754cb3936216494be66
timeCreated: 1508153828
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: