當前位置: 首頁>>代碼示例>>C#>>正文


C# DataObject.SetGameObjectRefs方法代碼示例

本文整理匯總了C#中System.Windows.Forms.DataObject.SetGameObjectRefs方法的典型用法代碼示例。如果您正苦於以下問題:C# DataObject.SetGameObjectRefs方法的具體用法?C# DataObject.SetGameObjectRefs怎麽用?C# DataObject.SetGameObjectRefs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.DataObject的用法示例。


在下文中一共展示了DataObject.SetGameObjectRefs方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SerializeToData

 protected override void SerializeToData(DataObject data)
 {
     data.SetGameObjectRefs(new[] { this.gameObj });
 }
開發者ID:ChrisLakeZA,項目名稱:duality,代碼行數:4,代碼來源:GameObjectRefPropertyEditor.cs

示例2: AppendNodesToData

        protected void AppendNodesToData(DataObject data, IEnumerable<TreeNodeAdv> nodes, bool guardRequiredComponents)
        {
            if (!guardRequiredComponents)
            {
                data.SetData(nodes.ToArray());
                data.SetComponentRefs(
                    from c in nodes
                    where c.Tag is ComponentNode
                    select (c.Tag as ComponentNode).Component);
                data.SetGameObjectRefs(
                    from c in nodes
                    where c.Tag is GameObjectNode
                    select (c.Tag as GameObjectNode).Obj);
            }
            else
            {
                // Query selected objects and components
                var nodeQuery =
                    from viewNode in this.objectView.SelectedNodes
                    select this.objectModel.FindNode(this.objectView.GetPath(viewNode)) as NodeBase;
                var cmpQuery =
                    from cmpNode in nodeQuery
                    where cmpNode is ComponentNode
                    select (cmpNode as ComponentNode).Component;
                var objQuery =
                    from objNode in nodeQuery
                    where objNode is GameObjectNode
                    select (objNode as GameObjectNode).Obj;
                var cmpList = new List<Component>(cmpQuery);
                var objList = new List<GameObject>(objQuery);

                // Check which Components may be removed and which not
                Component conflictComp = this.CheckComponentsRemovable(cmpList, objList);
                if (conflictComp != null)
                {
                    this.FlashNode(this.FindNode(conflictComp));
                    System.Media.SystemSounds.Beep.Play();
                }

                var viewNodeQuery =
                            cmpList.Select(c => this.objectView.FindNodeByTag(this.FindNode(c))).
                    Concat(	objList.Select(o => this.objectView.FindNodeByTag(this.FindNode(o))));

                this.AppendNodesToData(data, viewNodeQuery.ToArray(), false);
            }
        }
開發者ID:ChrisLakeZA,項目名稱:duality,代碼行數:46,代碼來源:SceneView.cs


注:本文中的System.Windows.Forms.DataObject.SetGameObjectRefs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。