void CheckIsValidPosition(Vector3 hitposition, MOUSECLICKTYPE type) { List <GridNode> selectingNodeList = null; if (CurrentSelectedBuilding != null) { Vector3 postion = gridSystemInstance.CheckValidPosition(hitposition, CurrentSelectedBuilding.info.gridSize, out selectingNodeList); CurrentSelectedBuilding.SetBuildingStateSelected(postion, selectingNodeList, type); } }
public void SetBuildingStateSelected(Vector3 position, List <GridNode> filledValidNodes, MOUSECLICKTYPE type) { Debug.Log("position:" + position); if (position != (Vector3.zero * -1.0f)) { transform.position = position; } if (filledNodes == null && filledValidNodes != null && type == MOUSECLICKTYPE.MOUSEUP) { filledNodes = filledValidNodes; validPosition = position; } else if (filledNodes != null) { if (type == MOUSECLICKTYPE.MOUSEUP) { if (filledValidNodes != null) { SetFilledGrids(false); filledNodes = filledValidNodes; validPosition = position; } } else if (type == MOUSECLICKTYPE.MOUSEDOWN || type == MOUSECLICKTYPE.MOUSEDRAG) { SetFilledGrids(false); } } SetMarker(filledValidNodes != null); SetSelectedBuilding(type != MOUSECLICKTYPE.MOUSEUP); }