using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CubeScript : MonoBehaviour {
Transform t;
MeshRenderer mr;
// Use this for initialization
void Start () {
t = GetComponent<Transform> ();
mr = GetComponent<MeshRenderer> ();
Debug.Log (t.position);
mr.material.color = Color.black;
System.Type type = mr.GetType ();
t.Translate (new Vector3 (0, 0, 3));
}
// Update is called once per frame
void Update () {
t.Translate (new Vector3 (0, 0, 3)*Time.deltaTime,Space.Self);
t.Rotate (new Vector3 (0, 30, 0) * Time.deltaTime);
}
}
using System.Collections.Generic;
using UnityEngine;
public class CubeScript : MonoBehaviour {
Transform t;
MeshRenderer mr;
// Use this for initialization
void Start () {
t = GetComponent<Transform> ();
mr = GetComponent<MeshRenderer> ();
Debug.Log (t.position);
mr.material.color = Color.black;
System.Type type = mr.GetType ();
t.Translate (new Vector3 (0, 0, 3));
}
// Update is called once per frame
void Update () {
t.Translate (new Vector3 (0, 0, 3)*Time.deltaTime,Space.Self);
t.Rotate (new Vector3 (0, 30, 0) * Time.deltaTime);
}
}