-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Mandelbulb julia set - code cleanup & bugfixes
- Loading branch information
Showing
29 changed files
with
4,762 additions
and
2,662 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,61 @@ | ||
using TMPro; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
public class O_Slider : MonoBehaviour { | ||
|
||
public App app; | ||
public string optionName; | ||
public float min; | ||
public float max; | ||
public bool wholeNumbers; | ||
|
||
// included in prefab | ||
public Slider slider; | ||
public TMP_InputField inputField; | ||
private bool typing; | ||
//public TextMeshProUGUI value; | ||
private bool ready; | ||
|
||
private void Start() { | ||
slider.maxValue = max; | ||
slider.minValue = min; | ||
slider.wholeNumbers = wholeNumbers; | ||
float value = (float) app.GetOption(optionName); | ||
slider.value = value; | ||
inputField.text = value.ToString(); | ||
|
||
// design stuff | ||
transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = name; | ||
inputField.textComponent.alignment = TextAlignmentOptions.MidlineRight; | ||
ready = true; | ||
} | ||
|
||
private void Update() { | ||
float value = (float) app.GetOption(optionName); | ||
slider.value = value; | ||
if (!typing) { | ||
inputField.text = value.ToString(); | ||
} | ||
} | ||
|
||
public void OnValueChanged(float val) { | ||
if (ready) { | ||
app.SetOption(optionName, val); | ||
} | ||
} | ||
|
||
public void OnEndEdit(string val) { | ||
if (ready) { | ||
app.SetOption(optionName, Mathf.Clamp(float.Parse(val), slider.minValue, slider.maxValue)); | ||
} | ||
} | ||
|
||
public void OnSelect() { | ||
typing = true; | ||
} | ||
|
||
public void OnDeselect() { | ||
typing = false; | ||
} | ||
} |
File renamed without changes.
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
File renamed without changes.
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,52 @@ | ||
using TMPro; | ||
using UnityEngine; | ||
|
||
public class O_Vec3 : MonoBehaviour { | ||
|
||
public App app; | ||
public string optionName; | ||
|
||
// included in prefab | ||
public TMP_InputField inputFieldA; | ||
public TMP_InputField inputFieldB; | ||
public TMP_InputField inputFieldC; | ||
private bool typing; | ||
private bool ready; | ||
|
||
private void Start() { | ||
Vector3 value = (Vector3) app.GetOption(optionName); | ||
inputFieldA.text = value.x.ToString(); | ||
inputFieldB.text = value.y.ToString(); | ||
inputFieldC.text = value.z.ToString(); | ||
|
||
// design stuff | ||
transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = name; | ||
inputFieldA.textComponent.alignment = TextAlignmentOptions.MidlineRight; | ||
inputFieldB.textComponent.alignment = TextAlignmentOptions.MidlineRight; | ||
inputFieldC.textComponent.alignment = TextAlignmentOptions.MidlineRight; | ||
ready = true; | ||
} | ||
|
||
private void Update() { | ||
if (!typing) { | ||
Vector3 value = (Vector3) app.GetOption(optionName); | ||
inputFieldA.text = value.x.ToString(); | ||
inputFieldB.text = value.y.ToString(); | ||
inputFieldC.text = value.z.ToString(); | ||
} | ||
} | ||
|
||
public void OnEndEdit() { | ||
if (ready) { | ||
app.SetOption(optionName, new Vector3(float.Parse(inputFieldA.text), float.Parse(inputFieldB.text), float.Parse(inputFieldC.text))); | ||
} | ||
} | ||
|
||
public void OnSelect() { | ||
typing = true; | ||
} | ||
|
||
public void OnDeselect() { | ||
typing = false; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.