예제 #1
0
 void OnTriggerExit(Collider other)
 {
     Debug.Log("Hello");
     DoorPivot.SetBool("OpenDoor", false);
     if (!DestinationObject.GetDraggedItem().activeSelf)
     {
         DoorPivot.SetBool("OpenDoor", false);
     }
 }
예제 #2
0
    void HandleWetClothes()
    {
        string destination = DestinationObject.GetWetClothesDestination();

        if (destination == "Dryer")
        {
            Decisions.AddChoice("Dryer");
        }
        else if (destination == "Clothesline")
        {
            Decisions.AddChoice("Clothesline");
        }
    }
예제 #3
0
    void OnMouseDown()

    {
        DestinationObject.SetItem(this.gameObject);

        mZCoord = Camera.main.WorldToScreenPoint(

            gameObject.transform.position).z;


        // Store offset = gameobject world pos - mouse world pos

        mOffset = gameObject.transform.position - GetMouseAsWorldPoint();
    }
예제 #4
0
    void OnMouseUp()
    {
        if (DestinationObject.GetIsAdding() == true)
        {
            if (this.gameObject.name == "WetClothes")
            {
                HandleWetClothes();
            }
            else if (this.gameObject.name == "Clothes")
            {
                this.gameObject.SetActive(false);
                Tasks.ShowNextTask();
                return;
            }
            else
            {
                Decisions.AddChoice(DestinationObject.GetDraggedItem().name);
            }
            this.gameObject.SetActive(false);
            Tasks.ShowNextTask();
        }

        Tasks.SetIsAnimationFinished(false);
    }
예제 #5
0
        private void ValidateProperty()
        {
            if (_propertyInfo == null)
            {
                throw new FluentBuilderException(string.Format("Property \"{0}\" not found - Object \"{1}\"", MemberName, DestinationObject.GetType()));
            }

            if (!_propertyInfo.CanWrite)
            {
                throw new FluentBuilderException(string.Format("Property \"{0}\" must have a setter - Object \"{1}\"", MemberName, DestinationObject.GetType()));
            }

            if (!_propertyInfo.PropertyType.IsAssignableFrom(MemberNewValue.GetType()))
            {
                var messageBuilder = new StringBuilder();
                messageBuilder.AppendFormat("Value must be of the same type of the property \"{0}\" - Object \"{1}\"\n", MemberName, DestinationObject.GetType());
                messageBuilder.AppendFormat("Informed type: {0}\n", MemberNewValue.GetType());
                messageBuilder.AppendFormat("Property type: {0}", _propertyInfo.PropertyType);
                throw new FluentBuilderException(messageBuilder.ToString());
            }
        }
예제 #6
0
 public static void Test(SourceObject source, DestinationObject destination, object mapper, object context)
 {
     destination = destination ?? new DestinationObject();
 }
예제 #7
0
 public static void ConvertLambda(SourceObject source, DestinationObject destination)
 {
     destination.Destination = Lambda();
 }
예제 #8
0
 public static void Convert(SourceObject source, DestinationObject destination)
 {
     destination.Destination = source.Source;
 }
예제 #9
0
    public static GameObject GetCurrentObject()
    {
        DestinationObject destination = new DestinationObject();

        return(destination.currentObject);
    }
예제 #10
0
        private void ValidateField()
        {
            if (_fieldInfo == null)
            {
                throw new FluentBuilderException(string.Format("Field \"{0}\" not found - Object \"{1}\"", MemberName, DestinationObject.GetType()));
            }

            if (!_fieldInfo.FieldType.IsInstanceOfTypeBase(MemberNewValue))
            {
                var messageBuilder = new StringBuilder();
                messageBuilder.AppendFormat("Value must be of the same type of the field \"{0}\" - Object \"{1}\"\n", MemberName, DestinationObject.GetType());
                messageBuilder.AppendFormat("Informed type: {0}\n", MemberNewValue.GetType());
                messageBuilder.AppendFormat("Field type: {0}", _fieldInfo.FieldType);
                throw new FluentBuilderException(messageBuilder.ToString());
            }
        }