BITFALL/Assets
CortexCore 7e2cbf4757 Restored 2025-03-14 22:12:26 +08:00
..
Artists Restored 2025-03-14 22:12:26 +08:00
Arts 1 2025-03-14 20:57:09 +08:00
CatwalkKit 1 2025-03-14 20:32:54 +08:00
Chernobyl Restored 2025-03-14 22:12:26 +08:00
NuGet 1 2025-03-14 19:09:31 +08:00
Packages 1 2025-03-14 19:09:31 +08:00
Plugins 1 2025-03-14 19:09:31 +08:00
Polaris - Low Poly Ecosystem Restored 2025-03-14 22:12:26 +08:00
Polaris Exported Restored 2025-03-14 22:12:26 +08:00
Resources 1 2025-03-14 19:09:31 +08:00
Samples Restored 2025-03-14 22:12:26 +08:00
SciFi Warehouse Kit 1 2025-03-14 19:09:31 +08:00
Settings 1 2025-03-14 19:09:31 +08:00
Standard Assets Restored 2025-03-14 22:12:26 +08:00
TheTalesFactory 1 2025-03-14 20:32:54 +08:00
Tokyo_Street 1 2025-03-14 21:04:19 +08:00
_Demo Restored 2025-03-14 22:12:26 +08:00
_Scripts 11 2025-03-14 19:46:24 +08:00
_TerrainData Restored 2025-03-14 22:12:26 +08:00
vrbn_studios 1 2025-03-14 19:09:31 +08:00
Artists.meta 1 2025-03-14 19:09:31 +08:00
Arts.meta 1 2025-03-14 20:57:09 +08:00
AssetBundleCollectorSetting.asset Revert "1" 2025-01-20 23:41:37 +08:00
AssetBundleCollectorSetting.asset.meta 1 2025-03-14 19:09:31 +08:00
Assets.index
Assets.index.meta 1 2025-03-14 19:09:31 +08:00
CatwalkKit.meta 1 2025-03-14 19:09:31 +08:00
Chernobyl.meta 1 2025-03-14 19:09:31 +08:00
FolderIcons.asset 1 2023-12-15 00:08:02 +08:00
FolderIcons.asset.meta 1 2025-03-14 19:09:31 +08:00
Generate.meta 1 2025-03-14 19:09:31 +08:00
InitTestScene638457010046051900.unity 1 2024-03-12 21:54:29 +08:00
InitTestScene638457010046051900.unity.meta 1 2025-03-14 19:09:31 +08:00
Material Palette.asset 1 2024-03-12 21:54:29 +08:00
Material Palette.asset.meta 1 2025-03-14 19:09:31 +08:00
NuGet.meta 1 2025-03-14 19:09:31 +08:00
Packages.meta 1 2025-03-14 19:09:31 +08:00
Plugins.meta 1 2025-03-14 19:09:31 +08:00
Polaris - Low Poly Ecosystem.meta 1 2025-03-14 21:04:19 +08:00
Polaris Exported.meta 1 2025-03-14 19:09:31 +08:00
ReadMe.md
ReadMe.md.meta 1 2025-03-14 19:09:31 +08:00
Resources.meta 1 2025-03-14 19:09:31 +08:00
Samples.meta 1 2025-03-14 19:09:31 +08:00
SciFi Warehouse Kit.meta 1 2025-03-14 19:09:31 +08:00
Settings.meta 1 2025-03-14 19:09:31 +08:00
Standard Assets.meta 1 2025-03-14 19:09:31 +08:00
TheTalesFactory.meta 1 2025-03-14 19:09:31 +08:00
Tokyo_Street.meta 1 2025-03-14 19:09:31 +08:00
UnityDefaultRuntimeTheme.tss 1 2025-03-14 19:09:31 +08:00
UnityDefaultRuntimeTheme.tss.meta 1 2025-03-14 19:09:31 +08:00
_Demo.meta 1 2025-03-14 19:09:31 +08:00
_Scripts.meta 1 2025-03-14 19:09:31 +08:00
_TerrainData.meta 1 2025-03-14 19:09:31 +08:00
vrbn_studios.meta 1 2025-03-14 19:09:31 +08:00

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");
        }
    }
}