コード例 #1
0
ファイル: SplashScene2.cs プロジェクト: xiangnanyue/DDD
        public override void OnInitializeScene(GameFramework g)
        {
            BindGameController();

            _background.X      = 0;
            _background.Y      = 0;
            _background.Width  = g.CANVAS.Size.Width;
            _background.Height = g.CANVAS.Size.Height;

            //string path = System.Environment.CurrentDirectory + @"\ImageLib.dll";
            string path = string.Format(@"\\{0}\DDDClient\ImageLib.dll", DDD_Global.Instance.HostName);

            ImageLib = Assembly.LoadFile(path);

            //font_small = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 12));
            font_small = g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 14));

            font_large = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 28));

            bounding_rect   = font_large.MeasureString(null, Message, DrawTextFormat.NoClip, Color.Yellow);
            bounding_rect.X = (_background.Width - bounding_rect.Width) / 2;
            bounding_rect.Y = (int)(_background.Height - (2 * bounding_rect.Height));

            player_rect.X      = (int)((_background.Width - (_background.Width / 4)) / 2);
            player_rect.Y      = (int)((_background.Height - (_background.Height / 3)) / 2);
            player_rect.Width  = (int)(_background.Width / 4);
            player_rect.Height = (int)(_background.Height / 3);

            _player_window = CreateWindow(g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 12)), "Available Players",
                                          player_rect.X,
                                          player_rect.Y,
                                          player_rect.Right,
                                          player_rect.Bottom);

            _player_window.AllowMove     = false;
            _player_window.AllowShade    = false;
            _player_window.AllowResize   = false;
            _player_window.HasScrollBars = false;


            _player_menu = new PanelMenu(
                g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 14)),
                new PanelMenuSelectHandler(PlayerSelection)
                );
            _player_menu.BackgroundColor = Color.Black;
            _player_window.BindPanelControl(_player_menu);
            _player_window.Show();
            _player_menu.LayoutMenuOptions(new string[] { "Populating ..." }, PanelLayout.Vertical);


            _continue_btn = (PanelStaticButton) new PanelStaticButton(_player_window.ClientArea.Left,
                                                                      _player_window.ClientArea.Bottom + 2,
                                                                      _player_window.ClientArea.Right,
                                                                      _player_window.ClientArea.Bottom + 27);
            _continue_btn.Text            = "Continue";
            _continue_btn.BackgroundColor = Color.FromArgb(204, 63, 63, 63);
            _continue_btn.BorderColor     = Color.White;
            _continue_btn.Font            = font_small;
            _continue_btn.MouseClick      = new System.Windows.Forms.MouseEventHandler(this.Btn_Continue);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        public Stage()
            : base()
        {
            _inst       = this;
            soundVolume = 1;

            _updateContext = new UpdateContext();
            _soundEnabled  = true;

            _touchInfo         = new TouchInfo();
            _touchInfo.touchId = 0;
            _lastKeyDownTime   = new Dictionary <KeyId, float>();

            _rollOutChain  = new List <DisplayObject>();
            _rollOverChain = new List <DisplayObject>();

            Timers.inst.Add(5, 0, RunTextureCollector);
            GameFramework.RegisterForUpdate(this);
            GameFramework.RegisterForRender(this);

            _focusRemovedDelegate = OnFocusRemoved;

            Renderer.ResolutionChanged += OnResolutionChanged;
            OnResolutionChanged(0, 0);

            _mouseEventListener = new MouseEventListener();
            Global.gEnv.pHardwareMouse.AddListener(_mouseEventListener);

            Input.OnKey += OnKeyEvents;
        }
コード例 #3
0
        public CameraGoToScene(RunScene node, IEntity targetObject, Vec3 stance) : base(node)
        {
            _targetPos        = targetObject.GetPos() + stance;
            _targetForwardDir = -stance.GetNormalized();

            GameFramework.RegisterForUpdate(this);
        }
コード例 #4
0
ファイル: FsmTest.cs プロジェクト: weixinxin/CodeLib
 private void Awake()
 {
     Framework.Debug.SetLogger(new Logger());
     GameFramework.Register(new FsmManager());
     mFsm = FsmManager.Instance.CreateFsm <FsmTest>("FsmTest", this, new NormalState(), new TiredState(), new DeadState());
     mFsm.Start <NormalState>();
 }
コード例 #5
0
    public virtual void notifyConstructDone()
    {
        mGameFramework = GameFramework.mGameFramework;
        mGameFramework.getSystem(out mCommandSystem);
        mGameFramework.getSystem(out mAudioManager);
        mGameFramework.getSystem(out mGameSceneManager);
        mGameFramework.getSystem(out mCharacterManager);
        mGameFramework.getSystem(out mLayoutManager);
        mGameFramework.getSystem(out mKeyFrameManager);
        mGameFramework.getSystem(out mGlobalTouchSystem);
        mGameFramework.getSystem(out mShaderManager);
#if !UNITY_IOS && !NO_SQLITE
        mGameFramework.getSystem(out mSQLite);
#endif
        mGameFramework.getSystem(out mDataBase);
        mGameFramework.getSystem(out mCameraManager);
        mGameFramework.getSystem(out mResourceManager);
        mGameFramework.getSystem(out mApplicationConfig);
        mGameFramework.getSystem(out mFrameConfig);
        mGameFramework.getSystem(out mObjectPool);
        mGameFramework.getSystem(out mInputManager);
        mGameFramework.getSystem(out mSceneSystem);
        mGameFramework.getSystem(out mClassPool);
        mGameFramework.getSystem(out mListPool);
        mGameFramework.getSystem(out mAndroidPluginManager);
        mGameFramework.getSystem(out mAndroidAssetLoader);
        mGameFramework.getSystem(out mHeadTextureManager);
        mGameFramework.getSystem(out mTimeManager);
        mGameFramework.getSystem(out mMovableObjectManager);
        mGameFramework.getSystem(out mEffectManager);
        mGameFramework.getSystem(out mTPSpriteManager);
        mGameFramework.getSystem(out mSocketFactory);
        mGameFramework.getSystem(out mPathKeyframeManager);
    }
コード例 #6
0
ファイル: FrameBase.cs プロジェクト: huai707/Mahjong
 public virtual void notifyConstructDone()
 {
     if (mGameFramework == null)
     {
         mGameFramework = GameFramework.instance;
         mGameFramework.getSystem(out mXLuaManager);
         mGameFramework.getSystem(out mCommandSystem);
         mGameFramework.getSystem(out mAudioManager);
         mGameFramework.getSystem(out mGameSceneManager);
         mGameFramework.getSystem(out mCharacterManager);
         mGameFramework.getSystem(out mLayoutManager);
         mGameFramework.getSystem(out mKeyFrameManager);
         mGameFramework.getSystem(out mGlobalTouchSystem);
         mGameFramework.getSystem(out mShaderManager);
         mGameFramework.getSystem(out mSQLite);
         mGameFramework.getSystem(out mDataBase);
         mGameFramework.getSystem(out mCameraManager);
         mGameFramework.getSystem(out mResourceManager);
         mGameFramework.getSystem(out mLayoutSubPrefabManager);
         mGameFramework.getSystem(out mApplicationConfig);
         mGameFramework.getSystem(out mFrameConfig);
         mGameFramework.getSystem(out mObjectManager);
         mGameFramework.getSystem(out mInputManager);
         mGameFramework.getSystem(out mSceneSystem);
         mGameFramework.getSystem(out mClassObjectPool);
         mGameFramework.getSystem(out mAndroidPluginManager);
         mSQLite.getTable(out mSQLiteSound);
     }
 }
コード例 #7
0
 protected virtual void start()
 {
     mPauseFrame      = false;
     mGameFramework   = this;
     mGameFrameObject = gameObject;
     initComponent();
 }
コード例 #8
0
 public virtual void start()
 {
     mPauseFrame          = false;
     instance             = this;
     mGameFrameObject     = this.transform.gameObject;
     mApplicationConfig   = new ApplicationConfig();
     mResourceManager     = new ResourceManager();
     mBinaryUtility       = new BinaryUtility();
     mFileUtility         = new FileUtility();
     mMathUtility         = new MathUtility();
     mStringUtility       = new StringUtility();
     mUnityUtility        = new UnityUtility();
     mPluginUtility       = new PluginUtility();
     mCommandSystem       = new CommandSystem();
     mLayoutManager       = new GameLayoutManager();
     mAudioManager        = new AudioManager();
     mGameSceneManager    = new GameSceneManager();
     mCharacterManager    = new CharacterManager();
     mKeyFrameManager     = new KeyFrameManager();
     mGlobalTouchSystem   = new GlobalTouchSystem();
     mDllImportExtern     = new DllImportExtern();
     mShaderManager       = new ShaderManager();
     mDataBase            = new DataBase();
     mCameraManager       = new CameraManager();
     mLayoutPrefabManager = new LayoutPrefabManager();
     mFrameConfig         = new FrameConfig();
 }
コード例 #9
0
 private Game()
 {
     GameFramework.RegisterForUpdate(this);
     Mouse.ShowCursor();
     Engine.EngineReloaded += CreateUi;
     CreateUi();
 }
コード例 #10
0
    private void Awake()
    {
        Framework.Debug.SetLogger(new Logger());
        GameFramework.Register(new NetworkManager());

        channel = new TcpNetworkChannel("testTCP", this);
    }
コード例 #11
0
	protected virtual void start()
	{
		mPauseFrame = false;
		mGameFramework = this;
		mGameFrameObject = gameObject;
		initFrameSystem();
	}
コード例 #12
0
 private void OnDestroy()
 {
     EventManager.Instance.RemoveListener <string>(TestEvent.left, OnEvent);
     EventManager.Instance.RemoveListener <string>(TestEvent.right, OnEvent2);
     EventManager.Instance.RemoveListener(TestEvent.other, OnEvent3);
     GameFramework.Shutdown();
 }
コード例 #13
0
ファイル: FrameBase.cs プロジェクト: Hengle/GameEditor
 public virtual void notifyConstructDone()
 {
     if (mGameFramework == null)
     {
         mGameFramework          = GameFramework.instance;
         mCommandSystem          = mGameFramework.getSystem <CommandSystem>();
         mAudioManager           = mGameFramework.getSystem <AudioManager>();
         mGameSceneManager       = mGameFramework.getSystem <GameSceneManager>();
         mCharacterManager       = mGameFramework.getSystem <CharacterManager>();
         mLayoutManager          = mGameFramework.getSystem <GameLayoutManager>();
         mKeyFrameManager        = mGameFramework.getSystem <KeyFrameManager>();
         mGlobalTouchSystem      = mGameFramework.getSystem <GlobalTouchSystem>();
         mShaderManager          = mGameFramework.getSystem <ShaderManager>();
         mSQLite                 = mGameFramework.getSystem <SQLite>();
         mDataBase               = mGameFramework.getSystem <DataBase>();
         mCameraManager          = mGameFramework.getSystem <CameraManager>();
         mResourceManager        = mGameFramework.getSystem <ResourceManager>();
         mLayoutSubPrefabManager = mGameFramework.getSystem <LayoutSubPrefabManager>();
         mApplicationConfig      = mGameFramework.getSystem <ApplicationConfig>();
         mFrameConfig            = mGameFramework.getSystem <FrameConfig>();
         mObjectManager          = mGameFramework.getSystem <ObjectManager>();
         mInputManager           = mGameFramework.getSystem <InputManager>();
         mSceneSystem            = mGameFramework.getSystem <SceneSystem>();
         mClassObjectPool        = mGameFramework.getSystem <ClassObjectPool>();
         mSQLiteSound            = mSQLite.getTable <SQLiteSound>();
     }
 }
コード例 #14
0
ファイル: LevelManager.cs プロジェクト: xvanick1/CRYENGINE-1
 public void Destroy()
 {
     _currentHandler?.Cleanup();
     GameFramework.UnregisterFromUpdate(this);
     Input.OnKey            -= Input_OnKey;
     Mouse.OnLeftButtonDown -= Mouse_OnLeftButtonDown;
 }
コード例 #15
0
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="targetPlatform">The current game platform.</param>
        /// <param name="framework">The game framework running the game.</param>
        /// <param name="monitor">Encapsulates monitoring and logging.</param>
        /// <param name="paranoidMode">Whether to detect paranoid mode issues.</param>
        /// <param name="rewriteMods">Whether to rewrite mods for compatibility.</param>
        public AssemblyLoader(Platform targetPlatform, GameFramework framework, IMonitor monitor, bool paranoidMode, bool rewriteMods)
        {
            this.Monitor = monitor;
            this.ParanoidMode = paranoidMode;
            this.RewriteMods = rewriteMods;
            this.AssemblyMap = this.TrackForDisposal(Constants.GetAssemblyMap(targetPlatform, framework));

            // init resolver
            this.AssemblyDefinitionResolver = this.TrackForDisposal(new AssemblyDefinitionResolver());
            this.AssemblyDefinitionResolver.AddSearchDirectory(Constants.ExecutionPath);
            this.AssemblyDefinitionResolver.AddSearchDirectory(Constants.InternalFilesPath);

            // generate type => assembly lookup for types which should be rewritten
            this.TypeAssemblies = new Dictionary<string, Assembly>();
            foreach (Assembly assembly in this.AssemblyMap.Targets)
            {
                ModuleDefinition module = this.AssemblyMap.TargetModules[assembly];
                foreach (TypeDefinition type in module.GetTypes())
                {
                    if (!type.IsPublic)
                        continue; // no need to rewrite
                    if (type.Namespace.Contains("<"))
                        continue; // ignore assembly metadata
                    this.TypeAssemblies[type.FullName] = assembly;
                }
            }
        }
コード例 #16
0
    public static string LockFPS()
    {
        GameFramework instance = MonoSingleton <GameFramework> .GetInstance();

        instance.LockFPS_SGame = !instance.LockFPS_SGame;
        return((!instance.LockFPS_SGame) ? "UNITY" : "SGAME");
    }
コード例 #17
0
        public override void OnInitializeScene(GameFramework g)
        {
            BindGameController();

            font_small           = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 12));
            font_large           = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 28));
            menu                 = new PanelMenu(font_small, new PanelMenuSelectHandler(MenuHandler));
            menu.ForegroundColor = Color.White;
            menu.BackgroundColor = Color.Black;
            menu.BorderColor     = Color.White;

            //menu.ScrollButtonWidth = 20;
            menu.SetHeight(100);
            menu.SetPosition(200, 200);
            menu.SetWidth(100);
            //menu.DrawFormat = DrawTextFormat.None;

            int height = menu.LayoutMenuOptions(new string[] {
                "item1",
                "item2",
                "item3",
                "item4",
                "item5",
                "item6",
                "item7",
                "item8 ",
                "item9 ",
                "item10"
            }, PanelLayout.HorizontalFree);
        }
コード例 #18
0
ファイル: SampleApp.cs プロジェクト: yycmmc/CRYENGINE
        public SampleApp()
        {
            Instance = this;
            CreateUI();

            GameFramework.RegisterForUpdate(this);
            Input.OnKey += OnKey;
        }
コード例 #19
0
ファイル: Game.cs プロジェクト: waimus/CryMonoFPS
 public void Dispose()
 {
     if (Engine.IsDedicatedServer)
     {
         return;
     }
     GameFramework.UnregisterFromUpdate(this);
 }
コード例 #20
0
        public Timer(float time, Action onTimerExpired = null)
        {
            GameFramework.RegisterForUpdate(this);

            this.timeToLive     = time;
            startTime           = Global.gEnv.pTimer.GetCurrTime();
            this.onTimerExpired = onTimerExpired;
        }
コード例 #21
0
    // Use this for initialization
    void Start()
    {
        PoolService poolService = GameFramework.GetService <PoolService>();
        var         pool        = poolService.CreatePool("Test");

        poolService.PreloadPrefab(pool, testPrefab, 3, 5);
        poolService.Spawn(pool, testPrefab, Vector3.zero, Quaternion.identity, this.gameObject);
    }
コード例 #22
0
ファイル: MainWindow.cs プロジェクト: xiangnanyue/DDD
        public void HandshakeInitializeGUI()
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is SplashScene2)
            {
                ((SplashScene2)s).HandshakeInitializeGUI();
            }
        }
コード例 #23
0
ファイル: MainWindow.cs プロジェクト: xiangnanyue/DDD
        public void AttackUpdate(string attacker, string target, int time, int end_time)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).AttackUpdate(attacker, target, time, end_time);
            }
        }
コード例 #24
0
        public void Destroy()
        {
            Mouse.OnLeftButtonDown  -= OnLeftButtonDown;
            Mouse.OnLeftButtonUp    -= OnLeftButtonUp;
            Mouse.OnRightButtonDown -= OnRightButtonDown;
            Mouse.OnRightButtonUp   -= OnRightButtonUp;

            GameFramework.UnregisterFromUpdate(this);
        }
コード例 #25
0
        public WorldMouse()
        {
            Mouse.OnLeftButtonDown  += OnLeftButtonDown;
            Mouse.OnLeftButtonUp    += OnLeftButtonUp;
            Mouse.OnRightButtonDown += OnRightButtonDown;
            Mouse.OnRightButtonUp   += OnRightButtonUp;

            GameFramework.RegisterForUpdate(this);
        }
コード例 #26
0
    public IconManager()
    {
        _items         = new List <LoadItem>();
        _pool          = new Hashtable();
        _basePath      = Engine.DataDirectory + "/Icons/";
        _lastCheckPool = Engine.Timer.GetCurrTime();

        GameFramework.RegisterForUpdate(this);
    }
コード例 #27
0
ファイル: MainWindow.cs プロジェクト: xiangnanyue/DDD
        public void ResumeScenario()
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).ResumeGame();
            }
        }
コード例 #28
0
        public void Destroy()
        {
            GameFramework.UnregisterFromUpdate(this);

            effect?.Remove();

            effect = null;
            target = null;
        }
コード例 #29
0
ファイル: MainWindow.cs プロジェクト: xiangnanyue/DDD
        public void TimeTick(string time)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).TimeTick(time);
            }
        }
コード例 #30
0
 private void Awake()
 {
     Framework.Debug.SetLogger(new Logger());
     GameFramework.Register(new SettingManager(new SettingHelper(), true));
     GameFramework.Register(new EventManager());
     EventManager.Instance.AddListener <string>(TestEvent.left, OnEvent);
     EventManager.Instance.AddListener <string>(TestEvent.right, OnEvent2);
     EventManager.Instance.AddListener(TestEvent.other, OnEvent3);
 }
コード例 #31
0
ファイル: DebugTree.cs プロジェクト: Norskan/Playground
 public void AddSubContext(string context, string subContext, GameFramework.Util.Debug.DebugUtil.DebugEvent debugEvent)
 {
     if (DebugTreeNodes.ContainsKey(context))
     {
         DebugTreeNode node = new DebugTreeNode(subContext, debugEvent);
         DebugTreeNodes[context].Children.Add(node);
         DebugTreeNodes.Add(subContext, node);
     }
     else
     {
         AssertUtil.Assert(false, "Context " + context + " not found!");
     }
 }
コード例 #32
0
 private void SetupGameFramework()
 {
     gameFramework = new GameFramework();
     gameFramework.arenaBuilder = arenaBuilder;
     gameFramework.difficultyManager = difficultyManager;
     gameFramework.levelData = levelData;
     gameFramework.scoreHandler = scoreHandler;
     gameFramework.poolParent = poolParent;
     gameFramework.powerupHandler = powerupHandler;
     gameFramework.soundController = soundController;
 }
コード例 #33
0
 public static List<GameObject> FiltByRelation(GameObject source, List<GameObject> list, GameFramework.CharacterRelation relation)
 {
     List<GameObject> result = new List<GameObject>();
     for (int i = 0; i < list.Count; ++i) {
         GameObject obj = list[i];
         if (EntityController.Instance.GetRelation(source, obj) == relation && source != obj) {
             result.Add(obj);
         }
     }
     return result;
 }
コード例 #34
0
 public void FillColor(GameFramework.Color color)
 {
     var finalColor = new Color(color.R, color.G, color.B, 255) * (color.A / 255.0f);
     this.spriteBatch.Draw(this.blank, this.viewport.Bounds, finalColor);
 }
コード例 #35
0
ファイル: DebugTree.cs プロジェクト: Norskan/Playground
 public void AddContext(string context, GameFramework.Util.Debug.DebugUtil.DebugEvent debugEvent)
 {
     DebugTreeNode node = new DebugTreeNode(context, debugEvent);
     Root.Children.Add(node);
     DebugTreeNodes.Add(context, node);
 }
コード例 #36
0
ファイル: DebugTree.cs プロジェクト: Norskan/Playground
 public DebugTreeNode(string context, GameFramework.Util.Debug.DebugUtil.DebugEvent debugEvent)
 {
     DebugEvent = debugEvent;
     Context = context;
     Children = new List<DebugTreeNode>();
     Collapsstate = false;
 }