private void Awake() { ss = this; WallTile = Resources.Load("02prefab/tile001", typeof(GameObject)) as GameObject; BackTile = Resources.Load("02prefab/tile002", typeof(GameObject)) as GameObject; BM = FindObjectOfType <Blockmanager>(); SetDefault(); // 맵 기본상태로 설정 SetCameraPos(); // 카메라를 맵이 전부 보이게 변경 }
void Start() { BM = FindObjectOfType <Blockmanager>(); }
public void Recieve() { Transform[] childList = GetComponentsInChildren <Transform>(true); if (childList.Length > 1) { for (int i = 0; i < childList.Length; i++) { if (childList[i] != transform) { Destroy(childList[i].gameObject); } } draw.Withdraw(int.Parse(Block_name)); } Dropable Card = GameObject.Find("Deck").GetComponent <Dropable>(); Dropable Block = GameObject.Find("Deck").GetComponent <Dropable>(); card_received = Card.card_to_block;//넘겨 줄때 카드 자체를 넘겨줌!! //Block_name = card_received.GetComponentInChildren<Transform>().Find("Image").GetComponent<Image>().sprite.name; //int인 체력 저항력 받아오는 부분 CardStatus Card_int_info = card_received.GetComponent <CardStatus>(); hp = Card_int_info.GetHP(); resist = Card_int_info.GetResistance(); speed = Card_int_info.GetSpeed(); iType = int.Parse(Card_int_info.GetName()); //string인 카드 이름 받아오는 부분 Block_name = Card_int_info.GetName(); Debug.Log(hp); Debug.Log(resist); Debug.Log(Block_name); //Debug.Log(card_received.GetComponentInChildren<Transform>().Find("CardStrength").GetComponent<Text>().text);//카드를 보냈으니 체력을 받는지 확인!! //Block_name = Block.picture.name; //Debug.Log(Block_name); // MyBlockImg = GetComponent<SpriteRenderer>(); // bMar = GameObject.Find("Blockmanager").GetComponent<Blockmanager>(); Blockmanager temp = GameObject.Find("BlockManager").GetComponent <Blockmanager>(); temp.CreateAdBlock(Block_name); /* * if (Block_name == "A") * { * print("A"); * //Blockmanager.CreateAdBlock(Block_name); * } * if (Block_name == "B") * { * //Blockmanager.CreateAdBlock(a); * } * if (Block_name == "C") * { * print("e"); * } * if (Block_name == "D") * { * print("e"); * } * if (Block_name == "E") * { * print("e"); * }*/ }
void Start() { BM = FindObjectOfType <Blockmanager>(); StartCoroutine(DownCool()); }