Ejemplo n.º 1
0
        public virtual void FollowPath(SimSet path, int node)
        {
            stopThread(0);

            if (!path.isObject() || !isObject())
            {
                this["path"] = "";
                return;
            }

            if (node > path.getCount() - 1)
            {
                this["targetNode"] = (path.getCount() - 1).AsString();
            }
            else
            {
                this["targetNode"] = node.AsString();
            }

            if ((this["path"]) == path)
            {
                MoveToNode(this["currentNode"].AsUint());
            }

            else
            {
                this["path"] = path;
                MoveToNode(0);
            }
        }
Ejemplo n.º 2
0
        public override void onWorldEditorStartup()
        {
            ForestEditorGui.ForestEditBrushTree ForestEditBrushTree = "ForestEditBrushTree";
            SimSet ForestItemDataSet = "ForestItemDataSet";

            ForestEditorGui.ForestEditMeshTree ForestEditMeshTree = "ForestEditMeshTree";
            EditorGui EditorGui = "EditorGui";

            ForestEditorGui.ForestEditTabBook            ForestEditTabBook            = "ForestEditTabBook";
            ForestEditorGui.ForestEditorPropertiesWindow ForestEditorPropertiesWindow = "ForestEditorPropertiesWindow";
            ForestEditorGui.ForestEditorPalleteWindow    ForestEditorPalleteWindow    = "ForestEditorPalleteWindow";

            new ObjectCreator("PersistenceManager", "ForestDataManager").Create();

            const string brushPath = "art/forest/brushes.cs";

            if (!Util.isFile(brushPath))
            {
                Util.createPath(brushPath);
            }

            // This creates the ForestBrushGroup, all brushes, and elements.
            Util.exec(brushPath, false, false);

            SimGroup ForestBrushGroup = "ForestBrushGroup";

            if (!ForestBrushGroup.isObject())
            {
                ForestBrushGroup  = new ObjectCreator("SimGroup", "ForestBrushGroup").Create();
                this["showError"] = true.AsString();
            }

            ForestEditBrushTree.open(ForestBrushGroup);

            if (!ForestItemDataSet.isObject())
            {
                ForestItemDataSet = new ObjectCreator("SimSet", "ForestItemDataSet").Create();
            }

            ForestEditMeshTree.open(ForestItemDataSet);

            // Add ourselves to the window menu.
            string accel = EditorGui.addToEditorsMenu("Forest Editor", "", this);

            // Add ourselves to the tools menu.
            string tooltip = "Forest Editor (" + accel + ")";

            EditorGui.addToToolsToolbar("ForestEditorPlugin", "ForestEditorPalette",
                                        Util._expandFilename("tools/forestEditor/images/forest-editor-btn"), tooltip);

            //connect editor windows
            ForestEditorPalleteWindow.attachTo(ForestEditorPropertiesWindow);
            ForestEditTabBook.selectPage(0);
        }
Ejemplo n.º 3
0
        public static void sfxStopAll(SimSet channel)
        {
            channel = sfxOldChannelToGroup(channel);

            if (!channel.isObject())
            {
                return;
            }

            for (uint i = 0; i < channel.getCount(); i++)
            {
                ((SFXSource)channel.getObject(i)).stop(-1);
            }
            //SFXSource.stop(channel.getObject(i), -1);
        }