public override void OnEnable() { lbm_s = (LevelBlockingMesh_Slope)target; t = lbm_s.transform; UVPosProp = serializedObject.FindProperty("UVPos"); UVScaleProp = serializedObject.FindProperty("UVScale"); widthProp = serializedObject.FindProperty("width"); }
static void CreateSlope() { GameObject go = new GameObject("LBM_Slope"); go.AddComponent <MeshCollider>(); LevelBlockingMesh_Slope lbm = go.AddComponent <LevelBlockingMesh_Slope>(); lbm.CreateMesh(); go.GetComponent <Renderer>().material = Resources.Load <Material>("UtilityGridMat"); go.transform.position = IntoViewPos(); }