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); }
/// <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; }
public CameraGoToScene(RunScene node, IEntity targetObject, Vec3 stance) : base(node) { _targetPos = targetObject.GetPos() + stance; _targetForwardDir = -stance.GetNormalized(); GameFramework.RegisterForUpdate(this); }
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>(); }
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); }
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); } }
protected virtual void start() { mPauseFrame = false; mGameFramework = this; mGameFrameObject = gameObject; initComponent(); }
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(); }
private Game() { GameFramework.RegisterForUpdate(this); Mouse.ShowCursor(); Engine.EngineReloaded += CreateUi; CreateUi(); }
private void Awake() { Framework.Debug.SetLogger(new Logger()); GameFramework.Register(new NetworkManager()); channel = new TcpNetworkChannel("testTCP", this); }
protected virtual void start() { mPauseFrame = false; mGameFramework = this; mGameFrameObject = gameObject; initFrameSystem(); }
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(); }
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>(); } }
public void Destroy() { _currentHandler?.Cleanup(); GameFramework.UnregisterFromUpdate(this); Input.OnKey -= Input_OnKey; Mouse.OnLeftButtonDown -= Mouse_OnLeftButtonDown; }
/********* ** 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; } } }
public static string LockFPS() { GameFramework instance = MonoSingleton <GameFramework> .GetInstance(); instance.LockFPS_SGame = !instance.LockFPS_SGame; return((!instance.LockFPS_SGame) ? "UNITY" : "SGAME"); }
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); }
public SampleApp() { Instance = this; CreateUI(); GameFramework.RegisterForUpdate(this); Input.OnKey += OnKey; }
public void Dispose() { if (Engine.IsDedicatedServer) { return; } GameFramework.UnregisterFromUpdate(this); }
public Timer(float time, Action onTimerExpired = null) { GameFramework.RegisterForUpdate(this); this.timeToLive = time; startTime = Global.gEnv.pTimer.GetCurrTime(); this.onTimerExpired = onTimerExpired; }
// 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); }
public void HandshakeInitializeGUI() { Scene s = GameFramework.Instance().GetCurrentScene(); if (s is SplashScene2) { ((SplashScene2)s).HandshakeInitializeGUI(); } }
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); } }
public void Destroy() { Mouse.OnLeftButtonDown -= OnLeftButtonDown; Mouse.OnLeftButtonUp -= OnLeftButtonUp; Mouse.OnRightButtonDown -= OnRightButtonDown; Mouse.OnRightButtonUp -= OnRightButtonUp; GameFramework.UnregisterFromUpdate(this); }
public WorldMouse() { Mouse.OnLeftButtonDown += OnLeftButtonDown; Mouse.OnLeftButtonUp += OnLeftButtonUp; Mouse.OnRightButtonDown += OnRightButtonDown; Mouse.OnRightButtonUp += OnRightButtonUp; GameFramework.RegisterForUpdate(this); }
public IconManager() { _items = new List <LoadItem>(); _pool = new Hashtable(); _basePath = Engine.DataDirectory + "/Icons/"; _lastCheckPool = Engine.Timer.GetCurrTime(); GameFramework.RegisterForUpdate(this); }
public void ResumeScenario() { Scene s = GameFramework.Instance().GetCurrentScene(); if (s is DDD_HeadsUpDisplay) { ((DDD_HeadsUpDisplay)s).ResumeGame(); } }
public void Destroy() { GameFramework.UnregisterFromUpdate(this); effect?.Remove(); effect = null; target = null; }
public void TimeTick(string time) { Scene s = GameFramework.Instance().GetCurrentScene(); if (s is DDD_HeadsUpDisplay) { ((DDD_HeadsUpDisplay)s).TimeTick(time); } }
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); }
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!"); } }
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; }
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; }
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); }
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); }
public DebugTreeNode(string context, GameFramework.Util.Debug.DebugUtil.DebugEvent debugEvent) { DebugEvent = debugEvent; Context = context; Children = new List<DebugTreeNode>(); Collapsstate = false; }