Пример #1
0
 public bool CompatibleWithOtherExtreme(NailScript otherExtreme)
 {
     if (otherExtreme.thisNailRole != thisNailRole && otherExtreme.parentWindow.assignedMemberID != parentWindow.assignedMemberID)
     {
         //Debug.Log(otherExtreme.parentWindow.assignedMember.sex.ToString());
         if (thisNailRole == Role.Offspring && otherExtreme.CompatibleWithOtherExtreme(this))
         {
             return(true);
         }
         if (thisNailRole == Role.Father && FamilyManager.instance.GetMemberByID(otherExtreme.parentWindow.assignedMemberID).sex == Gender.Male)
         {
             return(true);
         }
         else if (thisNailRole == Role.Mother && FamilyManager.instance.GetMemberByID(otherExtreme.parentWindow.assignedMemberID).sex == Gender.Female)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         Debug.Log("That doesn't make any sense - " + otherExtreme.thisNailRole.ToString() + " _ " + thisNailRole.ToString());
         return(false);
     }
 }
Пример #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();
    }