private void OnClickAsset(string AssetName)
    {
        CUtility.DestroyChildren(_propertiesContent);

        CAssetDeclaration decl = CGame.AssetManager.GetDeclaration(AssetName);

        mUI.CreateTextElement(_propertiesContent, "Selected " + decl.mName, "text", CToolkitUI.ETextStyle.TS_HEADING);

        GameObject foldContent;

        mUI.CreateFoldOut(_propertiesContent, "Asset Details", out foldContent);

        GameObject fieldEditor;

        mUI.CreateFieldElement(foldContent, "Name", out fieldEditor); mUI.CreateTextElement(fieldEditor, decl.mName);
        mUI.CreateFieldElement(foldContent, "File Path", out fieldEditor); mUI.CreateTextElement(fieldEditor, decl.mFileName);
        mUI.CreateFieldElement(foldContent, "Type", out fieldEditor); mUI.CreateTextElement(fieldEditor, decl.mType.ToString());
        //mUI.CreateFieldElement(foldContent, "Modified Date", out fieldEditor); mUI.CreateTextElement(fieldEditor, decl.mModifiedDate);

        GameObject btn = mUI.CreateButton(_propertiesContent, "Edit", () => { mToolkit.EditAsset(AssetName); });

        mUI.AddLayout(btn, -1, 20, 1.0f, -1);

        //btn = mUI.CreateButton(_propertiesContent, "Delete");
        mUI.AddLayout(btn, -1, 20, 1.0f, -1);
    }
Beispiel #2
0
    private void _SelectTile(int X, int Y)
    {
        CUtility.DestroyChildren(_propViewContent);

        _selectedTileX = X;
        _selectedTileY = Y;

        if (X == -1 || Y == -1)
        {
            return;
        }

        mUI.CreateTextElement(_propViewContent, "Tile: " + X + ", " + Y, "text", CToolkitUI.ETextStyle.TS_HEADING);

        GameObject content;
        GameObject editor;

        mUI.CreateFoldOut(_propViewContent, "Tile Properties", out content);

        int solidVal = _asset.mTiles[X, Y].mSolid ? 1 : 0;

        mUI.CreateFieldElement(content, "Solid", out editor);
        mUI.CreateIntEditor(editor, solidVal, (int Value) =>
        {
            _asset.mTiles[X, Y].mSolid = Value == 0 ? false : true;
            _ModifyAsset();
        });
    }
Beispiel #3
0
    private void _RefreshGOB()
    {
        // Call modify here?
        // After any changes, current item state.
        // Created directly from asset, then additions added depending on type.
        // Take view direction into account.

        CUtility.DestroyChildren(_itemRoot);
        GameObject gob = _asset.CreateVisuals(EViewDirection.VD_FRONT);

        gob.transform.SetParent(_itemRoot.transform);

        // Create usage slot visuals
        // Create specific visuals for items that use extended models?

        if (_asset.mItemType == EItemType.DESK || _asset.mItemType == EItemType.REST)
        {
            for (int i = 0; i < _asset.mUsageSlots.Count; ++i)
            {
                GameObject unit = GameObject.Instantiate(CGame.PrimaryResources.Prefabs[7] as GameObject);
                unit.transform.SetParent(_itemRoot.transform);
                unit.transform.localPosition = _asset.mUsageSlots[i].mUsePosition;
                unit.transform.rotation      = Quaternion.Euler(_asset.mUsageSlots[i].mUseRotation);
                Animator _animator = unit.transform.GetChild(0).GetComponent <Animator>();
                _animator.Play("work_working_action_2");
            }
        }

        _RebuildTileIcons();
    }
Beispiel #4
0
    private void _SetAnim(string Name)
    {
        _animName = Name;
        _animator.Play(Name);
        _animator.speed = _animSpeed;

        CUtility.DestroyChildren(_propViewContent);

        mUI.CreateTextElement(_propViewContent, Name, "text", CToolkitUI.ETextStyle.TS_HEADING);

        GameObject foldContent;

        mUI.CreateFoldOut(_propViewContent, "Animation Details", out foldContent);

        GameObject fieldEditor;

        mUI.CreateFieldElement(foldContent, "Name", out fieldEditor); mUI.CreateTextElement(fieldEditor, Name);

        Animation.CAnimationEntry entry = Animation.GetAnimEntry(Name);

        if (entry == null)
        {
            mUI.CreateTextElement(_propViewContent, "No Matching Animation Entry!");
        }
        else
        {
            mUI.CreateFieldElement(foldContent, "Framerate", out fieldEditor); mUI.CreateTextElement(fieldEditor, entry.mFPS.ToString());
            mUI.CreateFieldElement(foldContent, "Start Time", out fieldEditor); mUI.CreateTextElement(fieldEditor, entry.mStartTime.ToString());
            mUI.CreateFieldElement(foldContent, "Duration", out fieldEditor); mUI.CreateTextElement(fieldEditor, entry.mDuration.ToString());
            mUI.CreateFieldElement(foldContent, "Speed Mod", out fieldEditor); mUI.CreateTextElement(fieldEditor, entry.mSpeed.ToString());
        }
    }
Beispiel #5
0
    private void _RebuildTileIcons()
    {
        CUtility.DestroyChildren(_tileIcons);

        for (int iX = 0; iX < _asset.mWidth * 2; ++iX)
        {
            for (int iY = 0; iY < _asset.mLength * 2; ++iY)
            {
                if (_asset.mTiles[iX, iY].mSolid)
                {
                    GameObject gob = GameObject.CreatePrimitive(PrimitiveType.Quad);
                    //GameObject gob = new GameObject();
                    gob.transform.SetParent(_tileIcons.transform);
                    gob.transform.localPosition = new Vector3(iX * 0.5f + 0.25f, 0.0f, iY * 0.5f + 0.25f);
                    gob.transform.rotation      = Quaternion.Euler(90, 0, 0);
                    gob.transform.localScale    = new Vector3(0.5f, 0.5f, 0.5f);
                    gob.GetComponent <MeshRenderer>().material = CGame.WorldResources.TileIconSolid;
                }
            }
        }


        for (int i = 0; i < _asset.mUsageSlots.Count; ++i)
        {
            CItemAsset.CUsageSlot s = _asset.mUsageSlots[i];

            // Entry point tile hits
            Vector3 size        = s.mEntrySize;
            Vector3 halfExtents = size * 0.5f;
            Vector3 min         = s.mEntryPosition - halfExtents;
            Vector3 max         = s.mEntryPosition + halfExtents;

            // Search for tiles within bounds
            int sX = (int)(min.x * 2.0f) - 1;
            int sY = (int)(min.z * 2.0f) - 1;
            int eX = (int)(max.x * 2.0f);
            int eY = (int)(max.z * 2.0f);

            for (int iX = sX; iX <= eX; ++iX)
            {
                for (int iY = sY; iY <= eY; ++iY)
                {
                    Vector3 origin = new Vector3(iX * 0.5f + 0.25f, -0.01f, iY * 0.5f + 0.25f);

                    if (origin.x >= min.x && origin.x <= max.x && origin.z >= min.z && origin.z <= max.z)
                    {
                        CDebug.DrawYSquare(origin, 0.45f, Color.blue, true);
                        GameObject gob = GameObject.CreatePrimitive(PrimitiveType.Quad);
                        //GameObject gob = new GameObject();
                        gob.transform.SetParent(_tileIcons.transform);
                        gob.transform.localPosition = origin;
                        gob.transform.rotation      = Quaternion.Euler(90, 0, 0);
                        gob.transform.localScale    = new Vector3(0.5f, 0.5f, 0.5f);
                        gob.GetComponent <MeshRenderer>().material = CGame.WorldResources.TileIconTrigger;
                    }
                }
            }
        }
    }
Beispiel #6
0
    private void _RebuildComponentView()
    {
        CUtility.DestroyChildren(_componentContent);

        /*
         * mUI.CreateTextElement(_componentContent, "Item Components", "text", CToolkitUI.ETextStyle.TS_HEADING);
         *
         * GameObject toolbar = mUI.CreateElement(_componentContent, "toolbarView");
         * mUI.AddLayout(toolbar, -1, 48, 1.0f, -1);
         * mUI.AddImage(toolbar, mUI.WindowPanelBackground);
         * mUI.AddHorizontalLayout(toolbar);
         * toolbar.GetComponent<HorizontalLayoutGroup>().spacing = 4;
         *
         * mUI.CreateToolbarButton(toolbar, "Add Model", mUI.LevelImage, _AddModel);
         * mUI.CreateToolbarButton(toolbar, "Add Slot", mUI.LevelImage);
         * mUI.CreateToolbarButton(toolbar, "Duplicate", mUI.LevelImage);
         * mUI.CreateToolbarButton(toolbar, "Remove", mUI.LevelImage);
         *
         * GameObject scrollContent;
         * GameObject scrollV1 = mUI.CreateScrollView(_componentContent, out scrollContent, true);
         * mUI.AddLayout(scrollV1, -1, -1, 1.0f, 1.0f);
         *
         * CTUITreeView treeView;
         * GameObject treeViewGob = mUI.CreateTreeView(scrollContent, out treeView);
         * mUI.AddLayout(treeViewGob, -1, -1, 1.0f, 1.0f);
         *
         * CTUITreeViewItem tvCat = treeView.mRootItem.AddItem("Models");
         * tvCat.mExpanded = true;
         * for (int i = 0; i < _asset.mModels.Count; ++i)
         * {
         *      int index = i;
         *      tvCat.AddItem("Model " + i.ToString(), () => { _SelectModel(index); });
         * }
         *
         * tvCat = treeView.mRootItem.AddItem("Slots");
         * tvCat.mExpanded = true;
         * for (int i = 0; i < _asset.mUsageSlots.Count; ++i)
         * {
         *      CTUITreeViewItem tvSlot = tvCat.AddItem("Slot " + i.ToString());
         *      tvSlot.mExpanded = true;
         *
         *      for (int j = 0; j < _asset.mUsageSlots[i].mEntrySlots.Count; ++j)
         *      {
         *              tvSlot.AddItem("Entry " + j);
         *      }
         * }
         *
         * tvCat = treeView.mRootItem.AddItem("Item Specific");
         *
         * if (_asset.mItemType == EItemType.DESK)
         * {
         *      tvCat.AddItem("Chair");
         * }
         *
         * tvCat.RebuildEntireTree();
         */
    }
Beispiel #7
0
    private void _OnClickPrimitive(int ID, bool UpdateTreeView)
    {
        CUtility.DestroyChildren(_primProps);

        _selectedPrimID = ID;

        if (UpdateTreeView)
        {
            _RebuildComponentTree();
        }

        if (ID < 0)
        {
            return;
        }

        CModelPlane prim = _vectorModel.mPlanes[ID];
        GameObject  content;
        GameObject  editor;

        mUI.CreateFoldOut(_primProps, "Details", out content);
        mUI.CreateFieldElement(content, "Type", out editor); mUI.CreateTextElement(editor, "Plane");

        mUI.CreateFieldElement(content, "Name", out editor);
        mUI.CreateStringEditor(editor, prim.mName, (string Name) => { prim.mName = Name; _ModifyAsset(); _RebuildComponentTree(); });

        mUI.CreateFoldOut(_primProps, "Surface", out content);
        mUI.CreateFieldElement(content, "Position", out editor);
        _primPosField = mUI.CreateVector3Editor(editor, prim.mPosition, (Vector3 vec) => { prim.mPosition = vec; _ModifyAsset(); });

        mUI.CreateFieldElement(content, "Rotation", out editor);
        mUI.CreateVector3Editor(editor, prim.mRotation, (Vector3 vec) => { prim.mRotation = vec; _ModifyAsset(); });
        mUI.CreateFieldElement(content, "Fill Brush", out editor); mUI.CreateComboBox(editor, GetBrushName(prim.mFillBrush), _GetBrushComboData, (string Name) => { _SetFillBrush(Name); });

        mUI.CreateFoldOut(_primProps, "Point Offsets", out content);
        mUI.CreateFieldElement(content, "1", out editor);
        mUI.CreateVector2Editor(editor, new Vector2(prim.mCorner[0].mPosition.x, prim.mCorner[0].mPosition.z), (Vector2 vec) => { prim.mCorner[0].mPosition = new Vector3(vec.x, 0.0f, vec.y); _ModifyAsset(); });

        mUI.CreateFieldElement(content, "2", out editor);
        mUI.CreateVector2Editor(editor, new Vector2(prim.mCorner[1].mPosition.x, prim.mCorner[1].mPosition.z), (Vector2 vec) => { prim.mCorner[1].mPosition = new Vector3(vec.x, 0.0f, vec.y); _ModifyAsset(); });

        mUI.CreateFieldElement(content, "3", out editor);
        mUI.CreateVector2Editor(editor, new Vector2(prim.mCorner[2].mPosition.x, prim.mCorner[2].mPosition.z), (Vector2 vec) => { prim.mCorner[2].mPosition = new Vector3(vec.x, 0.0f, vec.y); _ModifyAsset(); });

        mUI.CreateFieldElement(content, "4", out editor);
        mUI.CreateVector2Editor(editor, new Vector2(prim.mCorner[3].mPosition.x, prim.mCorner[3].mPosition.z), (Vector2 vec) => { prim.mCorner[3].mPosition = new Vector3(vec.x, 0.0f, vec.y); _ModifyAsset(); });

        mUI.CreateFoldOut(_primProps, "Edge Brushes for " + _viewDirection.ToString(), out content);
        mUI.CreateFieldElement(content, "1", out editor); mUI.CreateComboBox(editor, GetBrushName(prim.mEdge[0].mBrush[(int)_viewDirection]), _GetBrushComboData, (string Name) => { _SetEdgeBrush(Name, 0); });
        mUI.CreateFieldElement(content, "2", out editor); mUI.CreateComboBox(editor, GetBrushName(prim.mEdge[1].mBrush[(int)_viewDirection]), _GetBrushComboData, (string Name) => { _SetEdgeBrush(Name, 1); });
        mUI.CreateFieldElement(content, "3", out editor); mUI.CreateComboBox(editor, GetBrushName(prim.mEdge[2].mBrush[(int)_viewDirection]), _GetBrushComboData, (string Name) => { _SetEdgeBrush(Name, 2); });
        mUI.CreateFieldElement(content, "4", out editor); mUI.CreateComboBox(editor, GetBrushName(prim.mEdge[3].mBrush[(int)_viewDirection]), _GetBrushComboData, (string Name) => { _SetEdgeBrush(Name, 3); });
    }
Beispiel #8
0
    private void _RebuildItemPropertiesView()
    {
        CUtility.DestroyChildren(_propViewContent);

        mUI.CreateTextElement(_propViewContent, "Item Properties", "text", CToolkitUI.ETextStyle.TS_HEADING);

        GameObject content;
        GameObject editor;

        mUI.CreateFoldOut(_propViewContent, "Generic Item Properties", out content);

        mUI.CreateFieldElement(content, "Type", out editor);
        mUI.CreateComboBox(editor, _GetItemTypeString(_asset.mItemType), _GetTypeComboData, (string Name) => { _ChangeType(Name); });

        mUI.CreateFieldElement(content, "Name", out editor);
        mUI.CreateStringEditor(editor, _asset.mFriendlyName, (string Text) => { _asset.mFriendlyName = Text; _ModifyAsset(); });

        mUI.CreateFieldElement(content, "Flavour Text", out editor);
        mUI.CreateStringEditor(editor, _asset.mFlavourText, (string Text) => { _asset.mFlavourText = Text; _ModifyAsset(); });

        mUI.CreateFieldElement(content, "Width", out editor);
        mUI.CreateIntEditor(editor, _asset.mWidth, (int Value) => { _AdjustBaseSize(Value, _asset.mLength); _ModifyAsset(); });

        mUI.CreateFieldElement(content, "Length", out editor);
        mUI.CreateIntEditor(editor, _asset.mLength, (int Value) => { _AdjustBaseSize(_asset.mWidth, Value); _ModifyAsset(); });

        mUI.CreateFieldElement(content, "Durability", out editor);
        mUI.CreateIntEditor(editor, _asset.mDurability, (int Value) => { _asset.mDurability = Value; _ModifyAsset(); });

        mUI.CreateFieldElement(content, "Cost", out editor);
        mUI.CreateIntEditor(editor, _asset.mCost, (int Value) => { _asset.mCost = Value; _ModifyAsset(); });

        // Icon
        {
            mUI.CreateFoldOut(_propViewContent, "Icon", out content, false);

            //mUI.CreateFieldElement(content, "Model", out editor);
            //mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mPMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mPMAsset, Name); });

            mUI.CreateFieldElement(content, "X, Y, Zoom", out editor);
            mUI.CreateVector3Editor(editor, _asset.mIconCameraPostion, (Vector3 vec) => { _asset.mIconCameraPostion = vec; _ModifyAsset(); });

            //mUI.CreateFieldElement(content, "Direction", out editor);
            //mUI.CreateVector3Editor(editor, _asset.mPMRotation, (Vector3 vec) => { _asset.mPMRotation = vec; _ModifyAsset(); });

            //mUI.CreateFieldElement(content, "Model", out editor);

            GameObject icon = mUI.CreateElement(content, "icon");
            mUI.AddImage(icon, new Color(0.2f, 0.2f, 0.2f, 1.0f));
            mUI.AddLayout(icon, 54, 54, -1, -1);

            GameObject iconImg = mUI.CreateElement(icon, "img");
            mUI.SetRectFillParent(iconImg, 0);
            RawImage ii = iconImg.AddComponent <RawImage>();
            ii.texture = _asset.mIconTexture;
            ii.uvRect  = _asset.mIconRect;
        }

        // Item Specific
        if (_asset.mItemType == EItemType.DECO)
        {
            mUI.CreateFoldOut(_propViewContent, "Deco", out content, false);

            mUI.CreateFieldElement(content, "Stress (AOE)", out editor);
            mUI.CreateFloatEditor(editor, _asset.mStress, (float Value) => { _asset.mStress = Value; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Efficiency (AOE)", out editor);
            mUI.CreateFloatEditor(editor, _asset.mValue, (float Value) => { _asset.mValue = Value; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "AOE Radius", out editor);
            mUI.CreateFloatEditor(editor, _asset.mAreaOfEffect, (float Value) => { _asset.mAreaOfEffect = Value; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Model", out editor);
            mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mPMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mPMAsset, Name); });

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMPosition, (Vector3 vec) => { _asset.mPMPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMRotation, (Vector3 vec) => { _asset.mPMRotation = vec; _ModifyAsset(); });
        }
        else if (_asset.mItemType == EItemType.DESK)
        {
            mUI.CreateFoldOut(_propViewContent, "Desk", out content, false);

            mUI.CreateFieldElement(content, "Stress", out editor);
            mUI.CreateFloatEditor(editor, _asset.mStress, (float Value) => { _asset.mStress = Value; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Efficiency", out editor);
            mUI.CreateFloatEditor(editor, _asset.mValue, (float Value) => { _asset.mValue = Value; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Stacks In Max", out editor);
            mUI.CreateIntEditor(editor, _asset.mSheetsInMax, (int Value) => { _asset.mSheetsInMax = Value; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Stacks Out Max", out editor);
            mUI.CreateIntEditor(editor, _asset.mSheetsOutMax, (int Value) => { _asset.mSheetsOutMax = Value; _ModifyAsset(); });

            mUI.CreateFoldOut(_propViewContent, "Desk Visuals", out content, false);

            mUI.CreateFieldElement(content, "Model", out editor);
            mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mPMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mPMAsset, Name); });

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMPosition, (Vector3 vec) => { _asset.mPMPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMRotation, (Vector3 vec) => { _asset.mPMRotation = vec; _ModifyAsset(); });

            mUI.CreateTextElement(content, "Paper In");

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPaperInPosition, (Vector3 vec) => { _asset.mPaperInPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPaperInRotation, (Vector3 vec) => { _asset.mPaperInRotation = vec; _ModifyAsset(); });

            mUI.CreateTextElement(content, "Paper Out");

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPaperOutPosition, (Vector3 vec) => { _asset.mPaperOutPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPaperOutRotation, (Vector3 vec) => { _asset.mPaperOutRotation = vec; _ModifyAsset(); });

            mUI.CreateFoldOut(_propViewContent, "Chair", out content, false);

            mUI.CreateFieldElement(content, "Model", out editor);
            mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mSMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mSMAsset, Name); });

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mSMPosition, (Vector3 vec) => { _asset.mSMPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mSMRotation, (Vector3 vec) => { _asset.mSMRotation = vec; _ModifyAsset(); });

            mUI.CreateFoldOut(_propViewContent, "Usage Slot", out content, false);

            mUI.CreateTextElement(content, "Entry Point");

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mUsageSlots[0].mEntryPosition, (Vector3 vec) => { _asset.mUsageSlots[0].mEntryPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mUsageSlots[0].mEntryRotation, (Vector3 vec) => { _asset.mUsageSlots[0].mEntryRotation = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Size", out editor);
            mUI.CreateVector3Editor(editor, _asset.mUsageSlots[0].mEntrySize, (Vector3 vec) => { _asset.mUsageSlots[0].mEntrySize = vec; _ModifyAsset(); });

            mUI.CreateTextElement(content, "Usage Point");

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mUsageSlots[0].mUsePosition, (Vector3 vec) => { _asset.mUsageSlots[0].mUsePosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mUsageSlots[0].mUseRotation, (Vector3 vec) => { _asset.mUsageSlots[0].mUseRotation = vec; _ModifyAsset(); });
        }
        else if (_asset.mItemType == EItemType.SAFE)
        {
            mUI.CreateFoldOut(_propViewContent, "Safe", out content, false);

            mUI.CreateFieldElement(content, "Model", out editor);
            mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mPMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mPMAsset, Name); });

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMPosition, (Vector3 vec) => { _asset.mPMPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMRotation, (Vector3 vec) => { _asset.mPMRotation = vec; _ModifyAsset(); });
        }
        else if (_asset.mItemType == EItemType.REST)
        {
            mUI.CreateFoldOut(_propViewContent, "Rest", out content, false);

            mUI.CreateFieldElement(content, "Comfort", out editor);
            mUI.CreateFloatEditor(editor, _asset.mValue, (float Value) => { _asset.mValue = Value; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Model", out editor);
            mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mPMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mPMAsset, Name); });

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMPosition, (Vector3 vec) => { _asset.mPMPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMRotation, (Vector3 vec) => { _asset.mPMRotation = vec; _ModifyAsset(); });
        }
        else if (_asset.mItemType == EItemType.FOOD)
        {
            mUI.CreateFoldOut(_propViewContent, "Food", out content, false);

            mUI.CreateFieldElement(content, "Food Quality", out editor);
            mUI.CreateFloatEditor(editor, _asset.mValue, (float Value) => { _asset.mValue = Value; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Model", out editor);
            mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mPMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mPMAsset, Name); });

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMPosition, (Vector3 vec) => { _asset.mPMPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMRotation, (Vector3 vec) => { _asset.mPMRotation = vec; _ModifyAsset(); });
        }
        else if (_asset.mItemType == EItemType.DOOR)
        {
            mUI.CreateFoldOut(_propViewContent, "Door", out content, false);

            mUI.CreateFieldElement(content, "Model", out editor);
            mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mPMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mPMAsset, Name); });

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMPosition, (Vector3 vec) => { _asset.mPMPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMRotation, (Vector3 vec) => { _asset.mPMRotation = vec; _ModifyAsset(); });
        }
        else if (_asset.mItemType == EItemType.START)
        {
            mUI.CreateFoldOut(_propViewContent, "Start", out content, false);

            mUI.CreateFieldElement(content, "Model", out editor);
            mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mPMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mPMAsset, Name); });

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMPosition, (Vector3 vec) => { _asset.mPMPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMRotation, (Vector3 vec) => { _asset.mPMRotation = vec; _ModifyAsset(); });

            mUI.CreateFoldOut(_propViewContent, "Door", out content, false);

            mUI.CreateFieldElement(content, "Model", out editor);
            mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mSMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mSMAsset, Name); });

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mSMPosition, (Vector3 vec) => { _asset.mSMPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mSMRotation, (Vector3 vec) => { _asset.mSMRotation = vec; _ModifyAsset(); });
        }
        else if (_asset.mItemType == EItemType.CAMERA)
        {
            mUI.CreateFoldOut(_propViewContent, "Camera", out content, false);

            mUI.CreateFieldElement(content, "Model", out editor);
            mUI.CreateComboBox(editor, _GetPrimaryModelName(_asset.mPMAsset), _GetModelsComboData, (string Name) => { _ChangeModel(ref _asset.mPMAsset, Name); });

            mUI.CreateFieldElement(content, "Position", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMPosition, (Vector3 vec) => { _asset.mPMPosition = vec; _ModifyAsset(); });

            mUI.CreateFieldElement(content, "Rotation", out editor);
            mUI.CreateVector3Editor(editor, _asset.mPMRotation, (Vector3 vec) => { _asset.mPMRotation = vec; _ModifyAsset(); });
        }
    }
Beispiel #9
0
 /// <summary>
 /// Remove all content.
 /// </summary>
 public void Clear()
 {
     CUtility.DestroyChildren(_contextMenu);
 }