Initial Commit
This commit is contained in:
commit
ee5c2f922d
2255 changed files with 547750 additions and 0 deletions
20
Assets/Scripts/Data/Weapon/FragGrenadeDataComponent.cs
Normal file
20
Assets/Scripts/Data/Weapon/FragGrenadeDataComponent.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using Unity.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
[Serializable]
|
||||
public struct FragGrenadeData : IComponentData
|
||||
{
|
||||
public float Range;
|
||||
}
|
||||
|
||||
public class FragGrenadeDataComponent : ComponentDataProxy<FragGrenadeData>
|
||||
{
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
Gizmos.DrawWireSphere(transform.position, Value.Range);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Data/Weapon/FragGrenadeDataComponent.cs.meta
Normal file
11
Assets/Scripts/Data/Weapon/FragGrenadeDataComponent.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 96edcf42d2fe12443ac813b76e490fb4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
Assets/Scripts/Data/Weapon/GrenadeDataComponent.cs
Normal file
18
Assets/Scripts/Data/Weapon/GrenadeDataComponent.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using Tween;
|
||||
using Unity.Entities;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
[Serializable]
|
||||
public struct GrenadeData : IComponentData
|
||||
{
|
||||
public float Lifetime;
|
||||
public float Damage;
|
||||
public EaseType DamageEase;
|
||||
}
|
||||
|
||||
public class GrenadeDataComponent : ComponentDataProxy<GrenadeData>
|
||||
{
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Data/Weapon/GrenadeDataComponent.cs.meta
Normal file
11
Assets/Scripts/Data/Weapon/GrenadeDataComponent.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 046d69f945b4cbc418aa6d1817d85773
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/Scripts/Data/Weapon/WeaponAccuracyData.cs
Normal file
9
Assets/Scripts/Data/Weapon/WeaponAccuracyData.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
using Unity.Entities;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
public struct WeaponAccuracyData : IComponentData
|
||||
{
|
||||
public float Accuracy;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Data/Weapon/WeaponAccuracyData.cs.meta
Normal file
11
Assets/Scripts/Data/Weapon/WeaponAccuracyData.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 599d610669ad254458a90ddc72303cb6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/Scripts/Data/Weapon/WeaponAnimationData.cs
Normal file
9
Assets/Scripts/Data/Weapon/WeaponAnimationData.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
using Unity.Entities;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
public struct WeaponAnimationData : IComponentData
|
||||
{
|
||||
public int ReloadCount;
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Data/Weapon/WeaponAnimationData.cs.meta
Normal file
3
Assets/Scripts/Data/Weapon/WeaponAnimationData.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2b2e27ce56ea49af963bb6e5dc63c17a
|
||||
timeCreated: 1534008116
|
||||
35
Assets/Scripts/Data/Weapon/WeaponAnimationEventComponent.cs
Normal file
35
Assets/Scripts/Data/Weapon/WeaponAnimationEventComponent.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using Unity.Entities;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
public struct WeaponAnimationEventData : IComponentData
|
||||
{
|
||||
public bool1 Reload;
|
||||
}
|
||||
|
||||
public class WeaponAnimationEventComponent : ComponentDataProxy<WeaponAnimationEventData>
|
||||
{
|
||||
//animator callback
|
||||
public void Reload()
|
||||
{
|
||||
PostEvent((ref WeaponAnimationEventData d) => d.Reload = true);
|
||||
}
|
||||
|
||||
private void PostEvent(EntityCommandBufferExtensions.ModifyData<WeaponAnimationEventData> eAction)
|
||||
{
|
||||
var actorFacade = gameObject.GetComponent<ActorFacade>();
|
||||
if (actorFacade != null && actorFacade.World.EntityManager.Exists(actorFacade.Entity))
|
||||
{
|
||||
actorFacade.World.EntityManager.PostEntityEvent(actorFacade.Entity, eAction);
|
||||
}
|
||||
else
|
||||
{
|
||||
var gameObjectEntity = gameObject.GetComponent<GameObjectEntity>();
|
||||
if (gameObjectEntity != null && gameObjectEntity.EntityManager.Exists(gameObjectEntity.Entity))
|
||||
{
|
||||
gameObjectEntity.EntityManager.PostEntityEvent(gameObjectEntity.Entity, eAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ec4bb861b9c4539b316b37e007887b4
|
||||
timeCreated: 1534007917
|
||||
14
Assets/Scripts/Data/Weapon/WeaponData.cs
Normal file
14
Assets/Scripts/Data/Weapon/WeaponData.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using Unity.Entities;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
[GenerateAuthoringComponent]
|
||||
public struct WeaponData : IComponentData
|
||||
{
|
||||
public int Ammo;
|
||||
public int ClipAmmo;
|
||||
[NonSerialized] public float ReloadTimer;
|
||||
[NonSerialized] public float FireTimer;
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Data/Weapon/WeaponData.cs.meta
Normal file
3
Assets/Scripts/Data/Weapon/WeaponData.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f207574366e24c14aa33de08b15f58dc
|
||||
timeCreated: 1531581769
|
||||
34
Assets/Scripts/Data/Weapon/WeaponPartsData.cs
Normal file
34
Assets/Scripts/Data/Weapon/WeaponPartsData.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Unity.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
public struct WeaponPartsData : ISharedComponentData, IEquatable<WeaponPartsData>
|
||||
{
|
||||
public Transform Barrel;
|
||||
public Transform ShellsExit;
|
||||
public AudioSource Audio;
|
||||
|
||||
public bool Equals(WeaponPartsData other)
|
||||
{
|
||||
return Equals(Barrel, other.Barrel) && Equals(ShellsExit, other.ShellsExit) && Equals(Audio, other.Audio);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return obj is WeaponPartsData other && Equals(other);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
var hashCode = Barrel != null ? Barrel.GetHashCode() : 0;
|
||||
hashCode = (hashCode * 397) ^ (ShellsExit != null ? ShellsExit.GetHashCode() : 0);
|
||||
hashCode = (hashCode * 397) ^ (Audio != null ? Audio.GetHashCode() : 0);
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Data/Weapon/WeaponPartsData.cs.meta
Normal file
3
Assets/Scripts/Data/Weapon/WeaponPartsData.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fabf2705a3144a6795f30d6c120ee0fc
|
||||
timeCreated: 1533985546
|
||||
26
Assets/Scripts/Data/Weapon/WeaponPropertiesData.cs
Normal file
26
Assets/Scripts/Data/Weapon/WeaponPropertiesData.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using Items;
|
||||
using System;
|
||||
using Unity.Entities;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
public struct WeaponPropertiesData : ISharedComponentData, IEquatable<WeaponPropertiesData>
|
||||
{
|
||||
public RangedWeaponItem Weapon;
|
||||
|
||||
public bool Equals(WeaponPropertiesData other)
|
||||
{
|
||||
return Equals(Weapon, other.Weapon);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return obj is WeaponPropertiesData other && Equals(other);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Weapon != null ? Weapon.GetHashCode() : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Data/Weapon/WeaponPropertiesData.cs.meta
Normal file
3
Assets/Scripts/Data/Weapon/WeaponPropertiesData.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cba5ec52a64a4a05950feb2629ca1c19
|
||||
timeCreated: 1534009699
|
||||
Loading…
Add table
Add a link
Reference in a new issue