259 lines
6.6 KiB
C#
259 lines
6.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics;
|
|
using SRDebugger;
|
|
using SRDebugger.Services;
|
|
using SRF;
|
|
using SRF.Service;
|
|
using Debug = UnityEngine.Debug;
|
|
using Random = UnityEngine.Random;
|
|
using UnityEngine;
|
|
|
|
public partial class SROptions
|
|
{
|
|
public static bool sIsBPShowed = false;
|
|
private bool mIsEditorPlayer = true;
|
|
private bool mIsSpeedBtnShow = true;
|
|
private int mHumanLv = 1;
|
|
private int mMonsterLv = 1;
|
|
|
|
[Category("数值")]
|
|
public int 关卡
|
|
{
|
|
get => PlayerData.Instance.CurrentLevel;
|
|
set
|
|
{
|
|
PlayerData.Instance.CurrentLevel = Math.Max(value, 1);
|
|
GameManager.Instance.LoadGame();
|
|
}
|
|
}
|
|
|
|
[Category("数值")]
|
|
public int 钻石
|
|
{
|
|
get
|
|
{
|
|
return PlayerData.Instance.Diamond;
|
|
}
|
|
|
|
set
|
|
{
|
|
PlayerData.Instance.Diamond = value;
|
|
UIUtils.RefreshDiamond();
|
|
}
|
|
}
|
|
|
|
[Category("数值")]
|
|
public int 金币
|
|
{
|
|
get
|
|
{
|
|
return PlayerData.Instance.Coin;
|
|
}
|
|
|
|
set
|
|
{
|
|
PlayerData.Instance.Coin = value;
|
|
UIUtils.RefreshCoin();
|
|
}
|
|
}
|
|
|
|
[Category("功能")]
|
|
public bool 是否买量用户
|
|
{
|
|
get => PlayerData.Instance.IsMMOUser;
|
|
set => PlayerData.Instance.IsMMOUser = value;
|
|
}
|
|
|
|
[Category("功能")]
|
|
public bool 是否展示IP内容
|
|
{
|
|
get => PlayerData.Instance.IsIPShow;
|
|
set => PlayerData.Instance.IsIPShow = value;
|
|
}
|
|
|
|
[Category("功能")]
|
|
public bool 战力开关
|
|
{
|
|
get => sIsBPShowed;
|
|
set
|
|
{
|
|
sIsBPShowed = value;
|
|
UIManager.Instance.GetUI<PanelTopBar>().ShowBP(sIsBPShowed);
|
|
}
|
|
}
|
|
|
|
[Category("功能")]
|
|
public bool UI开关
|
|
{
|
|
get => UIManager.Instance.gameObject.activeSelf;
|
|
set => UIManager.Instance.gameObject.SetActive(value);
|
|
}
|
|
|
|
[Category("功能")]
|
|
public bool 去掉勾编辑敌人
|
|
{
|
|
get => mIsEditorPlayer;
|
|
set
|
|
{
|
|
mIsEditorPlayer = value;
|
|
GameManager.Instance.CurrentEnemyBlockMgr.EnableInteraction(!mIsEditorPlayer);
|
|
GameManager.Instance.CurrentEnemyBlockMgr.ShowFloor(!mIsEditorPlayer);
|
|
}
|
|
}
|
|
|
|
[Category("功能")]
|
|
public bool 玩家无敌
|
|
{
|
|
get => GameManager.Instance.IsPlayerUndefeatable;
|
|
set => GameManager.Instance.IsPlayerUndefeatable = value;
|
|
}
|
|
|
|
[Category("功能")]
|
|
public bool 敌人无敌
|
|
{
|
|
get => GameManager.Instance.IsEnemyUndefeatable;
|
|
set => GameManager.Instance.IsEnemyUndefeatable = value;
|
|
}
|
|
|
|
[Category("功能")]
|
|
public void 清空阵型()
|
|
{
|
|
if (mIsEditorPlayer)
|
|
{
|
|
GameManager.Instance.CurrentPlayerBlockMgr.ClearAll();
|
|
}
|
|
else
|
|
{
|
|
GameManager.Instance.CurrentEnemyBlockMgr.ClearAll();
|
|
}
|
|
}
|
|
|
|
[Category("功能")]
|
|
public bool 暂停游戏
|
|
{
|
|
get => Time.timeScale < 0.1f;
|
|
set => Time.timeScale = value ? 0 : 1;
|
|
}
|
|
|
|
[Category("功能")]
|
|
public void 删除账号()
|
|
{
|
|
MMOModule.Instance.DeleteAccount((pResult) =>
|
|
{
|
|
if (pResult)
|
|
{
|
|
UIUtils.ShowTips("删除成功,请重装游戏!");
|
|
}
|
|
});
|
|
}
|
|
|
|
[Category("功能")]
|
|
public bool 隐藏加速键
|
|
{
|
|
get => !mIsSpeedBtnShow;
|
|
set
|
|
{
|
|
mIsSpeedBtnShow = !value;
|
|
UIManager.Instance.GetUI<PanelGame>().ShowSpeedBtn(mIsSpeedBtnShow);
|
|
}
|
|
}
|
|
|
|
[Category("远程")]
|
|
public int 远程单位等级
|
|
{
|
|
get => mHumanLv;
|
|
set => mHumanLv = Mathf.Clamp(value, 1, GameConfig.Instance.BlockMaxLevel);
|
|
}
|
|
|
|
[Category("远程")]
|
|
public void 增加远程单位()
|
|
{
|
|
CreateHuman(Mathf.Clamp(mHumanLv, 1, GameConfig.Instance.BlockMaxLevel));
|
|
}
|
|
|
|
private void CreateHuman(int pLevel)
|
|
{
|
|
if (mIsEditorPlayer)
|
|
{
|
|
GameManager.Instance.CurrentPlayerBlockMgr.CreateBlockAtRandomPos(BlockType.Human, pLevel);
|
|
}
|
|
else
|
|
{
|
|
GameManager.Instance.CurrentEnemyBlockMgr.CreateBlockAtRandomPos(BlockType.Human, pLevel);
|
|
}
|
|
}
|
|
|
|
[Category("近战")]
|
|
public int 近战单位等级
|
|
{
|
|
get => mMonsterLv;
|
|
set => mMonsterLv = Mathf.Clamp(value, 1, GameConfig.Instance.BlockMaxLevel);
|
|
}
|
|
|
|
[Category("近战")]
|
|
public void 增加近战单位()
|
|
{
|
|
CreateMonster(Mathf.Clamp(mHumanLv, 1, GameConfig.Instance.BlockMaxLevel));
|
|
}
|
|
|
|
private void CreateMonster(int pLevel)
|
|
{
|
|
if (mIsEditorPlayer)
|
|
{
|
|
GameManager.Instance.CurrentPlayerBlockMgr.CreateBlockAtRandomPos(BlockType.Monster, pLevel);
|
|
}
|
|
else
|
|
{
|
|
GameManager.Instance.CurrentEnemyBlockMgr.CreateBlockAtRandomPos(BlockType.Monster, pLevel);
|
|
}
|
|
}
|
|
|
|
[Category("镜头")]
|
|
public void 默认镜头()
|
|
{
|
|
Transform tCamTrans = GameManager.Instance.CurrentGameCam.transform;
|
|
tCamTrans.position = new Vector3(0, 19, -16);
|
|
tCamTrans.rotation = Quaternion.Euler(55, 0, 0);
|
|
|
|
GameManager.Instance.CurrentGameCam.fieldOfView = 80;
|
|
}
|
|
|
|
[Category("镜头")]
|
|
public void 镜头1()
|
|
{
|
|
Transform tCamTrans = GameManager.Instance.CurrentGameCam.transform;
|
|
tCamTrans.position = new Vector3(0, 19, -16);
|
|
tCamTrans.rotation = Quaternion.Euler(55, 0, 0);
|
|
|
|
GameManager.Instance.CurrentGameCam.fieldOfView = 60;
|
|
}
|
|
|
|
[Category("镜头")]
|
|
public void 镜头2()
|
|
{
|
|
Transform tCamTrans = GameManager.Instance.CurrentGameCam.transform;
|
|
tCamTrans.position = new Vector3(0, 6, -20);
|
|
tCamTrans.rotation = Quaternion.Euler(20, 0, 0);
|
|
|
|
GameManager.Instance.CurrentGameCam.fieldOfView = 80;
|
|
}
|
|
|
|
[Category("镜头")]
|
|
public void 镜头3()
|
|
{
|
|
Transform tCamTrans = GameManager.Instance.CurrentGameCam.transform;
|
|
tCamTrans.position = new Vector3(0, 23, -2);
|
|
tCamTrans.rotation = Quaternion.Euler(90, 0, 0);
|
|
|
|
GameManager.Instance.CurrentGameCam.fieldOfView = 80;
|
|
}
|
|
|
|
[Category("广告")]
|
|
public bool 屏蔽所有广告
|
|
{
|
|
get => TKGSDKManager.Instance.IsNoAllAD;
|
|
set => TKGSDKManager.Instance.IsNoAllAD = value;
|
|
}
|
|
} |