private void OnMouseUp() { hand = GameObject.Find("CardHand" + PlayerPrefs.GetString("LoginUser", "Unknown")).GetComponent <HandPhoton>(); if (hand.isAvailable) { hand.isAvailable = false; } }
void Update() { if (PhotonNetwork.playerList.Length == 2) { hand = GameObject.Find("CardHand" + PlayerPrefs.GetString("LoginUser", "Unknown")).GetComponent <HandPhoton>(); if (count == 0) { if (hand.isAvailable) { if (!start) { StartCoroutine(yourStep()); } } else { if (!start) { StartCoroutine(enemyStep()); } } count++; } timeRamaining -= Time.deltaTime; time.text = ((int)timeRamaining).ToString(); if ((timeRamaining <= 0) && (hand.isAvailable)) { hand.isAvailable = false; } if (hand.isAvailable) { if (!lastAvailable) { if (!start) { StartCoroutine(yourStep()); } timeRamaining = 60; } lastAvailable = hand.isAvailable; } else { if (lastAvailable) { if (!start) { StartCoroutine(enemyStep()); } timeRamaining = 60; } lastAvailable = hand.isAvailable; } } }
public void OnDrop(PointerEventData eventData) { CardOnBoard card = eventData.pointerDrag.GetComponent <CardOnBoard>(); if (card) { if (card.available) { card.defaultParent = transform; card.gameObject.GetComponent <CardPhoton>().isVisible = true; hand = GameObject.Find("CardHand" + PlayerPrefs.GetString("LoginUser", "Unknown")).GetComponent <HandPhoton>(); if (hand.isAvailable) { hand.isAvailable = false; } } } }