using System.Collections; using System.Collections.Generic; using UnityEngine; public class AddDoorknob : MonoBehaviour { public static GameObject knob() { GameObject K = new(); GameObject S= GameObject.CreatePrimitive(PrimitiveType.Sphere); S.transform.localScale = new Vector3(3, 3, 3); S.transform.position = new Vector3(0, 0, -0.4f); S.transform.SetParent(K.transform); GameObject B = GameObject.CreatePrimitive(PrimitiveType.Cylinder); B.transform.localScale = new Vector3(3, 0.25f,3 ); B.transform.localRotation = Quaternion.Euler(90, 0, 0); B.transform.position = new Vector3(0, 0, 1.5f); B.transform.SetParent(K.transform); S.GetComponent().material = Instantiate(_G.ST);//new Material(Shader.Find("Standard")); S.GetComponent().material.color = Color.grey; B.GetComponent().material = Instantiate(_G.ST);//new Material(Shader.Find("Standard")); B.GetComponent().material.color = Color.grey; K.name = "knob"; return K; } }//end