예제 #1
0
    public void DragCreate()
    {
        FarmRoot instance = FarmRoot.Instance;

        if (null == instance)
        {
            global::Debug.LogError("FarmRoot Not Found");
            return;
        }
        if (0 >= this.farmObjects.Count)
        {
            global::Debug.LogError("0 == this.farmObjects.Count");
            return;
        }
        instance.ClearSettingFarmObject();
        FarmObject           farmObject          = this.farmObjects[0];
        Camera               componentInChildren = instance.GetComponentInChildren <Camera>();
        Vector3              vector            = componentInChildren.ScreenToWorldPoint(Input.mousePosition);
        FarmEditFacilityList componentInParent = base.GetComponentInParent <FarmEditFacilityList>();

        if (!componentInParent.StartSettingAndDragState(farmObject, vector))
        {
            vector = componentInChildren.ScreenToWorldPoint(Input.mousePosition);
            farmObject.transform.position = vector;
        }
        GUIManager.ResetTouchingCount();
    }
예제 #2
0
    private void OnPushed()
    {
        FarmRoot instance = FarmRoot.Instance;

        if (null == instance)
        {
            global::Debug.LogError("FarmRoot Not Found");
            return;
        }
        if (0 >= this.farmObjects.Count)
        {
            global::Debug.LogError("0 == this.farmObjects.Count");
            return;
        }
        instance.ClearSettingFarmObject();
        FarmObject           farmObject        = this.farmObjects[0];
        FarmEditFacilityList componentInParent = base.GetComponentInParent <FarmEditFacilityList>();

        componentInParent.StartSetting(farmObject);
    }