public void SendArrowAction(GameObject first, GameObject second, PointAbleOption pointType) { if (pointType == PointAbleOption.Card && !second.CompareTag(first.tag)) { var c1 = first.GetComponent <CardModel>().GetCard; var c2 = second.GetComponent <CardModel>().GetCard; Debug.Log("Can attack: " + CardLogic.CanAttack(c1, c2)); } }
public void OnDropHandler(GameObject eventObject, PointAbleOption type) { if (startPoint == eventObject) { return; } endPoint = eventObject; endPointType = type; }
public void OnPointerExitHandler(GameObject eventObject) { if (startPoint == eventObject) { return; } if (startPointType == endPointType) { Debug.Log(eventObject.name + " exited"); // endPoint.GetComponent<VisualPlatform>().ChangeZoneColor(Color.green); } endPoint = null; endPointType = PointAbleOption.Null; }
public void OnPointerEnterHandler(GameObject eventObject, PointAbleOption type) { if (startPoint == eventObject) { return; } endPoint = eventObject; endPointType = type; if (startPointType == endPointType) { Debug.Log(eventObject.name + " entered"); // endPoint.GetComponent<VisualPlatform>().ChangeZoneColor(Color.red); } }
public void EndPoint() { if (startPoint && endPoint && startPointType == endPointType) { Debug.Log("start = " + startPoint.name); Debug.Log("end = " + endPoint.name); Debug.Log("type = " + startPointType); GameController.Instance.SendArrowAction(startPoint, endPoint, startPointType); } startPoint = null; endPoint = null; startPointType = PointAbleOption.Null; endPointType = PointAbleOption.Null; }
public void StartPoint(GameObject eventObject, PointAbleOption type) { //remember on which platform the drag begins startPoint = eventObject; startPointType = type; }