Skip to content
Snippets Groups Projects
Commit b5631db0 authored by Bill Clinton's avatar Bill Clinton
Browse files

Merge branch 'feat/cheats-and-orbs' into 'main'

Delete Unused Code

See merge request !37
parents 71976474 37accaa2
Branches
Tags
1 merge request!37Delete Unused Code
......@@ -17,21 +17,6 @@ using UnityEngine.Windows;
* SKIPLEVEL : Player skips 1 level
*/
/* CHEATS THAT CAN BE SAVED */
/*
* NODAMAGE
* ONEHITKILL
* XTWOSPEED
*/
public enum CheatsType
{
NODAMAGE,
ONEHITKILL,
XTWOSPEED
}
public class CheatManager : MonoBehaviour
{
HUDisplay hud;
......@@ -152,14 +137,12 @@ public class CheatManager : MonoBehaviour
{
playerHealth.SetCheatNoDamage(true);
hud.OpenPanel("No Damage Cheat Activated!");
cheats[(int)CheatsType.NODAMAGE] = true;
}
private void ActivateOneHitKill()
{
playerShooting.ActivateCheatOneHitKill();
hud.OpenPanel("One Hit Kill Cheat Activated!");
cheats[(int)CheatsType.ONEHITKILL] = true;
}
private void ActivateMotherlode()
......@@ -172,7 +155,6 @@ public class CheatManager : MonoBehaviour
{
playerMovement.ActivateCheatXTwoSpeed();
hud.OpenPanel("Two Times Speed Cheat Activated!");
cheats[(int)CheatsType.XTWOSPEED] = true;
}
private void ActivateFullHPPet()
......@@ -264,20 +246,4 @@ public class CheatManager : MonoBehaviour
hud.OpenPanel("Successfully Reset Cheat(s)!");
}
public void LoadCheat(bool[] gatheredCheats)
{
if (gatheredCheats[(int)CheatsType.NODAMAGE])
{
ActivateNoDamage();
}
if (gatheredCheats[(int)CheatsType.ONEHITKILL])
{
ActivateOneHitKill();
}
if (gatheredCheats[(int)CheatsType.XTWOSPEED])
{
ActivateXTwoSpeed();
}
}
}
using Nightmare;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GlobalStateManager : MonoBehaviour
{
// Create Singleton
public static GlobalStateManager Instance { get; private set; }
private CheatManager cheatManager;
private void Awake()
{
if (Instance != null)
{
if (Instance != this)
{
Destroy(this);
}
}
else
{
Instance = this;
Refresh();
}
}
private void Refresh()
{
cheatManager = FindObjectOfType<CheatManager>();
}
public void SetState(SaveState state)
{
Refresh();
cheatManager.LoadCheat(state.globalSaveState.cheats);
}
}
fileFormatVersion: 2
guid: 40f7e905f1aa63741b02b9146e251f76
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[Serializable]
public class GlobalSaveState
{
public bool[] cheats;
public GlobalSaveState(bool[] cheats)
{
this.cheats = cheats;
}
public override string ToString()
{
return JsonConvert.SerializeObject(this);
}
}
[Serializable]
public class SaveState
{
public GlobalSaveState globalSaveState;
public SaveState(GlobalSaveState globalSaveState)
{
this.globalSaveState = globalSaveState;
}
public override string ToString()
{
return JsonConvert.SerializeObject(this);
}
}
fileFormatVersion: 2
guid: e0c4e2ce428b7c044baefcfca6687111
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment