0.3.2.15
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93be6597eb9d77e47a12d5c2d57241dd
|
||||
guid: 67af4a65b1f578b4b9fa609cd12df71b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using BlueWater.Interfaces;
|
||||
using Sirenix.OdinInspector;
|
||||
using Sirenix.Utilities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Items
|
||||
@ -56,6 +57,7 @@ namespace BlueWater.Items
|
||||
[field: SerializeField]
|
||||
public List<CocktailIngredient> ValidIngredients { get; set; } = new(5);
|
||||
|
||||
//해당 칵테일에 포함된 Ratio를 리턴
|
||||
public List<CocktailIngredient> GetValidIngredients(int liquidMaxAmount)
|
||||
{
|
||||
var ingredients = new List<CocktailIngredient>(5);
|
||||
@ -68,5 +70,28 @@ namespace BlueWater.Items
|
||||
|
||||
return ingredients;
|
||||
}
|
||||
|
||||
//해당 칵테일에 포함하는 Ingredient를 찾음 없는 값이면 0을 리턴함
|
||||
public int SearchIngredient(string serchIngredientIdx)
|
||||
{
|
||||
if (!IngredientIdx1.IsNullOrWhitespace() && IngredientIdx1.Equals(serchIngredientIdx)) { return 1; }
|
||||
if (!IngredientIdx2.IsNullOrWhitespace() && IngredientIdx2.Equals(serchIngredientIdx)) { return 2; }
|
||||
if (!IngredientIdx3.IsNullOrWhitespace() && IngredientIdx3.Equals(serchIngredientIdx)) { return 3; }
|
||||
if (!IngredientIdx4.IsNullOrWhitespace() && IngredientIdx4.Equals(serchIngredientIdx)) { return 4; }
|
||||
if (!IngredientIdx5.IsNullOrWhitespace() && IngredientIdx5.Equals(serchIngredientIdx)) { return 5; }
|
||||
return 0;//
|
||||
}
|
||||
|
||||
public int GetIngredientRatio(string serchIngredientIdx)
|
||||
{
|
||||
int serchNum = SearchIngredient(serchIngredientIdx);
|
||||
|
||||
if (serchNum == 1) { return IngredientRatio1;}
|
||||
if (serchNum == 2) { return IngredientRatio2;}
|
||||
if (serchNum == 3) { return IngredientRatio3;}
|
||||
if (serchNum == 4) { return IngredientRatio4;}
|
||||
if (serchNum == 5) { return IngredientRatio5;}
|
||||
return 0;// 없거나 0으로 표기됨
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
using Unity.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BlueWater.Items
|
||||
@ -6,5 +7,6 @@ namespace BlueWater.Items
|
||||
public class LiquidDataSo : DataSo<LiquidData>
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -46,7 +46,10 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 0cf23778fd0b2994c9d608fbbf185468, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidA
|
||||
<Ratio>k__BackingField: 100
|
||||
<Amount>k__BackingField: 300
|
||||
- <Key>k__BackingField: Cocktail002
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail002
|
||||
@ -63,7 +66,10 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 600806d36167cb140aa40eb51cf58afa, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidB
|
||||
<Ratio>k__BackingField: 100
|
||||
<Amount>k__BackingField: 300
|
||||
- <Key>k__BackingField: Cocktail003
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail003
|
||||
@ -80,7 +86,10 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: c55f4b0a55a391d488e54a28dc840509, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidC
|
||||
<Ratio>k__BackingField: 100
|
||||
<Amount>k__BackingField: 300
|
||||
- <Key>k__BackingField: Cocktail004
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail004
|
||||
@ -97,7 +106,10 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 576d6ff3856f8ef419586ff12f2742b5, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidD
|
||||
<Ratio>k__BackingField: 100
|
||||
<Amount>k__BackingField: 300
|
||||
- <Key>k__BackingField: Cocktail005
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail005
|
||||
@ -114,7 +126,10 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 527440f24542af142a67219f2bcbeec4, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidE
|
||||
<Ratio>k__BackingField: 100
|
||||
<Amount>k__BackingField: 300
|
||||
- <Key>k__BackingField: Cocktail006
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail006
|
||||
@ -131,7 +146,13 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 6a4cd8cdf11fe024e8ecac8e3d60e10d, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidA
|
||||
<Ratio>k__BackingField: 50
|
||||
<Amount>k__BackingField: 150
|
||||
- <Idx>k__BackingField: LiquidC
|
||||
<Ratio>k__BackingField: 50
|
||||
<Amount>k__BackingField: 150
|
||||
- <Key>k__BackingField: Cocktail007
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail007
|
||||
@ -148,7 +169,13 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: b38089ff4046ac044ba79dfa5116aa1b, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidB
|
||||
<Ratio>k__BackingField: 50
|
||||
<Amount>k__BackingField: 150
|
||||
- <Idx>k__BackingField: LiquidD
|
||||
<Ratio>k__BackingField: 50
|
||||
<Amount>k__BackingField: 150
|
||||
- <Key>k__BackingField: Cocktail008
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail008
|
||||
@ -165,7 +192,13 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 71954183dfb02424d835d964c2eb3fc6, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidC
|
||||
<Ratio>k__BackingField: 50
|
||||
<Amount>k__BackingField: 150
|
||||
- <Idx>k__BackingField: LiquidD
|
||||
<Ratio>k__BackingField: 50
|
||||
<Amount>k__BackingField: 150
|
||||
- <Key>k__BackingField: Cocktail009
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail009
|
||||
@ -182,7 +215,16 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: d0748411047fc4a41beb1fb8d551e01e, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidA
|
||||
<Ratio>k__BackingField: 25
|
||||
<Amount>k__BackingField: 75
|
||||
- <Idx>k__BackingField: LiquidB
|
||||
<Ratio>k__BackingField: 25
|
||||
<Amount>k__BackingField: 75
|
||||
- <Idx>k__BackingField: LiquidE
|
||||
<Ratio>k__BackingField: 50
|
||||
<Amount>k__BackingField: 150
|
||||
- <Key>k__BackingField: Cocktail010
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail010
|
||||
@ -199,7 +241,16 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 335f1df58cd58914f97fe9ccae7f6c8c, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidC
|
||||
<Ratio>k__BackingField: 25
|
||||
<Amount>k__BackingField: 75
|
||||
- <Idx>k__BackingField: LiquidD
|
||||
<Ratio>k__BackingField: 25
|
||||
<Amount>k__BackingField: 75
|
||||
- <Idx>k__BackingField: LiquidE
|
||||
<Ratio>k__BackingField: 50
|
||||
<Amount>k__BackingField: 150
|
||||
- <Key>k__BackingField: Cocktail011
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail011
|
||||
@ -216,7 +267,13 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 600806d36167cb140aa40eb51cf58afa, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidB
|
||||
<Ratio>k__BackingField: 80
|
||||
<Amount>k__BackingField: 240
|
||||
- <Idx>k__BackingField: Garnish1
|
||||
<Ratio>k__BackingField: 20
|
||||
<Amount>k__BackingField: 60
|
||||
- <Key>k__BackingField: Cocktail012
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail012
|
||||
@ -233,7 +290,13 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: ee344f47787d148448bd3373235281b6, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidD
|
||||
<Ratio>k__BackingField: 80
|
||||
<Amount>k__BackingField: 240
|
||||
- <Idx>k__BackingField: Garnish1
|
||||
<Ratio>k__BackingField: 20
|
||||
<Amount>k__BackingField: 60
|
||||
- <Key>k__BackingField: Cocktail013
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail013
|
||||
@ -250,7 +313,13 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: aef7fd596cbfc854d87f408c14951641, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidA
|
||||
<Ratio>k__BackingField: 90
|
||||
<Amount>k__BackingField: 270
|
||||
- <Idx>k__BackingField: Garnish2
|
||||
<Ratio>k__BackingField: 10
|
||||
<Amount>k__BackingField: 30
|
||||
- <Key>k__BackingField: Cocktail014
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail014
|
||||
@ -267,7 +336,13 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 91d99e534e5f3c04094b14ed920bec04, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidC
|
||||
<Ratio>k__BackingField: 90
|
||||
<Amount>k__BackingField: 270
|
||||
- <Idx>k__BackingField: Garnish2
|
||||
<Ratio>k__BackingField: 10
|
||||
<Amount>k__BackingField: 30
|
||||
- <Key>k__BackingField: Cocktail015
|
||||
<Value>k__BackingField:
|
||||
<Idx>k__BackingField: Cocktail015
|
||||
@ -284,4 +359,10 @@ MonoBehaviour:
|
||||
<IngredientIdx5>k__BackingField:
|
||||
<IngredientRatio5>k__BackingField: 0
|
||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 527440f24542af142a67219f2bcbeec4, type: 3}
|
||||
<ValidIngredients>k__BackingField: []
|
||||
<ValidIngredients>k__BackingField:
|
||||
- <Idx>k__BackingField: LiquidE
|
||||
<Ratio>k__BackingField: 90
|
||||
<Amount>k__BackingField: 270
|
||||
- <Idx>k__BackingField: Garnish2
|
||||
<Ratio>k__BackingField: 10
|
||||
<Amount>k__BackingField: 30
|
||||
|
@ -1,16 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using BlueWater.Uis;
|
||||
using UnityEngine;
|
||||
|
||||
public class Manual : SwitchActionPopupUi
|
||||
{
|
||||
public override void Open(List<PopupUi> popupUiList)
|
||||
{
|
||||
base.Open(popupUiList);
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
base.Close();
|
||||
}
|
||||
}
|
@ -1,85 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BlueWater;
|
||||
using BlueWater.Items;
|
||||
using BlueWater.Tycoons;
|
||||
using BlueWater.Uis;
|
||||
using ExcelDataReader.Log;
|
||||
using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UI;
|
||||
using Sirenix.OdinInspector;
|
||||
using Spine;
|
||||
using UnityEngine.Android;
|
||||
|
||||
public class ManualBook : SwitchActionPopupUi
|
||||
{
|
||||
private Image _cocktailImage;
|
||||
private TextMeshProUGUI _cocktailName;
|
||||
private GameObject _ingredientSlot1;
|
||||
private GameObject _ingredientSlot2;
|
||||
private GameObject _ingredientSlot3;
|
||||
[field: SerializeField]
|
||||
private Image cocktailImage;
|
||||
[field: SerializeField]
|
||||
private TextMeshProUGUI cocktailName;
|
||||
|
||||
[field: SerializeField, CLabel("메뉴얼 CockTail Prefab")]
|
||||
private ManualCocktailButton _ManualCocktailsPrefabs;
|
||||
|
||||
[field: SerializeField, CLabel("리큐르A 이미지")]
|
||||
private Sprite LiquidA_Sprite;
|
||||
[field: SerializeField, CLabel("리큐르B 이미지")]
|
||||
private Sprite LiquidB_Sprite;
|
||||
[field: SerializeField, CLabel("리큐르C 이미지")]
|
||||
private Sprite LiquidC_Sprite;
|
||||
[field: SerializeField, CLabel("리큐르D 이미지")]
|
||||
private Sprite LiquidD_Sprite;
|
||||
[field: SerializeField, CLabel("리큐르E 이미지")]
|
||||
private Sprite LiquidE_Sprite;
|
||||
[field: SerializeField, CLabel("가니쉬1 이미지")]
|
||||
private Sprite Garnish1_Sprite;
|
||||
[field: SerializeField, CLabel("가니쉬2 이미지")]
|
||||
private Sprite Garnish2_Sprite;
|
||||
|
||||
private struct CocktailsBtn
|
||||
{
|
||||
public CocktailData Cocktail { get; set; }
|
||||
public GameObject CockTailButton { get; set; }
|
||||
public string Idx { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int LiquidA { get; set; }
|
||||
public int LiquidB { get; set; }
|
||||
public int LiquidC { get; set; }
|
||||
public int LiquidD { get; set; }
|
||||
public int LiquidE { get; set; }
|
||||
public int Garnish1 { get; set; }
|
||||
public int Garnish2 { get; set; }
|
||||
public bool Enable { get; set; }
|
||||
|
||||
public int Sibling { get; set; }
|
||||
|
||||
internal CocktailsBtn(CocktailData cocktail,GameObject cockTailButton , string idx , string name )
|
||||
{
|
||||
Cocktail = cocktail;
|
||||
CockTailButton = cockTailButton;
|
||||
Idx = idx;
|
||||
Name = name;
|
||||
LiquidA = 0;
|
||||
LiquidB = 0;
|
||||
LiquidC = 0;
|
||||
LiquidD = 0;
|
||||
LiquidE = 0;
|
||||
Garnish1 = 0;
|
||||
Garnish2 = 0;
|
||||
Sibling = 2048;
|
||||
Enable = false;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<string,CocktailsBtn> _cocktailsBtn;
|
||||
|
||||
//private List<Button> _cocktailsBtn;
|
||||
private ManualCocktailButton manualCocktailsPrefabs;
|
||||
|
||||
[field: SerializeField]
|
||||
private ManualIngredientSlot slot01;
|
||||
[field: SerializeField]
|
||||
private ManualIngredientSlot slot02;
|
||||
[field: SerializeField]
|
||||
private ManualIngredientSlot slot03;
|
||||
[field: SerializeField]
|
||||
private TextMeshProUGUI ratioRange;
|
||||
|
||||
List<ManualCocktailButton> _button = new List<ManualCocktailButton>();
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@ -89,18 +38,6 @@ public class ManualBook : SwitchActionPopupUi
|
||||
void Start()
|
||||
{
|
||||
var book = transform.Find("Book");
|
||||
_cocktailImage = book.Find("CooktailPreview").Find("CocktailImage").GetComponent<Image>();
|
||||
_cocktailName = book.Find("CocktailName").GetComponent<TextMeshProUGUI>();
|
||||
_ingredientSlot1 = book.Find("IngredientSlot1").gameObject;
|
||||
_ingredientSlot2 = book.Find("IngredientSlot2").gameObject;
|
||||
_ingredientSlot3 = book.Find("IngredientSlot3").gameObject;
|
||||
|
||||
_cocktailsBtn = new Dictionary<string,CocktailsBtn>();
|
||||
_cocktailName = book.Find("CocktailName").GetComponent<TextMeshProUGUI>();
|
||||
|
||||
_ingredientSlot1 = book.Find("IngredientSlot1").gameObject;
|
||||
_ingredientSlot2 = book.Find("IngredientSlot2").gameObject;
|
||||
_ingredientSlot3 = book.Find("IngredientSlot3").gameObject;
|
||||
|
||||
// private Image _ingredientSlot1Image;
|
||||
// private Image _ingredientSlot2Image;
|
||||
@ -111,41 +48,37 @@ public class ManualBook : SwitchActionPopupUi
|
||||
{
|
||||
if (element.Idx.Equals("Cocktail000")) continue; //쓰레기는 메뉴얼에 표시하지 않기
|
||||
|
||||
var cocktail = Instantiate(_ManualCocktailsPrefabs, book.Find("CocktailButtons"));
|
||||
var cocktail = Instantiate(manualCocktailsPrefabs, book.Find("CocktailButtons"));
|
||||
cocktail.Initialize(this);
|
||||
cocktail.name = element.Idx;
|
||||
cocktail.transform.Find("Image").GetComponent<Image>().sprite = element.Sprite;
|
||||
|
||||
var createCocktailMenu = new CocktailsBtn(element ,cocktail.gameObject ,element.Idx,element.Name);
|
||||
_button.Add(cocktail);
|
||||
|
||||
foreach (var element2 in element.ValidIngredients) //들어가는 리큐르, 가니쉬 종류
|
||||
{
|
||||
if (element2.Idx.Equals("LiquidA")) {createCocktailMenu.LiquidA = element2.Ratio; createCocktailMenu.Sibling -= 1; };
|
||||
if (element2.Idx.Equals("LiquidB")) {createCocktailMenu.LiquidB = element2.Amount; createCocktailMenu.Sibling -= 2; };
|
||||
if (element2.Idx.Equals("LiquidC")) {createCocktailMenu.LiquidC = element2.Amount; createCocktailMenu.Sibling -= 4; };
|
||||
if (element2.Idx.Equals("LiquidD")) {createCocktailMenu.LiquidD = element2.Amount; createCocktailMenu.Sibling -= 8; };
|
||||
if (element2.Idx.Equals("LiquidE")) {createCocktailMenu.LiquidE = element2.Amount; createCocktailMenu.Sibling -= 16; };
|
||||
if (element2.Idx.Equals("Garnish1")) {createCocktailMenu.Garnish1 = element2.Amount; createCocktailMenu.Sibling -= 32; };
|
||||
if (element2.Idx.Equals("Garnish2")) {createCocktailMenu.Garnish2 = element2.Amount; createCocktailMenu.Sibling -= 64; };
|
||||
if (element2.Idx.Equals("LiquidA")) { var scale = cocktail.transform.localScale; scale.z += 1; cocktail.transform.localScale = scale; };
|
||||
if (element2.Idx.Equals("LiquidB")) { var scale = cocktail.transform.localScale; scale.z += 2; cocktail.transform.localScale = scale; };
|
||||
if (element2.Idx.Equals("LiquidC")) { var scale = cocktail.transform.localScale; scale.z += 4; cocktail.transform.localScale = scale; };
|
||||
if (element2.Idx.Equals("LiquidD")) { var scale = cocktail.transform.localScale; scale.z += 8; cocktail.transform.localScale = scale; };
|
||||
if (element2.Idx.Equals("LiquidE")) { var scale = cocktail.transform.localScale; scale.z += 16; cocktail.transform.localScale = scale; };
|
||||
if (element2.Idx.Equals("Garnish1")) { var scale = cocktail.transform.localScale; scale.z += 32; cocktail.transform.localScale = scale; };
|
||||
if (element2.Idx.Equals("Garnish2")) { var scale = cocktail.transform.localScale; scale.z += 64; cocktail.transform.localScale = scale; };
|
||||
}
|
||||
}
|
||||
|
||||
_cocktailsBtn.Add(element.Idx,createCocktailMenu);
|
||||
}
|
||||
_button = _button.OrderBy(c => c.transform.localScale.z).ToList();
|
||||
|
||||
var sortedCocktails = _cocktailsBtn.OrderByDescending(element => element.Value.Sibling);
|
||||
|
||||
int index = 0;
|
||||
foreach (var element in sortedCocktails)
|
||||
for (int i = 0; i < _button.Count; i++)
|
||||
{
|
||||
element.Value.CockTailButton.transform.SetSiblingIndex(index);
|
||||
index++;
|
||||
_button[i].transform.SetSiblingIndex(i);
|
||||
}
|
||||
|
||||
Update_Cocktails();
|
||||
SelectedItem(_cocktailsBtn["Cocktail001"].CockTailButton.GetComponent<Button>());
|
||||
SelectedItem(_button[0]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override void Open(List<PopupUi> popupUiList)
|
||||
{
|
||||
base.Open(popupUiList);
|
||||
@ -158,20 +91,21 @@ public class ManualBook : SwitchActionPopupUi
|
||||
VisualFeedbackManager.Instance.ResetTimeScale();
|
||||
}
|
||||
|
||||
private void Update_Cocktails()
|
||||
private void Update_Cocktails() //해금된 칵테일의 활성 표시 유무
|
||||
{
|
||||
int playerLv = TycoonManager.Instance.TycoonStatus.CurrentLevel;
|
||||
|
||||
bool check = false;
|
||||
|
||||
var keys = _cocktailsBtn.Keys.ToList();
|
||||
var cocktailDatas = ItemManager.Instance.CocktailDataSo.GetData();
|
||||
|
||||
foreach (var key in keys)
|
||||
foreach (var element in _button)
|
||||
{
|
||||
var element = _cocktailsBtn[key];
|
||||
check = false;
|
||||
|
||||
foreach (var element2 in element.Cocktail.ValidIngredients)
|
||||
var cocktailIngredients = cocktailDatas[element.name].ValidIngredients;
|
||||
|
||||
foreach (var element2 in cocktailIngredients)
|
||||
{
|
||||
if (element2.Idx.Equals("LiquidA")) {};
|
||||
if (element2.Idx.Equals("LiquidB") && playerLv < 5) { check = true; break; }
|
||||
@ -180,143 +114,84 @@ public class ManualBook : SwitchActionPopupUi
|
||||
if (element2.Idx.Equals("LiquidE") && playerLv < 20) { check = true; break; }
|
||||
if (element2.Idx.Equals("Garnish1") && playerLv < 25) { check = true; break; }
|
||||
if (element2.Idx.Equals("Garnish2") && playerLv < 30) { check = true; break; }
|
||||
//해금될때 어느 리퀴르랑 가니쉬가 해금되었는지 확인 불가능 하기 때문에 일단 수기로 작성...
|
||||
}
|
||||
|
||||
if (!check)
|
||||
{
|
||||
element.CockTailButton.transform.Find("Image").GetComponent<Image>().material = null;
|
||||
element.Enable = true;
|
||||
|
||||
_cocktailsBtn[key] = element;
|
||||
}
|
||||
element.transform.Find("Image").GetComponent<Image>().material = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectedItem(Button clickedButton)
|
||||
{
|
||||
Debug.Log(clickedButton.transform.GetSiblingIndex());
|
||||
|
||||
if (_cocktailsBtn[clickedButton.name].Enable) //활성화 된 음료만 클릭이 되도록 한다.
|
||||
{
|
||||
_cocktailImage.sprite = clickedButton.transform.Find("Image").GetComponent<Image>().sprite;
|
||||
|
||||
bool slot1 = false;
|
||||
bool slot2 = false;
|
||||
bool slot3 = false;
|
||||
|
||||
GameObject slot()
|
||||
{
|
||||
if (!slot1)
|
||||
{
|
||||
slot1 = true;
|
||||
return _ingredientSlot1;
|
||||
}
|
||||
|
||||
if (!slot2)
|
||||
public void SelectedItem(ManualCocktailButton clickedButton)
|
||||
{
|
||||
slot2 = true;
|
||||
return _ingredientSlot2;
|
||||
//if (clickedButton.GetComponent<Image>().material == null) //활성화 된 음료만 클릭이 되도록 한다.
|
||||
if (true) // 테스트용
|
||||
{
|
||||
bool checkSlot1 = false;
|
||||
bool checkSlot2 = false;
|
||||
bool checkSlot3 = false;
|
||||
|
||||
var cocktailDatas = ItemManager.Instance.CocktailDataSo.GetData();
|
||||
var liquidDatas = ItemManager.Instance.LiquidDataSo.GetData();
|
||||
|
||||
cocktailImage.sprite = clickedButton.transform.Find("Image").GetComponent<Image>().sprite;
|
||||
cocktailName.text = $"{cocktailDatas[clickedButton.name].Name}";
|
||||
int ratioRangePer = cocktailDatas[clickedButton.name].RatioRange;
|
||||
ratioRange.text = ratioRangePer == 0 ? "" : $"오차범위 : {ratioRangePer}%";
|
||||
|
||||
void Setslot(string ingredientName, int targetSlotNum = 0)
|
||||
{
|
||||
int targetSlotNumF = 0;
|
||||
|
||||
if (targetSlotNum != 0)
|
||||
{
|
||||
if (targetSlotNum == 1) {targetSlotNumF = 1; checkSlot1 = true;}
|
||||
else if (targetSlotNum == 2) {targetSlotNumF = 2; checkSlot2 = true;}
|
||||
else if (targetSlotNum == 3) {targetSlotNumF = 3; checkSlot3 = true;}
|
||||
}
|
||||
else if (!checkSlot1) { targetSlotNumF = 1; checkSlot1 = true; }
|
||||
else if (!checkSlot2) { targetSlotNumF = 2; checkSlot2 = true; }
|
||||
else if (!checkSlot3) { targetSlotNumF = 3; checkSlot3 = true; }
|
||||
|
||||
ManualIngredientSlot targetSlotF = null;
|
||||
if (targetSlotNumF == 1) targetSlotF = slot01;
|
||||
else if (targetSlotNumF == 2) targetSlotF = slot02;
|
||||
else if (targetSlotNumF == 3) targetSlotF = slot03;
|
||||
|
||||
if (targetSlotF == null) return;
|
||||
|
||||
targetSlotF.SetImage(liquidDatas[ingredientName].Sprite);
|
||||
targetSlotF.SetType(ingredientName);
|
||||
targetSlotF.SetPersent($"{cocktailDatas[clickedButton.name].GetIngredientRatio(ingredientName)}%");
|
||||
}
|
||||
|
||||
if (!slot3)
|
||||
//가니쉬 배치를 처음으로... 일단 대기...
|
||||
/*
|
||||
*
|
||||
if (cocktailDatas[clickedButton.name].SearchIngredient("Garnish1") != 0)
|
||||
{
|
||||
slot3 = true;
|
||||
return _ingredientSlot3;
|
||||
Setslot("Garnish1",3);
|
||||
}
|
||||
else if (cocktailDatas[clickedButton.name].SearchIngredient("Garnish2") != 0)
|
||||
{
|
||||
Setslot("Garnish2",3);
|
||||
}
|
||||
*/
|
||||
|
||||
foreach (var element in liquidDatas)
|
||||
{
|
||||
if(cocktailDatas[clickedButton.name].SearchIngredient(element.Value.Idx) != 0) Setslot(element.Value.Idx);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//가니쉬 배치를 처음으로...
|
||||
if (_cocktailsBtn[clickedButton.name].Garnish1 != 0)
|
||||
{
|
||||
_ingredientSlot3.transform.Find("IngredientType").GetComponent<TextMeshProUGUI>().text = "Garnish1";
|
||||
_ingredientSlot3.transform.Find("IngredientPersent").GetComponent<TextMeshProUGUI>().text =
|
||||
$"{_cocktailsBtn[clickedButton.name].Garnish1}%";
|
||||
_ingredientSlot3.transform.Find("IngredientImage").GetComponent<Image>().sprite = Garnish1_Sprite;
|
||||
slot3 = true;
|
||||
}
|
||||
else if (_cocktailsBtn[clickedButton.name].Garnish2 != 0)
|
||||
{
|
||||
_ingredientSlot3.transform.Find("IngredientType").GetComponent<TextMeshProUGUI>().text = "Garnish2";
|
||||
_ingredientSlot3.transform.Find("IngredientPersent").GetComponent<TextMeshProUGUI>().text =
|
||||
$"{_cocktailsBtn[clickedButton.name].Garnish2}%";
|
||||
_ingredientSlot3.transform.Find("IngredientImage").GetComponent<Image>().sprite = Garnish2_Sprite;
|
||||
slot3 = true;
|
||||
}
|
||||
|
||||
if (_cocktailsBtn[clickedButton.name].LiquidA != 0)
|
||||
{
|
||||
var ingredient = slot();
|
||||
ingredient.transform.Find("IngredientType").GetComponent<TextMeshProUGUI>().text = "LiquidA";
|
||||
ingredient.transform.Find("IngredientPersent").GetComponent<TextMeshProUGUI>().text =
|
||||
$"{_cocktailsBtn[clickedButton.name].LiquidA}%";
|
||||
ingredient.transform.Find("IngredientImage").GetComponent<Image>().sprite = LiquidA_Sprite;
|
||||
}
|
||||
|
||||
if (_cocktailsBtn[clickedButton.name].LiquidB != 0)
|
||||
{
|
||||
var ingredient = slot();
|
||||
ingredient.transform.Find("IngredientType").GetComponent<TextMeshProUGUI>().text = "LiquidB";
|
||||
ingredient.transform.Find("IngredientPersent").GetComponent<TextMeshProUGUI>().text =
|
||||
$"{_cocktailsBtn[clickedButton.name].LiquidB}%";
|
||||
ingredient.transform.Find("IngredientImage").GetComponent<Image>().sprite = LiquidB_Sprite;
|
||||
}
|
||||
|
||||
if (_cocktailsBtn[clickedButton.name].LiquidC != 0)
|
||||
{
|
||||
var ingredient = slot();
|
||||
ingredient.transform.Find("IngredientType").GetComponent<TextMeshProUGUI>().text = "LiquidC";
|
||||
ingredient.transform.Find("IngredientPersent").GetComponent<TextMeshProUGUI>().text =
|
||||
$"{_cocktailsBtn[clickedButton.name].LiquidC}%";
|
||||
ingredient.transform.Find("IngredientImage").GetComponent<Image>().sprite = LiquidC_Sprite;
|
||||
}
|
||||
|
||||
if (_cocktailsBtn[clickedButton.name].LiquidD != 0)
|
||||
{
|
||||
var ingredient = slot();
|
||||
ingredient.transform.Find("IngredientType").GetComponent<TextMeshProUGUI>().text = "LiquidD";
|
||||
ingredient.transform.Find("IngredientPersent").GetComponent<TextMeshProUGUI>().text =
|
||||
$"{_cocktailsBtn[clickedButton.name].LiquidD}%";
|
||||
ingredient.transform.Find("IngredientImage").GetComponent<Image>().sprite = LiquidD_Sprite;
|
||||
}
|
||||
|
||||
if (_cocktailsBtn[clickedButton.name].LiquidE != 0)
|
||||
{
|
||||
var ingredient = slot();
|
||||
ingredient.transform.Find("IngredientType").GetComponent<TextMeshProUGUI>().text = "LiquidE";
|
||||
ingredient.transform.Find("IngredientPersent").GetComponent<TextMeshProUGUI>().text =
|
||||
$"{_cocktailsBtn[clickedButton.name].LiquidE}%";
|
||||
ingredient.transform.Find("IngredientImage").GetComponent<Image>().sprite = LiquidE_Sprite;
|
||||
}
|
||||
|
||||
if (!slot1)
|
||||
{
|
||||
_ingredientSlot1.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ingredientSlot1.SetActive(true);
|
||||
}
|
||||
|
||||
if (!slot2)
|
||||
{
|
||||
_ingredientSlot2.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ingredientSlot2.SetActive(true);
|
||||
}
|
||||
|
||||
if (!slot3)
|
||||
{
|
||||
_ingredientSlot3.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ingredientSlot3.SetActive(true);
|
||||
}
|
||||
if (!checkSlot1) { slot01.gameObject.SetActive(false); }
|
||||
else { slot01.gameObject.SetActive(true);}
|
||||
if (!checkSlot2) {slot02.gameObject.SetActive(false); }
|
||||
else {slot02.gameObject.SetActive(true); }
|
||||
if (!checkSlot3) {slot03.gameObject.SetActive(false); }
|
||||
else { slot03.gameObject.SetActive(true); }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,6 @@ public class ManualCocktailButton : MonoBehaviour
|
||||
// 눌린 버튼을 매개변수로 받는 메서드
|
||||
public void OnButtonClicked()
|
||||
{
|
||||
manual.SelectedItem(this.GetComponent<Button>());
|
||||
manual.SelectedItem(this.GetComponent<ManualCocktailButton>());
|
||||
}
|
||||
}
|
||||
|
31
Assets/02.Scripts/Ui/Tycoon/ManualIngredientSlot.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace BlueWater.Uis
|
||||
{
|
||||
public class ManualIngredientSlot : MonoBehaviour
|
||||
{
|
||||
[field: SerializeField]
|
||||
private Image image;
|
||||
[field: SerializeField]
|
||||
private TextMeshProUGUI type;
|
||||
[field: SerializeField]
|
||||
private TextMeshProUGUI persent;
|
||||
|
||||
public void SetImage(Sprite spr)
|
||||
{
|
||||
image.sprite = spr;
|
||||
}
|
||||
|
||||
public void SetType(string str)
|
||||
{
|
||||
type.text = str;
|
||||
}
|
||||
|
||||
public void SetPersent(string str)
|
||||
{
|
||||
persent.text = str;
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 328 KiB After Width: | Height: | Size: 366 KiB |
Before Width: | Height: | Size: 518 KiB After Width: | Height: | Size: 402 KiB |
Before Width: | Height: | Size: 210 KiB After Width: | Height: | Size: 157 KiB |
Before Width: | Height: | Size: 455 KiB After Width: | Height: | Size: 421 KiB |
Before Width: | Height: | Size: 408 KiB After Width: | Height: | Size: 261 KiB |