using UnityEngine; 
 | 
using UnityEngine.UI; 
 | 
  
 | 
public class AffairFuncCell : MonoBehaviour 
 | 
{ 
 | 
    [SerializeField] Image lockImg; 
 | 
    [SerializeField] ImageEx titleBG; 
 | 
    [SerializeField] Text titleText; 
 | 
    [SerializeField] Button funcBtn; 
 | 
    public int funcID; 
 | 
  
 | 
    void Start() 
 | 
    {  
 | 
        funcBtn.AddListener(OnClickFunc); 
 | 
    } 
 | 
  
 | 
    void OnEnable() 
 | 
    { 
 | 
        if (funcID != 0 &&FuncOpen.Instance.IsFuncOpen(funcID)) 
 | 
        { 
 | 
            lockImg.SetActive(false); 
 | 
            titleBG.gray = false; 
 | 
            //DED4C8 
 | 
            titleText.color = new Color32(222, 212, 200, 255); 
 | 
        } 
 | 
        else 
 | 
        { 
 | 
            lockImg.SetActive(true); 
 | 
            titleBG.gray = true; 
 | 
            titleText.color = UIHelper.GetUIColor(TextColType.Gray); 
 | 
        } 
 | 
         
 | 
    } 
 | 
  
 | 
    void OnClickFunc() 
 | 
    { 
 | 
        if (!FuncOpen.Instance.IsFuncOpen(funcID, true)) 
 | 
        { 
 | 
            return; 
 | 
        } 
 | 
  
 | 
        if (funcID == 8) 
 | 
        { 
 | 
            UIManager.Instance.OpenWindow<GoldRushWorkerWin>(); 
 | 
        } 
 | 
        // else if (funcID == 214) 
 | 
        // {  
 | 
        //     GoldRushManager.Instance.NotifyGoldRushEvent(0, 0, 2); 
 | 
        // } 
 | 
  
 | 
    } 
 | 
} 
 |