Esempio n. 1
0
 void setVisible(zzInterfaceGUI[] pGUIs,bool pVisible)
 {
     foreach(var lUI in pGUIs)
     {
         lUI.visible = pVisible;
     }
 }
Esempio n. 2
0
 void LanguageButtonCall(zzInterfaceGUI pGUI)
 {
     zzLanguage.GetInstance().pGUI = GUIRoot.getSubElement("window");
     if (zzLanguage.GetInstance().Language == "English")
         zzLanguage.GetInstance().Language = "Chinese";
     else
         zzLanguage.GetInstance().Language = "English";
     //Debug.Log(zzLanguage .GetInstance().Language);
 }
Esempio n. 3
0
    void Start()
    {
        zzSceneObjectMap lSceneObjectMap = GameScene.Singleton.playerInfo
            .UiRoot.GetComponent<zzSceneObjectMap>();

        if (!moneyLabel)
            moneyLabel = lSceneObjectMap.getObject("moneyLabel").GetComponent<zzInterfaceGUI>();

        if (!bagControl)
            bagControl = gameObject.GetComponent<zzItemBagControl>();

        bagControl.addCallAfterStart(afterBagStartCall);
    }
Esempio n. 4
0
 void sewer1ButtonCall(zzInterfaceGUI pGUI)
 {
     Application.LoadLevel("sewer1");
 }
Esempio n. 5
0
 void QuitButtonCall(zzInterfaceGUI pGUI)
 {
     Application.Quit();
 }
Esempio n. 6
0
 void NetworkMenuButtonCall(zzInterfaceGUI pGUI)
 {
     Application.LoadLevel("NetworkMenu");
 }
Esempio n. 7
0
 void ChooseRaceButtonCall(zzInterfaceGUI pGUI)
 {
     Application.LoadLevel("ChooseRace");
 }
 zzGUIRender findGUIRoot(zzInterfaceGUI pGUI)
 {
     while (pGUI && !(pGUI is zzGUIRender))
     {
         if (pGUI.transform.parent)
             pGUI = pGUI.getParent();
         else
             pGUI = null;
     }
     return pGUI as zzGUIRender;
 }
Esempio n. 9
0
 public static void _setRoot(zzInterfaceGUI pRoot)
 {
     var lRootPosition = pRoot.getPosition();
     originOfCoordinates = new Vector2(lRootPosition.x, lRootPosition.y);
     _root = pRoot;
 }
Esempio n. 10
0
 public virtual void addClickEventGUIReceiver(zzInterfaceGUI.GUICallFunc pCall)
 {
     clickCall += pCall;
 }
Esempio n. 11
0
 //public GUIContent getContent()
 //{
 //    return _content;
 //}
 //public _style getStyle()
 //{
 //    return _style;
 //}
 //只是为了付类型
 //protected void nullGUICallback ( zzInterfaceGUI pGUI  ){
 //}
 protected static void nullGUICallback( zzInterfaceGUI pGUI  )
 {
 }
Esempio n. 12
0
    void getUI()
    {
        var lUiRoot = GameScene.Singleton.playerInfo.UiRoot;

        lUiRoot.GetComponent<zzInterfaceGUI>().setVisible(true);

        mUIObjectMap = lUiRoot.GetComponent<zzSceneObjectMap>();

        bloodBar = mUIObjectMap.getObject("bloodBar").GetComponent<zzGUIProgressBarBase>();

        skillBar = mUIObjectMap.getObject("skillValue").GetComponent<zzGUIProgressBarBase>();

        moneyLabel = mUIObjectMap.getObject("moneyLabel").GetComponent<zzInterfaceGUI>();

        if (!rebirthClockUI)
            rebirthClockUI = mUIObjectMap.getObject("rebirthClock").GetComponent<zzInterfaceGUI>();

        //基地血量UI绑定
        var lManagerTransform = GameSceneManager.Singleton.getManager(GameScene.Singleton.playerInfo.race,
            GameSceneManager.UnitManagerType.raceBase).managerRoot;
        if(lManagerTransform.childCount>0)
        {
            var lRaceBaseBloodRateUI = mUIObjectMap.getObject("coreValue").GetComponent<zzGUIProgressBarBase>();
            lManagerTransform.GetChild(0).GetComponent<Life>().addBloodValueChangeCallback(
                (x) => lRaceBaseBloodRateUI.rate = x.rate);
        }

        //物品UI绑定
        itemBagUI = gameObject.AddComponent<WMItemBagUI>();
        itemBagUI.itemBag = itemBag;
    }
Esempio n. 13
0
 public ItemUIControl(zzInterfaceGUI pItem)
 {
     item = pItem;
 }
Esempio n. 14
0
    void Init()
    {
        zzSceneObjectMap lSceneObjectMap = GameScene.Singleton.playerInfo
            .UiRoot.GetComponent<zzSceneObjectMap>();

        if (!bagUiControl)
            bagUiControl = gameObject.GetComponent<zzItemBagControl>();

        if (!UIroot)
            UIroot = lSceneObjectMap.getObject("ItemInventory").GetComponent<zzInterfaceGUI>();

        itemListUI = new ItemUIControl[numOfShowItem];
        //selectedListUI = new zzInterfaceGUI[numOfShowItem];

        zzInterfaceGUI itemList = UIroot.getSubElement("itemList");
        zzInterfaceGUI selectedList = UIroot.getSubElement("selectedList");
        var lItems = itemBag.items;
        for (int i = 1; i <= numOfShowItem; ++i)
        {
            var lUI = new ItemUIControl(
                itemList.getSubElement(i.ToString()) );
            itemListUI[i - 1] = lUI;
            var lItem = lItems[i - 1];
            lItem.addChangedReceiver(() => refreshItemShow(lItem, lUI));
            //selectedListUI[i - 1] = selectedList.getSubElement(i.ToString());
        }
        //afterBagStartCall();
        //if (showSelected)
        //    setSelected(1);
        //else
        //    setSelected(0);
        refreshItemAllShow();
        //print(gameObject.name+bagControl+(bagControl==null));
        //bagControl.addCallAfterStart(afterBagStartCall);
    }
Esempio n. 15
0
 public void OnGUI()
 {
     //因为和GUI中depth的概念相反,所以要负
     GUI.depth = guiRenderDepth;
     cursorOnControl = null;
     calculateAndSetPosition();
     originOfCoordinates = new Vector2(position.x, position.y);
     zzGUI._setRoot(this);
     _renderGUI(position);
     _useCustomPosition = false;
     zzGUI.offset = Vector2.zero;
 }
Esempio n. 16
0
 void OnReadImage(zzInterfaceGUI pGUI)
 {
     lastLocation = fileBrowserDialog.selectedLocation;
     readImage(lastLocation);
 }
Esempio n. 17
0
 void bindButtonCall(zzInterfaceGUI pButtonContain, string pButtonName, zzInterfaceGUI.GUICallFunc pCall)
 {
     zzButton lButton = (zzButton)pButtonContain.getSubElement(pButtonName);
     lButton.addClickEventGUIReceiver(pCall);
 }
Esempio n. 18
0
    void Start()
    {
        zzSceneObjectMap lSceneObjectMap = GameScene.Singleton.playerInfo
            .UiRoot.GetComponent<zzSceneObjectMap>();

        if (!bagControl)
            bagControl = gameObject.GetComponent<zzItemBagControl>();

        if (!UIroot)
            UIroot = lSceneObjectMap.getObject("ItemInventory").GetComponent<zzInterfaceGUI>();

        itemListUI = new zzInterfaceGUI[numOfShowItem];
        selectedListUI = new zzInterfaceGUI[numOfShowItem];

        zzInterfaceGUI itemList = UIroot.getSubElement("itemList");
        zzInterfaceGUI selectedList = UIroot.getSubElement("selectedList");

        for (int i = 1; i <= numOfShowItem; ++i)
        {
            itemListUI[i - 1] = itemList.getSubElement(i.ToString());
            selectedListUI[i - 1] = selectedList.getSubElement(i.ToString());
        }
        if (showSelected)
            setSelected(1);
        else
            setSelected(0);

        //print(gameObject.name+bagControl+(bagControl==null));
        bagControl.addCallAfterStart(afterBagStartCall);
    }
    void Start()
    {
        //soldierFactoryState = SoldierFactoryState.getSingleton();
        //soldierFactoryState.setChangedCall(refreshItemShow);

        zzSceneObjectMap lSceneObjectMap = GameScene.Singleton.playerInfo
            .UiRoot.GetComponent<zzSceneObjectMap>();

        if (!UIroot)
            UIroot = lSceneObjectMap.getObject("soldierModule")
                .GetComponent<zzInterfaceGUI>();

        zzValueMap lValueMap = UIroot.GetComponent<zzValueMap>();
        minIconSize = float.Parse(lValueMap.getValue("minIconSize"));
        maxIconSize = float.Parse(lValueMap.getValue("maxIconSize"));
        float lIconScaleSpeed = float.Parse(lValueMap.getValue("iconScaleSpeed"));

        itemListUI = new zzGUITransform[numOfShowItem];
        imgListUI = new zzInterfaceGUI[numOfShowItem];
        selectedListUI = new zzInterfaceGUI[numOfShowItem];
        animationList = new zzGUIAniToTargetScale[numOfShowItem];
        soldierFactoryUI = new SoldierFactoryUIControl[numOfShowItem];
        zzInterfaceGUI lItemList = UIroot.getSubElement("itemList");
        zzInterfaceGUI lSelectedList = UIroot.getSubElement("selectedList");

        for (int i = 1; i <= numOfShowItem; ++i)
        {
            zzGUITransform lGUITransform = (zzGUITransform)lItemList.getSubElement(i.ToString());
            //itemListUI[i - 1] = lGUITransform;
            //imgListUI[i - 1] = itemListUI[i - 1].getSubElement("pic");
            //selectedListUI[i - 1] = lSelectedList.getSubElement(i.ToString());
            //animationList[i - 1] = lGUIAniToTargetScale;
            //初始中 先全部隐藏
            lGUITransform.visible = false;
            var lGUIAniToTargetScale = lGUITransform.GetComponent<zzGUIAniToTargetScale>();
            lGUIAniToTargetScale.enabled = false;
            lGUIAniToTargetScale.speed = lIconScaleSpeed;

            var lUIControl = new SoldierFactoryUIControl();
            soldierFactoryUI[i - 1] = lUIControl;
            lUIControl.item = lGUITransform;
            lUIControl.soldierIcon = lGUITransform.getSubElement("pic");
            lUIControl.scaleAnimation = lGUIAniToTargetScale;
            lUIControl.costRoot = lGUITransform.getSubElement("cost");
            lUIControl.unlockCostLabel = lUIControl.costRoot.getSubElement("costLabel");
            lUIControl.selectedUI = lSelectedList.getSubElement(i.ToString());
            lUIControl.maxUiSize = maxIconSize;
            lUIControl.minUiSize = minIconSize;
        }
        showImage();
        refreshItemShow();
        setSelected(1);
    }