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


C# CCNode.onEnter方法代码示例

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


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

示例1: addChild

        /// <summary>
        /// Adds a child to the container with z order and tag
        /// If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.
        /// @since v0.7.1
        /// </summary>
        public virtual void addChild(CCNode child, int zOrder, int tag)
        {
            Debug.Assert(child != null, "Argument must be non-null");
            Debug.Assert(child.m_pParent == null, "child already added. It can't be added again");

            insertChild(child, zOrder);

            child.m_nTag = tag;
            child.parent = this;

            if (m_bIsRunning)
            {
                child.onEnter();
                child.onEnterTransitionDidFinish();
            }
        }
开发者ID:ChowZenki,项目名称:cocos2d-x-for-xna,代码行数:21,代码来源:CCNode.cs

示例2: addChild

        /// <summary>
        /// Adds a child to the container with z order and tag
        /// If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.
        /// @since v0.7.1
        /// </summary>
        public virtual void addChild(CCNode child, int zOrder, int tag)
        {
            if (child == null)
            {
                throw (new ArgumentNullException("child", "Child can not be null."));
            }
            if (child.m_pParent != null)
            {
                Debug.WriteLine("child in addChild is already added. Child tag=" + tag + ", parent=" + child.m_pParent.tag);
                return;
            }

            insertChild(child, zOrder);

            child.m_nTag = tag;
            child.parent = this;

            if (m_bIsRunning)
            {
                child.onEnter();
                child.onEnterTransitionDidFinish();
            }
        }
开发者ID:liwq-net,项目名称:cocos2d-for-xna-windows,代码行数:28,代码来源:CCNode.cs


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