예제 #1
0
    static void Create()
    {
        GameObject gameObject = new GameObject("Gear");
        GFGear     g          = (GFGear)gameObject.AddComponent(typeof(GFGear));
        GFGearGen  gg         = (GFGearGen)gameObject.AddComponent(typeof(GFGearGen));
        MeshFilter meshFilter = (MeshFilter)gameObject.GetComponent(typeof(MeshFilter));

        meshFilter.mesh = new Mesh();

        gg.Rebuild();

        gameObject.GetComponent <Renderer>().material = new Material(Shader.Find("Diffuse"));

        if (g.DrivenBy == null)
        {
            gg.alignTeethWithParent  = false;
            gg.alignRadiusWithParent = false;
        }

        GFGearGenEditor.Persist(gg);
    }
예제 #2
0
 void UndoCallback()
 {
     gearGenObject.Rebuild();
 }