Quantum-Engineering/ModMachine.cs

27 lines
822 B
C#
Raw Normal View History

2020-09-13 02:45:50 -04:00
using UnityEngine;
public class ModMachine : BasicMachine
{
private Material material;
public string machineName;
// Called by unity engine on start up to initialize variables
public new void Start()
{
base.Start();
material = new Material(Shader.Find("Standard"));
}
// Called once per frame by unity engine
public new void Update()
{
base.Update();
Debug.Log("Machine name: " + machineName);
material.mainTexture = GameObject.Find("Player").GetComponent<TextureDictionary>().dictionary[machineName];
GetComponent<Renderer>().material = material;
if (recipes == null)
{
recipes = GameObject.Find("Player").GetComponent<BuildController>().blockDictionary.GetMachineRecipes(machineName);
}
}
}