private Dice RandDice() { GameObject diceObject = dicePool.GetChild(); Dice dice = diceObject.GetComponent <Dice>(); dice.SetDiceStatus(deck[Random.Range(0, deck.Count)]); DiceSlot diceSlot = emptyDiceSlots[Random.Range(0, emptyDiceSlots.Count)]; emptyDiceSlots.Remove(diceSlot); pullDiceSlots.Add(diceSlot); diceSlot.SetDice(dice); return(dice); }
public void SynthesisDice(GameObject from, GameObject to) { Debug.Log("합성" + from.name + to.name); DiceSlot fromSlot = from.GetComponentInParent <DiceSlot>(); DiceSlot toSlot = to.GetComponentInParent <DiceSlot>(); Debug.Log(fromSlot.name); Debug.Log(toSlot.name); fromSlot.Clear(); emptyDiceSlots.Add(fromSlot); pullDiceSlots.Remove(fromSlot); //빈 공간 관리 toSlot.dice.diceEye++;//목표 다이스 눈 증가 toSlot.dice.SetDiceStatus(deck[Random.Range(0, deck.Count)]); }