예제 #1
0
        private void StateControl_FilterContextMenu(CodeGenerateSystem.Controls.NodeListContextMenu contextMenu, CodeGenerateSystem.Controls.NodesContainerControl.ContextMenuFilterData filterData)
        {
            var           ctrlAssist      = this.HostNodesContainer.HostControl as Macross.NodesControlAssist;
            List <string> cachedPosesName = new List <string>();

            foreach (var ctrl in ctrlAssist.NodesControl.CtrlNodeList)
            {
                if (ctrl is CachedAnimPoseControl)
                {
                    if (!cachedPosesName.Contains(ctrl.NodeName))
                    {
                        cachedPosesName.Add(ctrl.NodeName);
                    }
                }
            }
            foreach (var sub in ctrlAssist.SubNodesContainers)
            {
                foreach (var ctrl in sub.Value.CtrlNodeList)
                {
                    if (ctrl is CachedAnimPoseControl)
                    {
                        if (!cachedPosesName.Contains(ctrl.NodeName))
                        {
                            cachedPosesName.Add(ctrl.NodeName);
                        }
                    }
                }
            }
            var assist = mLinkedNodesContainer.HostControl;

            assist.NodesControl_FilterContextMenu(contextMenu, filterData);
            var nodesList = contextMenu.GetNodesList();

            nodesList.ClearNodes();
            var stateCP = new AnimStateControlConstructionParams()
            {
                CSType         = HostNodesContainer.CSType,
                ConstructParam = "",
                NodeName       = "State",
            };

            nodesList.AddNodesFromType(filterData, typeof(CodeDomNode.Animation.AnimStateControl), "State", stateCP, "");
            foreach (var cachedPoseName in cachedPosesName)
            {
                var getCachedPose = new GetCachedAnimPoseConstructionParams()
                {
                    CSType         = HostNodesContainer.CSType,
                    ConstructParam = "",
                    NodeName       = "CachedPose_" + cachedPoseName,
                };
                nodesList.AddNodesFromType(filterData, typeof(GetCachedAnimPoseControl), "CachedAnimPose/" + getCachedPose.NodeName, getCachedPose, "");
            }
        }
예제 #2
0
        public GetCachedAnimPoseControl(GetCachedAnimPoseConstructionParams csParam) : base(csParam)
        {
            InitConstruction();

            var cpInfos = new List <CodeGenerateSystem.Base.CustomPropertyInfo>();

            cpInfos.Add(CodeGenerateSystem.Base.CustomPropertyInfo.GetFromParamInfo(typeof(string), "Name", new Attribute[] { new EngineNS.Rtti.MetaDataAttribute() }));
            mTemplateClassInstance = CodeGenerateSystem.Base.PropertyClassGenerator.CreateClassInstanceFromCustomPropertys(cpInfos, this);

            var clsType  = mTemplateClassInstance.GetType();
            var xNamePro = clsType.GetProperty("Name");

            xNamePro.SetValue(mTemplateClassInstance, csParam.NodeName);

            NodeName          = csParam.NodeName;
            IsOnlyReturnValue = true;
            AddLinkPinInfo("AnimPoseOutHandle", mCtrlValueLinkHandle, null);
        }