I am trying to export my Unity project to Android Studio so that I can create some Android buttons that "controls" the Unity app's behavior. I know what I have to do in order to let it access through Java, but I don't know how to change the color. I watched a video about on Youtube, and the guy used: gameObject.renderer.material.color
. However, when I try to do the same it can't find material.
This is my script so far:
using UnityEngine;
using System.Collections;
public class ChangeColor : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void ReceiveRotDir(string message)
{
if (string.Equals(message, "G"))
{
this.gameObject.renderer.m ///It can't find material
}
else if (string.Equals(message, "P"))
{
}
else if (string.Equals(message, "B"))
{
}
}
}