本文整理汇总了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();
}
}
示例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();
}
}