public static ButtonColorChange RegisterInstance(GameObject obj) { ButtonColorChange btnclrChange = obj.GetComponent <ButtonColorChange> (); if (btnclrChange == null) { btnclrChange = obj.AddComponent <ButtonColorChange>(); } return(btnclrChange); }
public void changeCheckedObject(GameObject obj) { if (obj != objNowObject) { if (objNowObject != null) { foreach (GameObject objChild in ButtonRootDelegate.RegisterBtnDelegate(objNowObject).list_ObjectList) { ButtonColorChange.RegisterInstance(objChild).setIsChecked(false); ButtonColorChange.RegisterInstance(objChild).change(); } objNowObject = obj; } else { objNowObject = obj; } } }