public void BeforeTest()
        {
            manager = new GameObject().AddComponent <SpeckleUnityManager> ();
            manager.onStartBehaviour = StartMode.DoNothing;

            loggedInUser = null;

            gotCallback = false;
        }
示例#2
0
        public static void CreateManager(MenuCommand command)
        {
            GameObject instance = new GameObject();

            instance.name = "SpeckleUnityManager";
            SpeckleUnityManager manager = instance.AddComponent <SpeckleUnityManager> ();

            manager.SetRenderingRule(Resources.Load <ColorByType> ("Color By Type"));

            GameObject currentSelection = (GameObject)command.context;

            // Child the new object to the currently selected object if there is one
            if (currentSelection != null)
            {
                instance.transform.parent = currentSelection.transform;
            }

            // Allow undoing the object creation with ctrl + z
            Undo.RegisterCreatedObjectUndo(instance, "Created " + instance.name);

            // Select the new object for the user
            Selection.activeObject = instance;
        }