This commit is contained in:
2020-07-04 14:41:25 +08:00
parent 70c346d2c1
commit a8f02e4da5
3748 changed files with 587372 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Coolape;
public class CLUICheckbox : CLUIElement
{
public bool isMultMode = true;
object data;
//ArrayList checkeds = new ArrayList();
string _value = "";
public List<EventDelegate> onChange = new List<EventDelegate>();
public void init(object data)
{
this.data = data;
}
protected void ExecuteOnChange()
{
if (EventDelegate.IsValid(onChange))
{
EventDelegate.Execute(onChange, gameObject); // modify by chenbin
}
}
public void OnClick()
{
CLPanelManager.getPanelAsy("PanelPopCheckBoxs", (Callback)onGetPanel);
}
void onGetPanel(params object[] obj)
{
CLPanelLua p = (CLPanelLua)(obj[0]);
ArrayList orgs = new ArrayList();
orgs.Add(data);
orgs.Add(value);
orgs.Add(isMultMode);
orgs.Add((Callback)onSelectedValue);
p.setData(orgs);
CLPanelManager.showTopPanel(p, true, true);
}
void onSelectedValue(params object[] orgs)
{
string val = orgs[0].ToString();
value = val;
}
public override object value
{
get
{
return _value;
}
set
{
_value = value.ToString();
ExecuteOnChange();
}
}
public override object getValue()
{
return value;
}
public override void setValue(object obj)
{
value = obj;
}
}