cost 348 ms
使用 Zenject 工厂方法在游戏中生成随机对象 - Spawn random objects in game using Zenject Factory Method

我正在构建一个无限运行的汽车游戏,为此,我必须随机生成其他汽车。 这是我的默认安装程序代码: 这里 cars[] 共有 8 辆汽车,我想使用工厂方法从那里生成随机汽车。 任何人都可以帮忙吗? 我目前正在使用MonoBehavior Instantiate ,但我想使用 zenject 工厂代码来正确 ...

为什么使用 Zenject (Unity) 在抽象 class State 中实现 IInitializable 不起作用? - Why implementing IInitializable in abstract class State using Zenject (Unity) is not working?

我是 Zenject 世界的新手。 我正在通过实现Iinitializable来修改 ShipState 中ShipState上的示例代码SampleGame1 (Beginner) (您可以在此处查看完整示例),现有的是IDisposable ,因此现在有两个已实现的接口。 目的是我想在其中一种 ...

行为分析器 + Zenject - Behavior disiner + Zenject

Zenject 不适用于 Behavior Disiner。 注入 Action 时,不会发生注入。 Debug没有收到进入构造方法的日志,如果我使用字段,那么也是null。 我期待注入行动。 Zenject 不适用于 Behavior disiner? ...

我如何在 inheritance 链中多次实现该接口的同时显式实现该接口? - How can i explicitly implement an interface while having implemented that interface multiple times in inheritance chain?

在我的 Unity C# 项目中,我有这些接口: 还有一个 class: 我有一个 IGameService 类列表,我需要对其进行初始化(我也在使用 Zenject)。 例如: 问题来了:我对 IADManager 和 IIAPManager 有相同的 class (MonatizationMa ...

Unity & Zenject - 如何从 TSignal.Fire() 中按顺序执行方法 - Unity & Zenject - How to execute methods in sequence order from a TSignal.Fire()

我正在尝试学习如何使用 Zenject 和 unity,我遇到了一个特殊的问题,我不知道它是否有一个可能的解决方案,仅使用 Zenject 的 api。 假设我有 MethodA、MethodB 和 MethodC,以及一个 SignalA。 是否可以制作这个序列: 现在我有这段代码: Metho ...

如何处理实例化的依赖关系? - How to deal with instantiated dependencies?

处理实例化的依赖关系。 所以一个普遍的问题:如何处理实例化的依赖关系? 假设我有两个功能: 随着: 解决这种依赖关系的正确方法是什么,它解耦了两个类,是可扩展的和可测试的? 我想使用 Zenject,但我不确定这是否对这个特定问题有好处? 另外我猜单身人士不在 window 之外? ...

Zenject 为什么需要使用 InstallerPrefabs 而不是我的 Installer? 什么是 InstallerPrefabs? - Zenject Why it needs to use InstallerPrefabs instead of my Installer? And what is InstallerPrefabs?

我创建了安装程序,使用脚本创建了一个预制件,然后将其附加到 SceneContext。 但是当我运行时出现此错误 “ZenjectException:断言命中。在上下文'SceneContext'的安装程序属性中找到名为'Installer'的预制件。你应该使用属性'InstallerPrefab ...

ZenjectUnitTestFixture 在 [Setup] 之后没有重新创建单例 - ZenjectUnitTestFixture is not recreating singletons after [Setup]

我正在为 Extenject (Zenject) 编写单元测试并使用 ZenjectUnitTestFixture,但看起来我的一些单例在测试 [Setup] 后没有被重新创建。 我设置了断点并检查了容器注册是否被重置。 但是,其中一个注入的单例中有一个字典,该字典在创建时被初始化,并且仅在第一次测 ...

是否有类似于 ORM 的东西供 Unity 使用带 Zenject 的存储库模式? - Is there something akin to an ORM for Unity to use Repository Pattern w/ Zenject?

长格式,下面是 TL;DR 我目前正在使用 Zenject 开发一款游戏,我设计的 UI 和游戏架构与 web 应用程序非常相似,其中有IConversationRepository接口提供对Conversation等数据的访问,方法包括GetConversationById(...) 。 到目前 ...

使用 Zenject 注入带有接口的实现 - Using Zenject to inject an implementation with interfaces

我正在尝试在 Unity 中使用 Zenject。 我有一个接口和它的几个实现。 我想用 ID 注入,但实现将具有刻度接口,因为它不是 MonoBehaviour。 所以我有一个IAttacker接口和一个MeleeAttackImpl实现。 我想添加 但它创建了 2 个不同的对象,而不是具有 Ti ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM