Esempio n. 1
0
    static void CreateBridge(int length)
    {
        GameObject    g = Resources.Load <GameObject>("Bridge Builder");
        BridgeBuilder b = Instantiate(g).GetComponent <BridgeBuilder>();

        b.length = length;
        b.BuildObject();
        DestroyImmediate(b.gameObject);
    }
Esempio n. 2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        BridgeBuilder bridgeBuilder = (BridgeBuilder)target;

        if (GUILayout.Button("Build Object"))
        {
            bridgeBuilder.BuildObject();
        }
    }