using System.Collections; using System.Collections.Generic; using UnityEngine; public class NoSnailCard : MonoBehaviour { public FactoryItem FactoryItem; // Start is called before the first frame update void Start() { } public async void SnailBindCard(long snailid) { //9.4 bindSlot bindSlot = new bindSlot(); BindSlot Bs=await bindSlot.QueryUserSnailCount(snailid, FactoryItem.id); if (Bs.code == 200) { SnaolHouse.Instance.InitItem(); foreach (var instanceSnail in SnailPanel.Instance.Snails) { if (snailid == instanceSnail.GetComponent().id) { SnailPanel.Instance.Snails.Remove(instanceSnail); Destroy(instanceSnail); } } } else { foreach (var instanceSnail in SnailPanel.Instance.Snails) { if (snailid == instanceSnail.GetComponent().id) { instanceSnail.gameObject.transform.localPosition = new Vector3(0, 0, 0); } } } } void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.name == "Snail(Clone)") { Snailmove sm = other.gameObject.GetComponent(); SnailBindCard(sm.id); } } // Update is called once per frame void Update() { this.transform.localScale = new Vector3(1, 1, 1); } }