void Start()
 {
     wip = FindObjectOfType<WeaponInfoPanel>();
 }
Пример #2
0
    void Init()
    {
        Cursor.visible = true;

        selectionRect[0] = AutoRect.AutoPos(new Rect(28, 88, 112, 112));

        selectionRect[1] = AutoRect.AutoPos(new Rect(28 + 150, 88, 112, 112));

        selectionRect[2] = AutoRect.AutoPos(new Rect(28 + 150 * 2, 88, 112, 112));


        gameState = GameApp.GetInstance().GetGameState();

        weaponUI = UIResourceMgr.GetInstance().GetMaterial("Weapons");
        Material weapon3Material = UIResourceMgr.GetInstance().GetMaterial("Weapons3");
        Rect     gridbackRect    = WeaponsLogoTexturePosition.GetWeaponIconTextureRect(13);

        battleWeaponGrid = new UIDragGrid(0);

        rectToWeaponMap = GameApp.GetInstance().GetGameState().GetRectToWeaponMap();

        for (int i = 0; i < SELECTION_NUM; i++)
        {
            battleWeaponGrid.AddGrid(selectionRect[i], weapon3Material, gridbackRect);
        }


        GameApp.GetInstance().Init();
        weaponList = GameApp.GetInstance().GetGameState().GetWeapons();


        PutBattleWeapons();


        weaponScroller = new UIImageScroller(AutoRect.AutoPos(new Rect(400, 0, 550, 640)), AutoRect.AutoPos(new Rect(440, 180, 500, 369)), 1, AutoRect.AutoSize(WeaponsLogoTexturePosition.WeaponLogoSize), ScrollerDir.Vertical, true);
        weaponScroller.SetImageSpacing(AutoRect.AutoSize(WeaponsLogoTexturePosition.WeaponLogoSpacing));
        weaponScroller.EnableLongPress();


        for (int i = 0; i < weaponList.Count; i++)
        {
            if (weaponList[i].Exist == WeaponExistState.Owned)
            {
                UIImage uiImage = new UIImage();

                TexturePosInfo info = WeaponsLogoTexturePosition.GetWeaponTextureRect(i);


                uiImage.SetTexture(info.m_Material, info.m_TexRect, AutoRect.AutoSize(info.m_TexRect));
                weaponScroller.Add(uiImage);
            }
        }

        this.Add(weaponScroller);
        weaponScroller.EnableScroll();
        Material shopMaterial = UIResourceMgr.GetInstance().GetMaterial("ShopUI");

        weaponScroller.AddOverlay(shopMaterial, ShopTexturePosition.LockedLogo);
        Material avatarLogoMaterial = UIResourceMgr.GetInstance().GetMaterial("Avatar");

        weaponScroller.SetMaskImage(avatarLogoMaterial, AvatarTexturePosition.Mask);

        Material avatarMaterial = UIResourceMgr.GetInstance().GetMaterial("Avatar");

        weaponScroller.SetCenterFrameTexture(avatarMaterial, AvatarTexturePosition.Frame);



        weaponScroller.Show();
        battleWeaponGrid.Show();
        this.Add(battleWeaponGrid);



        getMoreMoneyButton = new UITextButton();
        getMoreMoneyButton.SetTexture(UIButtonBase.State.Normal, arenaMenuMaterial,

                                      ArenaMenuTexturePosition.GetMoneyButtonNormal, AutoRect.AutoSize(ArenaMenuTexturePosition.GetMoneyButtonSmallSize));
        getMoreMoneyButton.SetTexture(UIButtonBase.State.Pressed, arenaMenuMaterial,

                                      ArenaMenuTexturePosition.GetMoneyButtonPressed, AutoRect.AutoSize(ArenaMenuTexturePosition.GetMoneyButtonSmallSize));
        getMoreMoneyButton.Rect = AutoRect.AutoPos(uiPos.GetMoreMoneyButton);

        this.Add(getMoreMoneyButton);


        cashPanel = new CashPanel();
        cashPanel.Show();
        this.Add(cashPanel);

        weaponInfoPanel = new WeaponInfoPanel();
        this.Add(weaponInfoPanel);


        if (AutoRect.GetPlatform() == Platform.IPad)
        {
            avatarFrame = new Avatar3DFrame(AutoRect.AutoPos(new Rect(0, 200, 500, 600)), new Vector3(-1.499798f * 0.9f, -0.6672753f * 0.9f, 4.420711f), new Vector3(1.3f, 1.3f, 1.3f) * 0.85f);
        }
        else
        {
            avatarFrame = new Avatar3DFrame(AutoRect.AutoPos(new Rect(0, 200, 500, 600)), new Vector3(-1.499798f, -0.6672753f, 4.420711f), new Vector3(1.3f, 1.3f, 1.3f));
        }



        this.Add(avatarFrame);
    }
Пример #3
0
    void Awake () {
        wip = this;       
	}