예제 #1
0
파일: CCSpawn.cs 프로젝트: lonag/cocos-u3d
        public bool initOneTwo(CCFiniteTimeAction action1, CCFiniteTimeAction action2)
        {
            Debug.Assert(action1 != null);
            Debug.Assert(action2 != null);

            bool bRet = false;

            float d1 = action1.duration;
            float d2 = action2.duration;

            if (base.initWithDuration(Math.Max(d1, d2)))
            {
                m_pOne = action1;
                m_pTwo = action2;

                if (d1 > d2)
                {
                    m_pTwo = CCSequence.actionOneTwo(action2, CCDelayTime.actionWithDuration(d1 - d2));
                }
                else if (d1 < d2)
                {
                    m_pOne = CCSequence.actionOneTwo(action1, CCDelayTime.actionWithDuration(d2 - d1));
                }

                bRet = true;
            }

            return(bRet);
        }
예제 #2
0
        public static CCDelayTime actionWithDuration(float d)
        {
            CCDelayTime pAction = new CCDelayTime();

            pAction.initWithDuration(d);

            return(pAction);
        }
예제 #3
0
        public override CCObject copyWithZone(CCZone pZone)
        {
            CCZone      pNewZone = null;
            CCDelayTime pCopy    = null;

            if (pZone != null && pZone.m_pCopyObject != null)
            {
                //in case of being called at sub class
                pCopy = (CCDelayTime)(pZone.m_pCopyObject);
            }
            else
            {
                pCopy = new CCDelayTime();
                pZone = pNewZone = new CCZone(pCopy);
            }


            base.copyWithZone(pZone);

            return(pCopy);
        }