当前位置: 首页>>代码示例>>C#>>正文


C# CCBReader.AddOwnerOutletName方法代码示例

本文整理汇总了C#中Cocos2D.CCBReader.AddOwnerOutletName方法的典型用法代码示例。如果您正苦于以下问题:C# CCBReader.AddOwnerOutletName方法的具体用法?C# CCBReader.AddOwnerOutletName怎么用?C# CCBReader.AddOwnerOutletName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cocos2D.CCBReader的用法示例。


在下文中一共展示了CCBReader.AddOwnerOutletName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ParsePropTypeCcbFile

        protected virtual CCNode ParsePropTypeCcbFile(CCNode node, CCNode parent, CCBReader pCCBReader)
        {
            string ccbFileName = pCCBReader.ReadCachedString();

            /* Change path extension to .ccbi. */
            string ccbFileWithoutPathExtension = CCBReader.DeletePathExtension(ccbFileName);
            ccbFileName = ccbFileWithoutPathExtension + ".ccbi";

            // Load sub file
            string path = CCFileUtils.FullPathFromRelativePath(ccbFileName);
            //long size = 0;
            byte[] pBytes = CCFileUtils.GetFileBytes(path);
            var reader = new CCBReader(pCCBReader);

            reader.AnimationManager.RootContainerSize = parent.ContentSize;

            reader._bytes = pBytes;
            reader._currentByte = 0;
            reader._currentBit = 0;
            reader._owner = pCCBReader._owner;

            reader.AnimationManager._owner = reader._owner;

            CCNode ccbFileNode = reader.ReadFileWithCleanUp(false, pCCBReader.AnimationManagers);

            if (ccbFileNode != null && reader.AnimationManager.AutoPlaySequenceId != -1)
            {
                // Auto play animations
                reader.AnimationManager.RunAnimationsForSequenceIdTweenDuration(reader.AnimationManager.AutoPlaySequenceId, 0);
            }

            if (reader.IsJSControlled() && pCCBReader.IsJSControlled() && null != reader._owner)
            {
                //set variables and callback to owner
                //set callback
                var ownerCallbackNames = reader.OwnerCallbackNames;
                var ownerCallbackNodes = reader.OwnerCallbackNodes;
                if (null != ownerCallbackNames && ownerCallbackNames.Count > 0 &&
                    null != ownerCallbackNodes && ownerCallbackNodes.Count > 0)
                {
                    Debug.Assert(ownerCallbackNames.Count == ownerCallbackNodes.Count);
                    int nCount = ownerCallbackNames.Count;
                    for (int i = 0; i < nCount; i++)
                    {
                        pCCBReader.AddOwnerCallbackName(ownerCallbackNames[i]);
                        pCCBReader.AddOwnerCallbackNode(ownerCallbackNodes[i]);
                    }
                }
                //set variables
                var ownerOutletNames = reader.OwnerOutletNames;
                var ownerOutletNodes = reader.OwnerOutletNodes;
                if (null != ownerOutletNames && ownerOutletNames.Count > 0 &&
                    null != ownerOutletNodes && ownerOutletNodes.Count > 0)
                {
                    Debug.Assert(ownerOutletNames.Count == ownerOutletNodes.Count);
                    int nCount = ownerOutletNames.Count;
                    for (int i = 0; i < nCount; i++)
                    {
                        pCCBReader.AddOwnerOutletName(ownerOutletNames[i]);
                        pCCBReader.AddOwnerOutletNode(ownerOutletNodes[i]);
                    }
                }
            }

            return ccbFileNode;
        }
开发者ID:Karunp,项目名称:cocos2d-xna,代码行数:66,代码来源:CCNodeLoader.cs


注:本文中的Cocos2D.CCBReader.AddOwnerOutletName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。