public void SetBlockType(Map.BLOCKTYPPE type) { blockobj.m_blockInfo.type = type; //PoolObject.GetComponent<BlockEvent>().type = type; if (type == Map.BLOCKTYPPE.TOP) { if (top == null) { top = Resources.Load <Sprite>(img_top_path); } m_renderer.sprite = top; blockobj.m_blockInfo.DieCount = 2; SetBlockColor(Map.BLOCKCOLOR.NONE, false); } else if (type == Map.BLOCKTYPPE.BLOCK) { if (circle == null) { circle = Resources.Load <Sprite>(img_circle_path); } m_renderer.sprite = circle; } UpdateBlock(); }
public bool MoveTypeCheck(Map.BLOCKTYPPE type) { if (type == Map.BLOCKTYPPE.BLOCK || type == Map.BLOCKTYPPE.TOP ) { return(true); } return(false); }
public void SelectBlock(GameObject go, Map.BLOCKTYPPE type) { if (MoveDisAble || DropAnimaionCount != 0) { return; } if (MoveTypeCheck(type)) { SelectBlockObject = go; SelectBlockIndex = m_MapLoad.GetBlockIndex(go); } else { SelectBlockObject = null; SelectBlockIndex = -1; } }
public void MatchBlock(GameObject go, Map.BLOCKTYPPE type) { if (SelectBlockObject != null && MoveTypeCheck(type)) { if (go != SelectBlockObject) { int index = m_MapLoad.GetBlockIndex(go); if (BlockMoveCheck(SelectBlockIndex, index)) { #if UNITY_EDITOR Debug.Log("Move Able!!!!!!!"); #endif StartCoroutine(SwapBlock(SelectBlockObject, go, SelectBlockIndex, index)); UnSelectBlock(); } } } }