You need to sign in or sign up before continuing.
Commit f5b446e0 authored by mercury233's avatar mercury233 Committed by Unicorn369

prevent "picking up" dying card in deck builder

parent 35d2e4ab
...@@ -5,6 +5,7 @@ using System; ...@@ -5,6 +5,7 @@ using System;
public class MonoCardInDeckManager : MonoBehaviour { public class MonoCardInDeckManager : MonoBehaviour {
int loadedPicCode = 0; int loadedPicCode = 0;
YGOSharp.Banlist loaded_banlist = null; YGOSharp.Banlist loaded_banlist = null;
public bool dying = false;
bool died = false; bool died = false;
public YGOSharp.Card cardData=new YGOSharp.Card(); public YGOSharp.Card cardData=new YGOSharp.Card();
...@@ -61,6 +62,7 @@ public class MonoCardInDeckManager : MonoBehaviour { ...@@ -61,6 +62,7 @@ public class MonoCardInDeckManager : MonoBehaviour {
} }
else else
{ {
dying = true;
died = true; died = true;
gameObject.SetActive(false); gameObject.SetActive(false);
} }
...@@ -102,6 +104,7 @@ public class MonoCardInDeckManager : MonoBehaviour { ...@@ -102,6 +104,7 @@ public class MonoCardInDeckManager : MonoBehaviour {
Vector3 to_position = getGoodPosition(0); Vector3 to_position = getGoodPosition(0);
Vector3 delta_position = to_position - form_position; Vector3 delta_position = to_position - form_position;
GetComponent<Rigidbody>().AddForce(delta_position * 200); GetComponent<Rigidbody>().AddForce(delta_position * 200);
dying = true;
} }
} }
......
...@@ -1286,7 +1286,8 @@ public class DeckManager : ServantWithCardDescription ...@@ -1286,7 +1286,8 @@ public class DeckManager : ServantWithCardDescription
goLast = gameObject; goLast = gameObject;
timeLastDown = Program.TimePassed(); timeLastDown = Program.TimePassed();
MonoCardInDeckManager MonoCardInDeckManager_ = gameObject.GetComponent<MonoCardInDeckManager>(); MonoCardInDeckManager MonoCardInDeckManager_ = gameObject.GetComponent<MonoCardInDeckManager>();
if (MonoCardInDeckManager_ != null) cardPicLoader cardPicLoader_ = gameObject.GetComponent<cardPicLoader>();
if (MonoCardInDeckManager_ != null && !MonoCardInDeckManager_.dying)
{ {
if (doubleClick && condition == Condition.editDeck && deck.GetCardCount(MonoCardInDeckManager_.cardData.Id) < currentBanlist.GetQuantity(MonoCardInDeckManager_.cardData.Id)) if (doubleClick && condition == Condition.editDeck && deck.GetCardCount(MonoCardInDeckManager_.cardData.Id) < currentBanlist.GetQuantity(MonoCardInDeckManager_.cardData.Id))
{ {
...@@ -1305,11 +1306,9 @@ public class DeckManager : ServantWithCardDescription ...@@ -1305,11 +1306,9 @@ public class DeckManager : ServantWithCardDescription
MonoCardInDeckManager_.beginDrag(); MonoCardInDeckManager_.beginDrag();
} }
} }
else if (cardPicLoader_ != null)
if (condition == Condition.editDeck)
{ {
cardPicLoader cardPicLoader_ = gameObject.GetComponent<cardPicLoader>(); if (condition == Condition.editDeck)
if (cardPicLoader_ != null)
{ {
if (deck.GetCardCount(cardPicLoader_.data.Id) < currentBanlist.GetQuantity(cardPicLoader_.data.Id)) if (deck.GetCardCount(cardPicLoader_.data.Id) < currentBanlist.GetQuantity(cardPicLoader_.data.Id))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment