diff --git a/Assets/Scripts/HumptyDumptyFollow.cs b/Assets/Scripts/HumptyDumptyFollow.cs new file mode 100644 index 0000000..530a110 --- /dev/null +++ b/Assets/Scripts/HumptyDumptyFollow.cs @@ -0,0 +1,16 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class HumptyDumptyFollow : MonoBehaviour +{ + public Transform Centre; + public Vector3 Offset; + + + // Update is called once per frame + void Update() + { + transform.position = Centre.position + Offset; + } +} diff --git a/Assets/Scripts/HumptyDumptyFollow.cs.meta b/Assets/Scripts/HumptyDumptyFollow.cs.meta new file mode 100644 index 0000000..d0d89b3 --- /dev/null +++ b/Assets/Scripts/HumptyDumptyFollow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48503f69a7f0ea9458ae404e5b00ffd9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/SetHorseMat.cs b/Assets/Scripts/SetHorseMat.cs new file mode 100644 index 0000000..1bfc4c3 --- /dev/null +++ b/Assets/Scripts/SetHorseMat.cs @@ -0,0 +1,17 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SetHorseMat : MonoBehaviour +{ + public List allMats; + + // Start is called before the first frame update + void Start() + { + int randomIndex = Random.Range(0, allMats.Count - 1); + Debug.Log("RandomIndex: " + randomIndex); + GetComponentInChildren().material = allMats[randomIndex]; + + } +} diff --git a/Assets/Scripts/SetHorseMat.cs.meta b/Assets/Scripts/SetHorseMat.cs.meta new file mode 100644 index 0000000..8b660bf --- /dev/null +++ b/Assets/Scripts/SetHorseMat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c16c4586273f9b84e97fcbbb885db687 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: