public async Task <int> UpdateFunctionalObject(FunctionalObject functionalObject) { var queryParameters = new DynamicParameters(); queryParameters.Add("@FunctionalObjectId", functionalObject.Id); queryParameters.Add("@FunctionalObjectName", functionalObject.Name); queryParameters.Add("@ListObjects", ToArrayTVP(functionalObject.Tables)); await ExecuteNonQueryAsync(StoredProcedureNames.UpdateFunctionalObject, queryParameters, true); return(functionalObject.Id); }
public async Task <int> CreateFunctionalObject(FunctionalObject functionalObject) { var queryParameters = new DynamicParameters(); queryParameters.Add("@FunctionalObjectName", functionalObject.Name); queryParameters.Add("@ListObjects", ToArrayTVP(functionalObject.Tables)); queryParameters.Add("@FunctionalObjectId", dbType: DbType.Int32, direction: ParameterDirection.Output); await ExecuteNonQueryAsync(StoredProcedureNames.CreateFunctionalObject, queryParameters, true); int functionalObjectId = queryParameters.Get <int>("@FunctionalObjectId"); return(functionalObjectId); }
//drops the current item void dropItem() { //if two nodes are in focus, connect them if (curNode != null) { Node.connectNodes(curNode, curOtherNode); } curNode = null; curOtherNode = null; curBody.useGravity = true; curBody = null; curObject = null; fo = null; }
//attempts to pick up an item straigth ahead void pickupItem() { RaycastHit hitInfo; Physics.Raycast(transform.position, transform.forward, out hitInfo, 5f); curBody = hitInfo.rigidbody; curBody.useGravity = false; curObject = hitInfo.rigidbody.gameObject; //targetRot = Quaternion.Euler(transform.rotation.eulerAngles - curObject.transform.rotation.eulerAngles);//curBody.rotation * Quaternion.Inverse(transform.rotation); //WHAT A HACK!! //I am completely confused why my attempted mathematical implementation of this failed //TODO: fix this, although not top priority //my guess is that it will never get fixed ever, today's date is 7/28/16 curObject.transform.parent = transform; relRot = curObject.transform.localRotation; curObject.transform.parent = null; fo = curObject.GetComponent <FunctionalObject>(); //curBody.drag = 100; }