0.3.2.15
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 93be6597eb9d77e47a12d5c2d57241dd
|
guid: 67af4a65b1f578b4b9fa609cd12df71b
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using BlueWater.Interfaces;
|
using BlueWater.Interfaces;
|
||||||
using Sirenix.OdinInspector;
|
using Sirenix.OdinInspector;
|
||||||
|
using Sirenix.Utilities;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace BlueWater.Items
|
namespace BlueWater.Items
|
||||||
@ -56,6 +57,7 @@ namespace BlueWater.Items
|
|||||||
[field: SerializeField]
|
[field: SerializeField]
|
||||||
public List<CocktailIngredient> ValidIngredients { get; set; } = new(5);
|
public List<CocktailIngredient> ValidIngredients { get; set; } = new(5);
|
||||||
|
|
||||||
|
//해당 칵테일에 포함된 Ratio를 리턴
|
||||||
public List<CocktailIngredient> GetValidIngredients(int liquidMaxAmount)
|
public List<CocktailIngredient> GetValidIngredients(int liquidMaxAmount)
|
||||||
{
|
{
|
||||||
var ingredients = new List<CocktailIngredient>(5);
|
var ingredients = new List<CocktailIngredient>(5);
|
||||||
@ -68,5 +70,28 @@ namespace BlueWater.Items
|
|||||||
|
|
||||||
return ingredients;
|
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;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace BlueWater.Items
|
namespace BlueWater.Items
|
||||||
@ -6,5 +7,6 @@ namespace BlueWater.Items
|
|||||||
public class LiquidDataSo : DataSo<LiquidData>
|
public class LiquidDataSo : DataSo<LiquidData>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -57,7 +57,7 @@ namespace BlueWater.Items
|
|||||||
{
|
{
|
||||||
return _datas;
|
return _datas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetData(Dictionary<string, T> datas)
|
public void SetData(Dictionary<string, T> datas)
|
||||||
{
|
{
|
||||||
_datas = datas;
|
_datas = datas;
|
||||||
|
@ -29,7 +29,7 @@ namespace BlueWater.Items
|
|||||||
|
|
||||||
[field: SerializeField, Required]
|
[field: SerializeField, Required]
|
||||||
public ItemSlotDataSo ItemSlotDataSo { get; private set; }
|
public ItemSlotDataSo ItemSlotDataSo { get; private set; }
|
||||||
|
|
||||||
[Title("드롭 아이템 설정")]
|
[Title("드롭 아이템 설정")]
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private float _randomDropRadius = 3f;
|
private float _randomDropRadius = 3f;
|
||||||
|
@ -46,7 +46,10 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 0cf23778fd0b2994c9d608fbbf185468, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail002
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail002
|
<Idx>k__BackingField: Cocktail002
|
||||||
@ -63,7 +66,10 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 600806d36167cb140aa40eb51cf58afa, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail003
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail003
|
<Idx>k__BackingField: Cocktail003
|
||||||
@ -80,7 +86,10 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: c55f4b0a55a391d488e54a28dc840509, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail004
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail004
|
<Idx>k__BackingField: Cocktail004
|
||||||
@ -97,7 +106,10 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 576d6ff3856f8ef419586ff12f2742b5, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail005
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail005
|
<Idx>k__BackingField: Cocktail005
|
||||||
@ -114,7 +126,10 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 527440f24542af142a67219f2bcbeec4, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail006
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail006
|
<Idx>k__BackingField: Cocktail006
|
||||||
@ -131,7 +146,13 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 6a4cd8cdf11fe024e8ecac8e3d60e10d, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail007
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail007
|
<Idx>k__BackingField: Cocktail007
|
||||||
@ -148,7 +169,13 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: b38089ff4046ac044ba79dfa5116aa1b, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail008
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail008
|
<Idx>k__BackingField: Cocktail008
|
||||||
@ -165,7 +192,13 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 71954183dfb02424d835d964c2eb3fc6, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail009
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail009
|
<Idx>k__BackingField: Cocktail009
|
||||||
@ -182,7 +215,16 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: d0748411047fc4a41beb1fb8d551e01e, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail010
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail010
|
<Idx>k__BackingField: Cocktail010
|
||||||
@ -199,7 +241,16 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 335f1df58cd58914f97fe9ccae7f6c8c, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail011
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail011
|
<Idx>k__BackingField: Cocktail011
|
||||||
@ -216,7 +267,13 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 600806d36167cb140aa40eb51cf58afa, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail012
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail012
|
<Idx>k__BackingField: Cocktail012
|
||||||
@ -233,7 +290,13 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: ee344f47787d148448bd3373235281b6, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail013
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail013
|
<Idx>k__BackingField: Cocktail013
|
||||||
@ -250,7 +313,13 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: aef7fd596cbfc854d87f408c14951641, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail014
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail014
|
<Idx>k__BackingField: Cocktail014
|
||||||
@ -267,7 +336,13 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 91d99e534e5f3c04094b14ed920bec04, type: 3}
|
<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
|
- <Key>k__BackingField: Cocktail015
|
||||||
<Value>k__BackingField:
|
<Value>k__BackingField:
|
||||||
<Idx>k__BackingField: Cocktail015
|
<Idx>k__BackingField: Cocktail015
|
||||||
@ -284,4 +359,10 @@ MonoBehaviour:
|
|||||||
<IngredientIdx5>k__BackingField:
|
<IngredientIdx5>k__BackingField:
|
||||||
<IngredientRatio5>k__BackingField: 0
|
<IngredientRatio5>k__BackingField: 0
|
||||||
<Sprite>k__BackingField: {fileID: 21300000, guid: 527440f24542af142a67219f2bcbeec4, type: 3}
|
<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,86 +1,35 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using BlueWater;
|
using BlueWater;
|
||||||
using BlueWater.Items;
|
using BlueWater.Items;
|
||||||
using BlueWater.Tycoons;
|
using BlueWater.Tycoons;
|
||||||
using BlueWater.Uis;
|
using BlueWater.Uis;
|
||||||
using ExcelDataReader.Log;
|
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using Unity.VisualScripting;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.Serialization;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using Sirenix.OdinInspector;
|
|
||||||
using Spine;
|
|
||||||
using UnityEngine.Android;
|
|
||||||
|
|
||||||
public class ManualBook : SwitchActionPopupUi
|
public class ManualBook : SwitchActionPopupUi
|
||||||
{
|
{
|
||||||
private Image _cocktailImage;
|
[field: SerializeField]
|
||||||
private TextMeshProUGUI _cocktailName;
|
private Image cocktailImage;
|
||||||
private GameObject _ingredientSlot1;
|
[field: SerializeField]
|
||||||
private GameObject _ingredientSlot2;
|
private TextMeshProUGUI cocktailName;
|
||||||
private GameObject _ingredientSlot3;
|
|
||||||
|
|
||||||
[field: SerializeField, CLabel("메뉴얼 CockTail Prefab")]
|
[field: SerializeField, CLabel("메뉴얼 CockTail Prefab")]
|
||||||
private ManualCocktailButton _ManualCocktailsPrefabs;
|
private ManualCocktailButton manualCocktailsPrefabs;
|
||||||
|
|
||||||
[field: SerializeField, CLabel("리큐르A 이미지")]
|
[field: SerializeField]
|
||||||
private Sprite LiquidA_Sprite;
|
private ManualIngredientSlot slot01;
|
||||||
[field: SerializeField, CLabel("리큐르B 이미지")]
|
[field: SerializeField]
|
||||||
private Sprite LiquidB_Sprite;
|
private ManualIngredientSlot slot02;
|
||||||
[field: SerializeField, CLabel("리큐르C 이미지")]
|
[field: SerializeField]
|
||||||
private Sprite LiquidC_Sprite;
|
private ManualIngredientSlot slot03;
|
||||||
[field: SerializeField, CLabel("리큐르D 이미지")]
|
[field: SerializeField]
|
||||||
private Sprite LiquidD_Sprite;
|
private TextMeshProUGUI ratioRange;
|
||||||
[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
|
List<ManualCocktailButton> _button = new List<ManualCocktailButton>();
|
||||||
{
|
|
||||||
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 void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
EventManager.OnLevelUp += UpdateManualBook;
|
EventManager.OnLevelUp += UpdateManualBook;
|
||||||
@ -89,18 +38,6 @@ public class ManualBook : SwitchActionPopupUi
|
|||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
var book = transform.Find("Book");
|
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 _ingredientSlot1Image;
|
||||||
// private Image _ingredientSlot2Image;
|
// private Image _ingredientSlot2Image;
|
||||||
@ -111,40 +48,36 @@ public class ManualBook : SwitchActionPopupUi
|
|||||||
{
|
{
|
||||||
if (element.Idx.Equals("Cocktail000")) continue; //쓰레기는 메뉴얼에 표시하지 않기
|
if (element.Idx.Equals("Cocktail000")) continue; //쓰레기는 메뉴얼에 표시하지 않기
|
||||||
|
|
||||||
var cocktail = Instantiate(_ManualCocktailsPrefabs, book.Find("CocktailButtons"));
|
var cocktail = Instantiate(manualCocktailsPrefabs, book.Find("CocktailButtons"));
|
||||||
cocktail.Initialize(this);
|
cocktail.Initialize(this);
|
||||||
cocktail.name = element.Idx;
|
cocktail.name = element.Idx;
|
||||||
cocktail.transform.Find("Image").GetComponent<Image>().sprite = element.Sprite;
|
cocktail.transform.Find("Image").GetComponent<Image>().sprite = element.Sprite;
|
||||||
|
_button.Add(cocktail);
|
||||||
var createCocktailMenu = new CocktailsBtn(element ,cocktail.gameObject ,element.Idx,element.Name);
|
|
||||||
|
|
||||||
foreach (var element2 in element.ValidIngredients) //들어가는 리큐르, 가니쉬 종류
|
foreach (var element2 in element.ValidIngredients) //들어가는 리큐르, 가니쉬 종류
|
||||||
{
|
{
|
||||||
if (element2.Idx.Equals("LiquidA")) {createCocktailMenu.LiquidA = element2.Ratio; createCocktailMenu.Sibling -= 1; };
|
if (element2.Idx.Equals("LiquidA")) { var scale = cocktail.transform.localScale; scale.z += 1; cocktail.transform.localScale = scale; };
|
||||||
if (element2.Idx.Equals("LiquidB")) {createCocktailMenu.LiquidB = element2.Amount; createCocktailMenu.Sibling -= 2; };
|
if (element2.Idx.Equals("LiquidB")) { var scale = cocktail.transform.localScale; scale.z += 2; cocktail.transform.localScale = scale; };
|
||||||
if (element2.Idx.Equals("LiquidC")) {createCocktailMenu.LiquidC = element2.Amount; createCocktailMenu.Sibling -= 4; };
|
if (element2.Idx.Equals("LiquidC")) { var scale = cocktail.transform.localScale; scale.z += 4; cocktail.transform.localScale = scale; };
|
||||||
if (element2.Idx.Equals("LiquidD")) {createCocktailMenu.LiquidD = element2.Amount; createCocktailMenu.Sibling -= 8; };
|
if (element2.Idx.Equals("LiquidD")) { var scale = cocktail.transform.localScale; scale.z += 8; cocktail.transform.localScale = scale; };
|
||||||
if (element2.Idx.Equals("LiquidE")) {createCocktailMenu.LiquidE = element2.Amount; createCocktailMenu.Sibling -= 16; };
|
if (element2.Idx.Equals("LiquidE")) { var scale = cocktail.transform.localScale; scale.z += 16; cocktail.transform.localScale = scale; };
|
||||||
if (element2.Idx.Equals("Garnish1")) {createCocktailMenu.Garnish1 = element2.Amount; createCocktailMenu.Sibling -= 32; };
|
if (element2.Idx.Equals("Garnish1")) { var scale = cocktail.transform.localScale; scale.z += 32; cocktail.transform.localScale = scale; };
|
||||||
if (element2.Idx.Equals("Garnish2")) {createCocktailMenu.Garnish2 = element2.Amount; createCocktailMenu.Sibling -= 64; };
|
if (element2.Idx.Equals("Garnish2")) { var scale = cocktail.transform.localScale; scale.z += 64; cocktail.transform.localScale = scale; };
|
||||||
}
|
}
|
||||||
|
|
||||||
_cocktailsBtn.Add(element.Idx,createCocktailMenu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var sortedCocktails = _cocktailsBtn.OrderByDescending(element => element.Value.Sibling);
|
|
||||||
|
|
||||||
int index = 0;
|
_button = _button.OrderBy(c => c.transform.localScale.z).ToList();
|
||||||
foreach (var element in sortedCocktails)
|
|
||||||
|
for (int i = 0; i < _button.Count; i++)
|
||||||
{
|
{
|
||||||
element.Value.CockTailButton.transform.SetSiblingIndex(index);
|
_button[i].transform.SetSiblingIndex(i);
|
||||||
index++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Update_Cocktails();
|
|
||||||
SelectedItem(_cocktailsBtn["Cocktail001"].CockTailButton.GetComponent<Button>());
|
|
||||||
|
|
||||||
|
Update_Cocktails();
|
||||||
|
SelectedItem(_button[0]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override void Open(List<PopupUi> popupUiList)
|
public override void Open(List<PopupUi> popupUiList)
|
||||||
{
|
{
|
||||||
@ -158,20 +91,21 @@ public class ManualBook : SwitchActionPopupUi
|
|||||||
VisualFeedbackManager.Instance.ResetTimeScale();
|
VisualFeedbackManager.Instance.ResetTimeScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update_Cocktails()
|
private void Update_Cocktails() //해금된 칵테일의 활성 표시 유무
|
||||||
{
|
{
|
||||||
int playerLv = TycoonManager.Instance.TycoonStatus.CurrentLevel;
|
int playerLv = TycoonManager.Instance.TycoonStatus.CurrentLevel;
|
||||||
|
|
||||||
bool check = false;
|
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;
|
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("LiquidA")) {};
|
||||||
if (element2.Idx.Equals("LiquidB") && playerLv < 5) { check = true; break; }
|
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("LiquidE") && playerLv < 20) { check = true; break; }
|
||||||
if (element2.Idx.Equals("Garnish1") && playerLv < 25) { check = true; break; }
|
if (element2.Idx.Equals("Garnish1") && playerLv < 25) { check = true; break; }
|
||||||
if (element2.Idx.Equals("Garnish2") && playerLv < 30) { check = true; break; }
|
if (element2.Idx.Equals("Garnish2") && playerLv < 30) { check = true; break; }
|
||||||
|
//해금될때 어느 리퀴르랑 가니쉬가 해금되었는지 확인 불가능 하기 때문에 일단 수기로 작성...
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!check)
|
if (!check)
|
||||||
{
|
{
|
||||||
element.CockTailButton.transform.Find("Image").GetComponent<Image>().material = null;
|
element.transform.Find("Image").GetComponent<Image>().material = null;
|
||||||
element.Enable = true;
|
|
||||||
|
|
||||||
_cocktailsBtn[key] = element;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SelectedItem(Button clickedButton)
|
public void SelectedItem(ManualCocktailButton clickedButton)
|
||||||
{
|
{
|
||||||
Debug.Log(clickedButton.transform.GetSiblingIndex());
|
//if (clickedButton.GetComponent<Image>().material == null) //활성화 된 음료만 클릭이 되도록 한다.
|
||||||
|
if (true) // 테스트용
|
||||||
if (_cocktailsBtn[clickedButton.name].Enable) //활성화 된 음료만 클릭이 되도록 한다.
|
|
||||||
{
|
{
|
||||||
_cocktailImage.sprite = clickedButton.transform.Find("Image").GetComponent<Image>().sprite;
|
bool checkSlot1 = false;
|
||||||
|
bool checkSlot2 = false;
|
||||||
|
bool checkSlot3 = false;
|
||||||
|
|
||||||
bool slot1 = false;
|
var cocktailDatas = ItemManager.Instance.CocktailDataSo.GetData();
|
||||||
bool slot2 = false;
|
var liquidDatas = ItemManager.Instance.LiquidDataSo.GetData();
|
||||||
bool slot3 = false;
|
|
||||||
|
|
||||||
GameObject slot()
|
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)
|
||||||
{
|
{
|
||||||
if (!slot1)
|
int targetSlotNumF = 0;
|
||||||
|
|
||||||
|
if (targetSlotNum != 0)
|
||||||
{
|
{
|
||||||
slot1 = true;
|
if (targetSlotNum == 1) {targetSlotNumF = 1; checkSlot1 = true;}
|
||||||
return _ingredientSlot1;
|
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; }
|
||||||
|
|
||||||
if (!slot2)
|
ManualIngredientSlot targetSlotF = null;
|
||||||
{
|
if (targetSlotNumF == 1) targetSlotF = slot01;
|
||||||
slot2 = true;
|
else if (targetSlotNumF == 2) targetSlotF = slot02;
|
||||||
return _ingredientSlot2;
|
else if (targetSlotNumF == 3) targetSlotF = slot03;
|
||||||
}
|
|
||||||
|
|
||||||
if (!slot3)
|
if (targetSlotF == null) return;
|
||||||
{
|
|
||||||
slot3 = true;
|
targetSlotF.SetImage(liquidDatas[ingredientName].Sprite);
|
||||||
return _ingredientSlot3;
|
targetSlotF.SetType(ingredientName);
|
||||||
}
|
targetSlotF.SetPersent($"{cocktailDatas[clickedButton.name].GetIngredientRatio(ingredientName)}%");
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//가니쉬 배치를 처음으로... 일단 대기...
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
if (cocktailDatas[clickedButton.name].SearchIngredient("Garnish1") != 0)
|
||||||
|
{
|
||||||
|
Setslot("Garnish1",3);
|
||||||
|
}
|
||||||
|
else if (cocktailDatas[clickedButton.name].SearchIngredient("Garnish2") != 0)
|
||||||
|
{
|
||||||
|
Setslot("Garnish2",3);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//가니쉬 배치를 처음으로...
|
foreach (var element in liquidDatas)
|
||||||
if (_cocktailsBtn[clickedButton.name].Garnish1 != 0)
|
|
||||||
{
|
{
|
||||||
_ingredientSlot3.transform.Find("IngredientType").GetComponent<TextMeshProUGUI>().text = "Garnish1";
|
if(cocktailDatas[clickedButton.name].SearchIngredient(element.Value.Idx) != 0) Setslot(element.Value.Idx);
|
||||||
_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()
|
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 |