Browse Source

Added humpty dumpty scale

master
Joshua Reason 4 years ago
parent
commit
0812cae8f9
4 changed files with 55 additions and 0 deletions
  1. +16
    -0
      Assets/Scripts/HumptyDumptyFollow.cs
  2. +11
    -0
      Assets/Scripts/HumptyDumptyFollow.cs.meta
  3. +17
    -0
      Assets/Scripts/SetHorseMat.cs
  4. +11
    -0
      Assets/Scripts/SetHorseMat.cs.meta

+ 16
- 0
Assets/Scripts/HumptyDumptyFollow.cs View File

@ -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;
}
}

+ 11
- 0
Assets/Scripts/HumptyDumptyFollow.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 48503f69a7f0ea9458ae404e5b00ffd9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

+ 17
- 0
Assets/Scripts/SetHorseMat.cs View File

@ -0,0 +1,17 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SetHorseMat : MonoBehaviour
{
public List<Material> allMats;
// Start is called before the first frame update
void Start()
{
int randomIndex = Random.Range(0, allMats.Count - 1);
Debug.Log("RandomIndex: " + randomIndex);
GetComponentInChildren<Renderer>().material = allMats[randomIndex];
}
}

+ 11
- 0
Assets/Scripts/SetHorseMat.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c16c4586273f9b84e97fcbbb885db687
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save