using UnityEngine; public class Createkick : MonoBehaviour { public static GameObject Mcx(string Name, float sx, float sy, float sz, float px, float py, float pz, float rx, float ry, float rz, string texcode) { //print("texcode===="+texcode);//K_01?1?90 GameObject obj = GameObject.CreatePrimitive(PrimitiveType.Cube); obj.GetComponent().enabled = false; obj.transform.localScale = new Vector3(sx, sy, sz); obj.transform.position = new Vector3(px, py, pz); obj.transform.rotation = Quaternion.Euler(rx, ry, rz); string texname = texcode.Split('?')[1]; string Rs = texcode.Split('?')[2]; if(Rs!="0" && Rs!="90" ){Rs="90";} Material mat; mat=UIT_MATERIAL.GetMaterial(texname+"?"+Rs); obj.GetComponent().material = mat; obj.GetComponent().material.SetFloat("_rotation",float.Parse(Rs)); obj.GetComponent().material.SetFloat("_Metallic", 0.0f); // obj.GetComponent().probeAnchor = GameObject.Find("Reflection Probe").transform; obj.name=Name; return obj; } }