Ejemplo n.º 1
0
    void showPetItemDialog()
    {
        Rect scrollRect =new Rect(0,45,245,245);
        Rect scrollRectLabel =new Rect(5,5,250,275);
        GUI.BeginGroup(scrollRectLabel,"",AvatarGameSkin.GetStyle("PetItemScrollArea"));
        GUIStyle style = AvatarGameSkin.GetStyle("PetItemScroll");
        scrollPos = GUI.BeginScrollView(scrollRect,  scrollPos,new Rect(0,0,230,(userPetItems.Length/3+(userPetItems.Length%3>0?1:0))*80),new GUIStyle(),style);
        //float pos = 0;
        GUILayout.BeginVertical();
        for(int i=0;i<userPetItems.Length/3+(userPetItems.Length%3>0?1:0);i++){
            GUILayout.BeginHorizontal("PetItemRow");
            for (int j=0;j<3;j++){
                int c=i*3+j;
                //Debug.Log(userPetItems.Length+":"+c);
                if (c >= userPetItems.Length) {
                    GUILayout.Label("","PetBlankItem");
                    continue;
                    //break;
                }
                //GUI.BeginGroup(new Rect(0,pos,200,52),"",AvatarGameSkin.GetStyle("PetItemColumn"));
                GUILayout.BeginVertical();
                //itemLabels[c].text = userPetItems[c].number.ToString();
                if(GUILayout.Button(itemLabels[c].image,AvatarGameSkin.GetStyle("PetItemButton")) && !PetItemConfirmDialogVisibility){///////////
                    if (userPetItems[c].number > 0) {
                        PetItemConfirmDialogVisibility = true;
                        currentSelectPetItem=userPetItems[c];
                        currentSelectPetItemContent=itemLabels[c];
                        PetItemDialogVisibility = false;
                    } else {
                        //MainUI_Component.OnCustomDialog("アイテムが不足しています!");
                        Debug.LogWarning("アイテムが不足しています!");
                    }
                };
                GUILayout.Label(userPetItems[c].number.ToString(),AvatarGameSkin.GetStyle("PetItemCountLabel"));
                GUILayout.EndVertical();
                //GUI.EndGroup();
            }
            GUILayout.EndHorizontal();
        }
        GUILayout.EndVertical();

        GUI.EndScrollView();
        //		GUI.Label(new Rect(5,5,180,20),"もちもの");
        if (GUI.Button(new Rect(225,5,15,15),"×","CloseButton")) {
            PetItemDialogVisibility = false;
            currentSelectPet = null;
            currentSelectPetData = null;
        }
        GUI.EndGroup();
    }
Ejemplo n.º 2
0
 public void setPetItemDialogVisible(GameObject pet)
 {
     currentSelectPet = pet;
     PetMove move = pet.GetComponent("PetMove") as PetMove;
     if (move != null) {
         currentSelectPetData = move.petDetail;
         if (userPetItems == null) {
             Application.ExternalCall("GetPetItem", "");
         } else {
             PetItemDialogVisibility = true;
             PetDetailDialogVisibility = false;
         }
     } else {
         currentSelectPet = null;
     }
 }
Ejemplo n.º 3
0
    void showPetDetailDialog()
    {
        GUILayout.BeginArea(new Rect(5,5,250,170),"","PetDetailArea");
        //GUI.Label(new Rect(5,5,240,160),"","PetDetailSeet");
        if (GUI.Button(new Rect(220,5,20,20),"×","CloseButton")) {
            PetDetailDialogVisibility = false;
            currentSelectPet = null;
            currentSelectPetData = null;
        }
        if (currentSelectPetData.iconTexture != null) {
            GUI.Label(new Rect(180,5,65,65), currentSelectPetData.iconTexture);
        }
        GUILayout.BeginVertical();
        GUILayout.BeginHorizontal("PetDetailNameRow");
        GUILayout.Label(currentSelectPetData.name,"PetDetailName");
        //GUILayout.Label("ねんれい","PetDetailParameter");
        /*int p = currentSelectPetData.growth_point/2;
        for(int i=0;i<p;i++) {
            GUILayout.Label(hungryPointIcon,"PetDetailParameterIcon");
        }*/
        GUILayout.Label(currentSelectPetData.growth_point.ToString(),"PetAge");
        GUILayout.Label("歳","PetAgeSai");
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal("PetDetailParameterRow");
        //GUILayout.Label("あいじょう","PetDetailParameter");
        int p =currentSelectPetData.love_point/20;
        for(int i=0;i<p;i++) {
            GUILayout.Label(lovePointIcon,"PetDetailParameterIcon");
        }
        for (int j=0;j<5-p;j++) {
            GUILayout.Label(nolovePointIcon,"PetDetailParameterIcon");
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal("PetDetailParameterRow");
        //GUILayout.Label("おなか","PetDetailParameter");
        p=currentSelectPetData.hunger_point/20;
        for(int i=0;i<p;i++) {
            GUILayout.Label(hungryPointIcon,"PetDetailParameterIcon");
        }
        for (int j=0;j<5-p;j++) {
            GUILayout.Label(nohungryPointIcon,"PetDetailParameterIcon");
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal("PetDetailParameterRow");
        //GUILayout.Label("ごきげん","PetDetailParameter");
        p=currentSelectPetData.feeling_point/20;
        for(int i=0;i<p;i++) {
            GUILayout.Label(feelingPointIcon,"PetDetailParameterIcon");
        }
        for (int j=0;j<5-p;j++) {
            GUILayout.Label(nofeelingPointIcon,"PetDetailParameterIcon");
        }
        GUILayout.EndHorizontal();
        //Debug.Log(currentSelectPetData.pet_condition);
        //GUILayout.Label(conditionNames[currentSelectPetData.pet_condition],"PetDetailCondition"+currentSelectPetData.pet_condition);

        GUILayout.EndVertical();
        GUILayout.EndArea();
    }
Ejemplo n.º 4
0
 public void setPetDetailDialogVisible(GameObject pet)
 {
     currentSelectPet = pet;
     PetMove move = pet.GetComponent("PetMove") as PetMove;
     if (move != null) {
         currentSelectPetData = move.petDetail;
         PetDetailDialogVisibility = true;
             PetItemDialogVisibility = false;
     } else {
         currentSelectPet = null;
     }
 }