Skip to content

Commit

Permalink
valueFinetuning
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLissandra1 committed Apr 12, 2023
1 parent 0056138 commit 640a619
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Assets/Scripts/ValueTransfer.cs
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);
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/ValueTransfer.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 640a619

Please sign in to comment.