Exemplo n.º 1
0
 private void OnDestroy()
 {
     Instance = null;
 }
Exemplo n.º 2
0
    public static event collBackLeveUp eveLevelUp; //Resting()


    void Awake()
    {
        Instance = this;
        //base.Awake();
        //purchaseBox 에 붙어 있는 updatebox을 열기위한 버튼임
        updateBoxBtn = updateBox.GetComponentInChildren <Button>();
        updateBoxBtn.onClick.AddListener(delegate
        {
            AppSound.instance.SE_CARD_CHOICE.Play();

            //돈이 업데이트금액보다 만을때  ItemDisplayer.instance_ItemDisplayer.CurhasGold
            if (nextUpGold < ItemDisplayer.instance_ItemDisplayer.CurhasGold)
            {
                //활성화 되면 자동으로 애니실행
                updateShow.SetActive(true);
                updateBox.SetActive(false);


                //ItemSampleTop의 타입을 직접 확인
                if (card.eCardType == CARDOBJTYPE.TabSlotCard)
                {
                    SetUpdateShowOne(ID, card.gameObject, updateShow);
                }
                else
                {
                    SetUpdateShow(ID, card.gameObject, frontObj, updateShow);
                }
            }
            else
            {
                //TODO:ToolBox로 표현해  주어야 한다.
                print("금액이 부족합니다.");
            }
        });

        UpdateShowCloseBtn = updateShow.transform.Find("Button_Close").GetComponent <Button>();
        UpdateShowCloseBtn.onClick.AddListener(delegate
        {
            AppSound.instance.SE_CARD_CHOICE.Play();
            updateShow.SetActive(false);
            GameData.Instance.isStopScroview = false;
            GameData.Instance.IsShowCard     = false;
            //TODO: 여기서 활성화된 backCard를 다시 하이드 해줘야 한다.

            card.GetComponent <UnityCard>().transform.Find("Panel").gameObject.SetActive(false);
            //가격전달 메소드
        });

        puchaseBtn = purchaseBox.transform.Find("Button").GetComponent <Button>();

        puchaseBtn.onClick.AddListener(delegate
        {
            AppSound.instance.SE_CARD_CHOICE.Play();
            if (!isOne)
            {
                CountAnime();
            }

            SaleObj.GetComponent <DailySale>().PurchaseSend();
            SaleObj.GetComponent <DailySale>().OnClick();
            isPurchase = true;

            eveLevelUp();
        });

        purchaseCloseBtn = purchaseBox.transform.Find("Button_Close").GetComponent <Button>();
        purchaseCloseBtn.onClick.AddListener(delegate
        {
            AppSound.instance.SE_CASE_CLOSE.Play();
            if (isPurchase)
            {
                SaleObj.GetComponent <DailySale>().PurchaseEnd();
                isPurchase = false;
            }
            purchaseBox.SetActive(false);
        });
    }