-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0056138
commit 640a619
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
public class ValueTransfer : MonoBehaviour | ||
{ | ||
public string theValue; | ||
public GameObject inputFieldSpring; | ||
public GameObject textDisplaySpring; | ||
public GameObject inputFieldPlastic; | ||
public GameObject textDisplayPlastic; | ||
public GameObject inputFieldDampingForce; | ||
public GameObject textDisplayDampingForce; | ||
|
||
public ClothPhysics.Cloth clothObj; | ||
public void StoreSpringValue() | ||
{ | ||
theValue = inputFieldSpring.GetComponent<Text>().text; | ||
textDisplaySpring.GetComponent<Text>().text = theValue; | ||
|
||
clothObj.springCoefficient = float.Parse(theValue); | ||
print("Cloth springCoefficient: "); | ||
print(clothObj.springCoefficient); | ||
} | ||
|
||
public void StorePlasticityValue() | ||
{ | ||
theValue = inputFieldPlastic.GetComponent<Text>().text; | ||
textDisplayPlastic.GetComponent<Text>().text = theValue; | ||
|
||
clothObj.plasticity = float.Parse(theValue); | ||
print("Cloth plasticity: "); | ||
print(clothObj.plasticity); | ||
} | ||
public void StoreDampingForceValue() | ||
{ | ||
theValue = inputFieldDampingForce.GetComponent<Text>().text; | ||
textDisplayDampingForce.GetComponent<Text>().text = theValue; | ||
|
||
clothObj.dampingCoefficient = float.Parse(theValue); | ||
print("Cloth damping force Coefficient: "); | ||
print(clothObj.dampingCoefficient); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.