281 lines
		
	
	
		
			6.0 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			281 lines
		
	
	
		
			6.0 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
 | |
| {
 | |
|     private bool mIsBPShowed = GameConfig.Instance.IsDebug;
 | |
|     private bool mIsEditorPlayer = true;
 | |
| 
 | |
|     [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.Coin;
 | |
|         }
 | |
| 
 | |
|         set
 | |
|         {
 | |
|             PlayerData.Instance.Coin = value;
 | |
|             UIUtils.RefreshCoin();
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     [Category("数值")]
 | |
|     public bool 战力开关
 | |
|     {
 | |
|         get
 | |
|         {
 | |
|             return mIsBPShowed;
 | |
|         }
 | |
| 
 | |
|         set
 | |
|         {
 | |
|             mIsBPShowed = value;
 | |
|             UIManager.Instance.GetUI<PanelTopBar>().ShowBP(mIsBPShowed);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     [Category("功能")]
 | |
|     public bool 去掉勾编辑敌人
 | |
|     {
 | |
|         get => mIsEditorPlayer;
 | |
|         set
 | |
|         {
 | |
|             mIsEditorPlayer = value;
 | |
|             GameManager.Instance.CurrentEnemyBlockMgr.EnableInteraction(!mIsEditorPlayer);
 | |
|             GameManager.Instance.CurrentEnemyBlockMgr.ShowFloor(!mIsEditorPlayer);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     [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 人Lv1()
 | |
|     {
 | |
|         CreateHuman(1);
 | |
|     }
 | |
| 
 | |
|     [Category("人类")]
 | |
|     public void 人Lv2()
 | |
|     {
 | |
|         CreateHuman(2);
 | |
|     }
 | |
| 
 | |
|     [Category("人类")]
 | |
|     public void 人Lv3()
 | |
|     {
 | |
|         CreateHuman(3);
 | |
|     }
 | |
| 
 | |
|     [Category("人类")]
 | |
|     public void 人Lv4()
 | |
|     {
 | |
|         CreateHuman(4);
 | |
|     }
 | |
| 
 | |
|     [Category("人类")]
 | |
|     public void 人Lv5()
 | |
|     {
 | |
|         CreateHuman(5);
 | |
|     }
 | |
| 
 | |
|     [Category("人类")]
 | |
|     public void 人Lv6()
 | |
|     {
 | |
|         CreateHuman(6);
 | |
|     }
 | |
| 
 | |
|     [Category("人类")]
 | |
|     public void 人Lv7()
 | |
|     {
 | |
|         CreateHuman(7);
 | |
|     }
 | |
| 
 | |
|     //[Category("人类")]
 | |
|     //public void 人Lv8()
 | |
|     //{
 | |
|     //    CreateHuman(8);
 | |
|     //}
 | |
| 
 | |
|     //[Category("人类")]
 | |
|     //public void 人Lv9()
 | |
|     //{
 | |
|     //    CreateHuman(9);
 | |
|     //}
 | |
| 
 | |
|     //[Category("人类")]
 | |
|     //public void 人Lv10()
 | |
|     //{
 | |
|     //    CreateHuman(10);
 | |
|     //}
 | |
| 
 | |
|     private void CreateHuman(int pLevel)
 | |
|     {
 | |
|         if (mIsEditorPlayer)
 | |
|         {
 | |
|             GameManager.Instance.CurrentPlayerBlockMgr.CreateBlockAtRandomPos(BlockType.Human, pLevel);
 | |
|         }
 | |
|         else
 | |
|         {
 | |
|             GameManager.Instance.CurrentEnemyBlockMgr.CreateBlockAtRandomPos(BlockType.Human, pLevel);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     [Category("怪兽")]
 | |
|     public void 怪Lv1()
 | |
|     {
 | |
|         CreateMonster(1);
 | |
|     }
 | |
| 
 | |
|     [Category("怪兽")]
 | |
|     public void 怪Lv2()
 | |
|     {
 | |
|         CreateMonster(2);
 | |
|     }
 | |
| 
 | |
|     [Category("怪兽")]
 | |
|     public void 怪Lv3()
 | |
|     {
 | |
|         CreateMonster(3);
 | |
|     }
 | |
| 
 | |
|     [Category("怪兽")]
 | |
|     public void 怪Lv4()
 | |
|     {
 | |
|         CreateMonster(4);
 | |
|     }
 | |
| 
 | |
|     [Category("怪兽")]
 | |
|     public void 怪Lv5()
 | |
|     {
 | |
|         CreateMonster(5);
 | |
|     }
 | |
| 
 | |
|     [Category("怪兽")]
 | |
|     public void 怪Lv6()
 | |
|     {
 | |
|         CreateMonster(6);
 | |
|     }
 | |
| 
 | |
|     [Category("怪兽")]
 | |
|     public void 怪Lv7()
 | |
|     {
 | |
|         CreateMonster(7);
 | |
|     }
 | |
| 
 | |
|     //[Category("怪兽")]
 | |
|     //public void 怪Lv8()
 | |
|     //{
 | |
|     //    CreateMonster(8);
 | |
|     //}
 | |
| 
 | |
|     //[Category("怪兽")]
 | |
|     //public void 怪Lv9()
 | |
|     //{
 | |
|     //    CreateMonster(9);
 | |
|     //}
 | |
| 
 | |
|     //[Category("怪兽")]
 | |
|     //public void 怪Lv10()
 | |
|     //{
 | |
|     //    CreateMonster(10);
 | |
|     //}
 | |
| 
 | |
|     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;
 | |
|     }
 | |
| } |