32 lines
776 B
C#
32 lines
776 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class Deviceinformation : MonoBehaviour
|
|
{
|
|
public Text weapon_text;//武器名称
|
|
public InputField number_input;//输入的个数
|
|
public Toggle Options_toggle;//是否勾选状态
|
|
|
|
public void Weapon(string name, string number,string one,Action action)
|
|
{
|
|
weapon_text.text = name;
|
|
number_input.text = number.ToString();
|
|
if (one == "0")
|
|
{
|
|
Options_toggle.isOn = false;
|
|
}
|
|
else if (one == "1")
|
|
{
|
|
Options_toggle.isOn = true;
|
|
}
|
|
Options_toggle.onValueChanged.AddListener((ison) =>
|
|
{
|
|
action?.Invoke();
|
|
});
|
|
|
|
}
|
|
}
|