需要修改的变量均设置为 public static 类型
public void DeveloperAdjust()
{
if (devflag == false)
{
devtext.text = "调试:开";
PlayerControl.maxBulletCount = 999;
PlayerControl.curBulletCount = 999;
PlayerControl.maxHealth = 999;
PlayerControl.currentHealth = 999;
PlayerControl.speed = 6f;
devflag = true;
return;
}
if (devflag == true)
{
devtext.text = "调试:关";
PlayerControl.maxBulletCount = 6;
PlayerControl.curBulletCount = 2;
PlayerControl.maxHealth = 2;
PlayerControl.currentHealth = 2;
PlayerControl.speed = 3f;
UpdateHealthBar(2, 2);
UpdateBulletCount(2, 6);
devflag = false;
return;
}
}
附完整教程:
原博地址
https://blog.csdn.net/weixin_43673589