123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System;
- using UnityEngine;
- namespace Tools
- {
- public class PlayerEnemyHealth : DebugGuiBase
- {
- protected override string UIDebugButtonName
- {
- get
- {
- return "血量控制";
- }
- }
- protected override void GUIStart()
- {
- float num = (float)Screen.width;
- this.GUIArea = new Rect(num / 2f - 320f, 20f, 640f, 500f);
- }
- public override void OnDebugGUI()
- {
- GUILayout.BeginArea(this.GUIArea);
- GUILayout.BeginVertical("box", new GUILayoutOption[0]);
- GUILayout.Label("HP " + R.Player.Attribute.currentHP, new GUILayoutOption[0]);
- GUILayout.BeginHorizontal(new GUILayoutOption[]
- {
- GUILayout.Width(600f)
- });
- GUILayout.FlexibleSpace();
- if (GUILayout.Button("Kill All Enemies", new GUILayoutOption[]
- {
- GUILayout.Width(400f)
- }))
- {
- this.KillAllEnemy();
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- GUILayout.BeginHorizontal(new GUILayoutOption[]
- {
- GUILayout.Width(600f)
- });
- GUILayout.FlexibleSpace();
- if (GUILayout.Button("Full HP", new GUILayoutOption[]
- {
- GUILayout.Width(400f)
- }))
- {
- this.PlayerHPRecover();
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- GUILayout.BeginHorizontal(new GUILayoutOption[]
- {
- GUILayout.Width(600f)
- });
- GUILayout.FlexibleSpace();
- if (GUILayout.Button("Kill yourself", new GUILayoutOption[]
- {
- GUILayout.Width(400f)
- }))
- {
- this.KillPlayer();
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- GUILayout.BeginHorizontal(new GUILayoutOption[]
- {
- GUILayout.Width(600f)
- });
- GUILayout.FlexibleSpace();
- if (GUILayout.Button("HP -20", new GUILayoutOption[]
- {
- GUILayout.Width(400f)
- }))
- {
- R.Player.Attribute.currentHP -= 20;
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- GUILayout.EndVertical();
- GUILayout.EndArea();
- }
- private void KillAllEnemy()
- {
- R.Enemy.KillAllEnemy();
- }
- private void PlayerHPRecover()
- {
- PlayerAction.Reborn();
- }
- private void KillPlayer()
- {
- R.Player.Kill();
- }
- private Rect GUIArea;
- }
- }
|