Exemple #1
0
    public void CancelPinning()
    {
        if (currentLine != null && (currentLine.pointA == null || currentLine.pointB == null))
        {
            currentLine.DeleteLine();
        }

        currentStatus = pinInteractionStatus.None;
        cancelButton.gameObject.SetActive(false);
    }
Exemple #2
0
    public void PinInteraction(NailScript pin)
    {
        if (!UI_Manager.editingInformation)
        {
            //if (currentInteraction == interactionMode.Tying)
            //{
            if (currentStatus == pinInteractionStatus.None)
            {
                currentStatus = pinInteractionStatus.Dragging;
                currentLine   = Instantiate(lineObject, this.transform).GetComponent <LineScript>();

                currentLine.SetA(pin);

                currentLine.SetReady();

                cancelButton.gameObject.SetActive(true);
            }
            else if (currentStatus == pinInteractionStatus.Dragging)
            {
                if (pin.CompatibleWithOtherExtreme(currentLine.pointA))
                {
                    currentStatus = pinInteractionStatus.None;

                    if (currentLine != null)
                    {
                        currentLine.SetB(pin);
                    }

                    cancelButton.gameObject.SetActive(false);
                }
            }
            //}
            //else
            //{
            //    pin.DeleteAllTies();
            //}
        }

        FamilyManager.instance.formulary.CloseFormulary();
    }