コード例 #1
0
        public CCEventDispatcher(CCGameView gameView)
        {
            GameView = gameView;

            toBeAddedListeners = new List <CCEventListener>(50);

            listenerMap               = new Dictionary <string, CCEventListenerVector>();
            priorityDirtyFlagMap      = new Dictionary <string, DirtyFlag>();
            nodeListenersMap          = new Dictionary <CCNode, List <CCEventListener> >();
            nodePriorityMap           = new Dictionary <CCNode, int>();
            globalZOrderNodeMap       = new Dictionary <float, List <CCNode> >();
            dirtyNodes                = new SortedSet <CCNode>();
            internalCustomListenerIDs = new SortedSet <string>();
            IsEnabled         = true;
            inDispatch        = 0;
            nodePriorityIndex = 0;

            internalCustomListenerIDs.Add(CCEvent.EVENT_COME_TO_FOREGROUND);
            internalCustomListenerIDs.Add(CCEvent.EVENT_COME_TO_BACKGROUND);
        }
コード例 #2
0
        public CCAccelerometer(CCGameView gameView)
        {
            GameView = gameView;

#if IOS
            accelerometer = new CoreMotion.CMMotionManager();
            //accelerometer.AccelerometerUpdateInterval = 60f;
#elif !WINDOWS && !OUYA && !NETFX_CORE && !MACOS && !WINDOWSGL && !WINDOWSDX
            try
            {
                accelerometer = new Accelerometer();
            }
            catch (Exception ex)
            {
                CCLog.Log(ex.ToString());
                CCLog.Log("No accelerometer on platform. CCAccelerometer will default to emulation code.");
            }
#elif NETFX_CORE
            accelerometer = Accelerometer.GetDefault();
#endif
        }
コード例 #3
0
 public CCAndroidScreenReceiver(CCGameView view)
 {
     gameView = view;
 }
コード例 #4
0
ファイル: CCScene.cs プロジェクト: ztaksoftware/CocosSharp
 public CCScene(CCGameView gameView)
 {
     GameView = gameView;
 }