Add damage system and processing system to enemy
This commit is contained in:
41
Assets/Scripts/Data/Damage.cs
Normal file
41
Assets/Scripts/Data/Damage.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Sirenix.OdinInspector;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class Damage
|
||||
{
|
||||
public int value;
|
||||
|
||||
public static Type[] damageTypes = Type.all;
|
||||
|
||||
[ValueDropdown("damageTypes")]
|
||||
public Type type;
|
||||
|
||||
[Serializable]
|
||||
public class Type
|
||||
{
|
||||
private string name;
|
||||
|
||||
private Type(string name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static Type normal = new("normal");
|
||||
|
||||
public static Type poison = new("poison");
|
||||
|
||||
public static Type[] all = new Type[] {
|
||||
normal,
|
||||
poison
|
||||
};
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Data/Damage.cs.meta
Normal file
11
Assets/Scripts/Data/Damage.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10150f370f18d5c47882ce685f073e43
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user