Skip to content

Delt06/di-cheats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DI Cheats

Version License: MIT

A cheat system for DI Framework.

Developed and tested with Unity 2020.3.16f1

Table of contents

Installation

Before proceeding, please make sure you have the following dependencies installed:

Option 1

Option 2

Add the following line to Packages/manifest.json:

"com.deltation.di-cheats": "https://github.com/Delt06/di-cheats.git?path=Packages/com.deltation.di-cheats",

Usage

  • Create a cheat menu:
using DELTation.DIFramework.Cheats;
using UnityEngine;

public class GameCheatMenu : CheatMenuBase
{
    protected override void Build()
    {
        CreateButton("Log", () => Debug.Log("Hello from cheats."));
    }
}
  • Create or modify existing dependency container:
using DELTation.DIFramework;
using DELTation.DIFramework.Cheats;
using DELTation.DIFramework.Containers;

public class CompositionRoot : DependencyContainerBase
{
    protected override void ComposeDependencies(ICanRegisterContainerBuilder builder)
    {
        builder.RegisterCheatMenu<GameCheatMenu>();
    }
}
  • Ensure there is a ContainerLifecycle attached to your container.
  • Ensure there is an EventSystem in your scene.
  • Tap the right top corner of the screen to open cheats.

Optional

Define DI_CHEATS_FORCE_IN_RELEASE if you want to have cheats in a release build.