using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class PersonIconCtrl : IconBase { public Toggle toggle_use; bool init; // Start is called before the first frame update void Start() { Init(); } private void Init() { if (init) return; toggle_use.onValueChanged.AddListener(UseToggleValueChanged); init = true; } private void UseToggleValueChanged(bool isOn) { EventCenter.Instance.EventTrigger("SelectPersonEditor", this, isOn); } public override void SetUpdateIconMsg(object isOn,string msgType="") { Init(); if (msgType == "RestValue") { toggle_use.isOn = false; } else { toggle_use.isOn = (bool)isOn; } } }