1
This commit is contained in:
@@ -23,6 +23,20 @@ namespace BITFALL.Guns
|
||||
/// </summary>
|
||||
Vector3 Recoil { get; }
|
||||
}
|
||||
public interface ISpread:IProperty
|
||||
{
|
||||
/// <summary>
|
||||
/// 散射的方向
|
||||
/// </summary>
|
||||
Vector2 Spread { get; }
|
||||
}
|
||||
[Serializable]
|
||||
[CustomType(typeof(ISpread))]
|
||||
public struct VectorSpread:ISpread
|
||||
{
|
||||
[SerializeField] private Vector2 spread;
|
||||
public Vector2 Spread => spread;
|
||||
}
|
||||
[Serializable]
|
||||
[CustomType(typeof(IRecoil))]
|
||||
public struct VectorRecoil:IRecoil
|
||||
@@ -74,11 +88,13 @@ namespace BITFALL.Guns
|
||||
[SerializeField] private int initialBulletSpeed = 128;
|
||||
[SerializeField] private int initialAimZoom = 1;
|
||||
[SerializeField] private bool isScopeAim;
|
||||
[SerializeField] private Optional<int> buckshot;
|
||||
public IFireMode FireMode => fireMode;
|
||||
public int InitialBulletForce => initialBulletForce;
|
||||
public int InitialDamage => initialDamage;
|
||||
public int InitialBulletSpeed => initialBulletSpeed;
|
||||
public int InitialAimZoom => initialAimZoom;
|
||||
public bool IsScopeAim => isScopeAim;
|
||||
public IOptional<int> BuckShot => buckshot;
|
||||
}
|
||||
}
|
@@ -9,8 +9,7 @@
|
||||
"GUID:66d2ae14764cc7d49aad4b16930747c0",
|
||||
"GUID:677cd05ca06c46b4395470200b1acdad",
|
||||
"GUID:d8b63aba1907145bea998dd612889d6b",
|
||||
"GUID:9e24947de15b9834991c9d8411ea37cf",
|
||||
"GUID:84651a3751eca9349aac36a66bba901b"
|
||||
"GUID:e34a5702dd353724aa315fb8011f08c3"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
@@ -2,7 +2,6 @@ using BITFALL;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace BITKit
|
||||
{
|
||||
@@ -10,7 +9,11 @@ namespace BITKit
|
||||
{
|
||||
public static AssetableItem GetAssetable(this IBasicItem self)
|
||||
{
|
||||
return Addressables.LoadAssetAsync<AssetableItem>(self.AddressablePath).WaitForCompletion();
|
||||
var task = YooAsset.YooAssets.LoadAssetAsync<AssetableItem>(self.AddressablePath);
|
||||
task.WaitForAsyncComplete();
|
||||
return task.AssetObject.As<AssetableItem>();
|
||||
//return Addressables.LoadAssetAsync<AssetableItem>(self.AddressablePath).WaitForCompletion();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -5,7 +5,6 @@ using UnityEngine;
|
||||
using BITKit;
|
||||
using System.IO;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace BITFALL
|
||||
{
|
||||
@@ -18,7 +17,7 @@ namespace BITFALL
|
||||
#endregion
|
||||
#region 接口实现
|
||||
public int Id => GetInstanceID();
|
||||
public string Name => asset.name;
|
||||
public string Name => asset.Name;
|
||||
public string Description => asset.Description;
|
||||
public ItemQuality Quality => asset.Quality;
|
||||
public string AddressablePath => asset.AddressablePath;
|
||||
@@ -50,7 +49,7 @@ namespace BITFALL
|
||||
{
|
||||
if(item is ManagedItem serializableItem)
|
||||
{
|
||||
asset = Addressables.LoadAssetAsync<AssetableItem>(item.AddressablePath).WaitForCompletion();
|
||||
asset = serializableItem.GetAssetable();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user