Example #1
0
        private static void CreateSuperPlane()
        {
            GameObject obj = new GameObject("SuperPlane");

            obj.AddComponent <BoxCollider>();
            obj.AddComponent <SuperPlane>().Build(true);
            obj.GetComponent <Renderer>().sharedMaterial = EditorTools.GetDefaultMaterial();

            Vector3 snap = new Vector3(EditorPrefs.GetFloat("MoveSnapX"), EditorPrefs.GetFloat("MoveSnapY"), EditorPrefs.GetFloat("MoveSnapZ"));

            obj.transform.position = SuperCubeEditorUtil.SnapVector(SuperCubeEditorUtil.GetSpawnPos(), snap);

            Selection.activeGameObject = obj;
            EditorGUIUtility.PingObject(obj);
        }
Example #2
0
        private static void CreateSuperCube()
        {
            GameObject obj = new GameObject("SuperCube");

            obj.AddComponent <BoxCollider>();
            obj.AddComponent <SuperCube>().Build(true);
            obj.GetComponent <Renderer>().sharedMaterial = EditorTools.GetDefaultMaterial();

            Vector3 snap = EditorTools.GetUnitySnap();

            obj.transform.position = SuperCubeEditorUtil.SnapVector(SuperCubeEditorUtil.GetSpawnPos() + new Vector3(0, 0.5f, 0), snap);

            Selection.activeGameObject = obj;
            EditorGUIUtility.PingObject(obj);
        }