BITFALL/Assets
CortexCore e04ca0593e 1 2024-04-26 03:55:43 +08:00
..
8K Skybox Pack Free 1 2024-03-22 20:16:32 +08:00
AE_Battle Royale_Props 1 2024-03-31 23:34:22 +08:00
AdvancedCullingSystem
AmplifyAnimationPack 1 2024-04-19 00:40:34 +08:00
Artists 1 2024-04-26 03:55:43 +08:00
Azerilo/Car Model No.1201 Asset 1 2024-03-22 20:16:32 +08:00
BITFALL 1 2024-04-26 03:55:43 +08:00
BITKit 1 2024-04-26 03:55:43 +08:00
Bakery 1 2024-04-22 01:21:28 +08:00
BakeryLightmaps 1 2024-04-06 16:33:57 +08:00
Blink/Tools/SkinnedMeshTransfer
Blood_VFX 1 2024-04-15 14:57:50 +08:00
Car_Low/Tocus 1 2024-03-22 20:16:32 +08:00
CatwalkKit
Chernobyl 1 2024-04-26 03:55:43 +08:00
Cyberpunk Material Pack
Final Form Studio/Cars 1 2024-03-22 20:16:32 +08:00
Free HDR Skyboxes Pack 1 2024-03-22 20:16:32 +08:00
GSpawn - Level Designer 1 2024-04-26 03:55:43 +08:00
Ida Faber 1 2024-04-22 01:21:28 +08:00
Infima Games/Low Poly Animated - Modern Guns 1 2024-04-26 03:55:43 +08:00
Kevin Iglesias/Dance Animations
Le Tai's Asset/TranslucentImage 1 2024-04-06 16:33:57 +08:00
MagicaCloth2 1 2024-03-29 00:58:24 +08:00
Metro-City Level Design
Plugins 1 2024-04-26 03:55:43 +08:00
Polaris - Low Poly Ecosystem/Jupiter - Procedural Sky 1 2024-04-19 21:43:30 +08:00
Polaris Exported 1 2024-04-10 18:12:40 +08:00
Prop/Lighting Generator
Resources 1 2024-04-26 03:55:43 +08:00
Samples/Timeline/1.6.4/Customization Samples
SciFi Warehouse Kit
Settings
Signals
SpawnCampGames/WalkieTalkie 1 2024-04-06 16:33:57 +08:00
Standard Assets 1 2024-04-26 03:55:43 +08:00
ThatAnimatorAnimationAssets/BattleRoyale Set 1 1 2024-04-19 00:40:34 +08:00
TheTalesFactory/Photoscanned MoutainsRocks PBR
Tokyo_Street 1 2024-04-26 03:55:43 +08:00
Versatile Studio Assets/Demo City By Versatile Studio
WSM Game Studio 1 2024-03-22 20:16:32 +08:00
Zombie Slaughter 1 2024-03-31 23:34:22 +08:00
Zombie_27 1 2024-04-15 14:57:50 +08:00
_Demo 1 2024-04-26 03:55:43 +08:00
_TerrainData
vrbn_studios/2023_A 1 2024-04-13 01:10:30 +08:00
AssetBundleCollectorSetting.asset 1 2024-04-13 01:10:30 +08:00
Assets.index
FolderIcons.asset
InitTestScene638457010046051900.unity
Material Palette.asset
ReadMe.md

ReadMe.md

####项目架构与说明

Artists 项目专用文件地址 BITKit 工具包,通常不需要动 Mods 主要存放DLC等内容 Plugins 插件存放地址 Standard Assets 资产包目录 StreamingAssets GDNet会用到的生成目录 Libs 项目专用类库 Fltoto Fltoto专用文件夹

Libs内容写法

#####首先,你需要在脚本的程序集中引用

SerializeReference Extensions #####接着定义接口

public interface IAction
{
    void Excute();
}

#####新建类,并实现接口

[System.Serializable]
public class BITAction:IAction
{
    public void Excute()
    {
        Debug.Log("BIT执行了该任务")
    }
}
[System.Serializable]
public class FltotoAction:IAction
{
    public void Excute()
    {
        Debug.Log("Fltoto执行了该任务")
    }
}

#####最后控制器会这么调用接口

[SerializeReference, SubclassSelector]
public IAction action;
void Start()
{
    //执行该任务
    action.Excute();
}

#####这就是我们如何利用接口进行解耦

//物品容器接口
public interface IContainer
{
    bool AddItem();
    bool RemoveItem();
    bool TryGetItem(Guid key,out var item);
}
//武器控制器
public class GunController
{
    [SerializeReference, SubclassSelector]
    public IContainer container;
    void TryFire()
    {
        if(container.TryGetItem(ammo,out ammo))
        {
            if(ammo.count>1)
            {
                Fire();
            }else
            {
                Jam();
            }
        }
        else
        {
            PlayVoice("没子弹了呀");
            SwitchEquip("Hand");
        }
    }
}