public void StopDrag() { answerField = lastField; collidedField.Value = lastField; Debug.Log(answerField); TryEnter(); }
//漢字フィールドから出た時 void OnTriggerExit2D(Collider2D collision) { AnswerField exitAnswerfield = collision.GetComponent <AnswerField>(); if (exitAnswerfield != null && exitAnswerfield == collidedField.Value) { collidedField.Value = null; } }
public void BeginDrag() { if (!answerField) { return; } answerField.RemoveParts(this); lastField = answerField; answerField = null; }
void TryEnter() { if (answerField != null && answerField.IsSettable(this)) { answerField.SetParts(this); //transform.position = (Vector2) Camera.main.WorldToScreenPoint(answerField.transform.position); transform.position = (Vector2)answerField.transform.position; RpcDropOnAnswer(answerField.transform.lossyScale); } else { transform.position = pieceFieldPos; RpcBackStartPos(); } lastField = null; }
public void EndDrag() { answerField = collidedField.Value; TryEnter(); }