Atom _person;
public override void Init()
{
try {
_person = SuperController.singleton.GetSelectedAtom();
if (_person.category != "People")
{
SuperController.LogError("SallyHairInvert must be on a Person atom.");
return;
}
List<DAZHairGroup> DAZHairGroups = new List<DAZHairGroup>();
foreach (DAZHairGroup hairGroup in _person.GetComponentsInChildren<DAZHairGroup>())
{
SuperController.LogMessage("SallyHairInvert DAZHairGroup: " + hairGroup.name + " scale.x: " + hairGroup.transform.localScale.x);
Vector3 scale = hairGroup.transform.localScale;
//scale.x *= -1f;
scale = new Vector3(2f, 1f, 1f);
hairGroup.transform.localScale.Set(scale.x, scale.y, scale.z);
SuperController.LogMessage("inverted scale.x: " + hairGroup.transform.localScale.x);
}
JSONStorableBool jbool = new JSONStorableBool("INVERT HAIR", false);
UIDynamicToggle dToggleInvertHair = CreateToggle(jbool, false);
//jbool.setCallbackFunction += ToggleInvertHair;
}
catch (Exception e) {SuperController.LogError("Exception caught: " + e);}
}