using System.Collections; using System.Collections.Generic; using UnityEngine; public class LEGS : MonoBehaviour { public static void Standard(GameObject B,string name,float h,Vector3 P,Vector3 R,Material M){ GameObject Leg = new("Leg"); GameObject L = GameObject.CreatePrimitive(PrimitiveType.Cube); L.transform.localScale = new Vector3(1, h, 1); L.GetComponent().material =M; L.transform.SetParent(Leg.transform); GameObject LB = GameObject.CreatePrimitive(PrimitiveType.Cube); LB.transform.localScale = new Vector3(2, 0.5f, 2); LB.transform.position = new Vector3(0, -h/2+0.25f, 0); LB.GetComponent().material = M; LB.name="Baseleg"; LB.transform.SetParent(Leg.transform); Destroy( LB.GetComponent()); Leg.transform.SetParent(B.transform); Leg.transform.position = new Vector3(P.x, P.y, P.z); Leg.transform.rotation = Quaternion.Euler(R.x, R.y, R.z); Destroy(Leg.GetComponent()); } }