void Awake() { m_noise = new Noise (2); m_tileSheet = new TileSheet (m_width, m_height); m_tileRules = new TileChoise[8]; m_tileRules [0] = new TileChoise (TileShape.DownRight, TileCriteria.No, TileCriteria.Yes, TileCriteria.No, TileCriteria.Yes); m_tileRules [1] = new TileChoise (TileShape.DownLeft, TileCriteria.No, TileCriteria.Yes, TileCriteria.Yes, TileCriteria.No); m_tileRules [2] = new TileChoise (TileShape.UpRight, TileCriteria.Yes, TileCriteria.No, TileCriteria.No, TileCriteria.Yes); m_tileRules [3] = new TileChoise (TileShape.UpLeft, TileCriteria.Yes, TileCriteria.No, TileCriteria.Yes, TileCriteria.No); m_tileRules [4] = new TileChoise (TileShape.Down, TileCriteria.Yes, TileCriteria.No, TileCriteria.DontCare, TileCriteria.DontCare); m_tileRules [5] = new TileChoise (TileShape.Up, TileCriteria.No, TileCriteria.DontCare, TileCriteria.DontCare, TileCriteria.DontCare); m_tileRules [6] = new TileChoise (TileShape.Left, TileCriteria.DontCare, TileCriteria.DontCare, TileCriteria.No, TileCriteria.Yes); m_tileRules [7] = new TileChoise (TileShape.Right, TileCriteria.DontCare, TileCriteria.DontCare, TileCriteria.Yes, TileCriteria.No); int textureSize = 2048; m_texture = new Texture2D (textureSize, textureSize); for (int x = 0; x < textureSize; x++) for (int y = 0; y < textureSize; y++) m_texture.SetPixel (x, y, new Color (1, 1, 1, 0)); //(float)x/(float)textureSize, (float)y/(float)textureSize, (float)(x-y)/(float)textureSize)); m_texture.Apply (); SpriteRenderer renderer = GetComponent<SpriteRenderer>(); Sprite sprite = new Sprite (); sprite = Sprite.Create (m_texture,new Rect(0, 0, textureSize, textureSize), new Vector2 (0,0), 1f); renderer.sprite = sprite; renderer.sortingLayerName = "Level base"; m_platformManager = new PlatformManager (); GenerateLevel (); }
void Awake() { startPosition = GameObject.FindGameObjectWithTag("Position-Start").transform.position; player = GameObject.FindGameObjectWithTag("Player").GetComponent<Character>(); platformManager = this.GetComponent<PlatformManager>(); scoreManager = this.GetComponent<ScoreManager>(); }
public GUI(string textureName, string defaultFontName, int defaultFontSize) { PlatformManager = new PlatformManager(CreateWxPlatformManager()); Engine = new Engine(PlatformManager); Engine.Init(); // Search for the location of the main assets folder. string assetsPath; if (!SearchForAssetsDirectory(out assetsPath)) throw new Exception("Editor assets were not found"); Archive = new ArchiveVirtual(); Archive.MountDirectories(assetsPath, Allocator.GetHeap()); ResourceManager = Engine.ResourceManager; ResourceManager.Archive = Archive; WindowManager = Engine.WindowManager; MainWindow = CreateWindow(); var context = MainWindow.CreateContext(new RenderContextSettings()); MainView = MainWindow.CreateView(); MainView.ClearColor = Color.Red; MainWindow.MakeCurrent(); context.Init(); RenderDevice = Engine.RenderDevice; RenderDevice.ActiveView = MainView; var options = new ResourceLoadOptions {Name = textureName, AsynchronousLoad = false}; var imageHandle = ResourceManager.LoadResource<Image>(options); if (imageHandle.Id == 0) return; Renderer = new GwenRenderer(); Skin = new TexturedSkin(Renderer, imageHandle, new Flood.GUI.Font(defaultFontName, defaultFontSize)); if (!Directory.Exists(StoredValuesDirectory)) Directory.CreateDirectory(StoredValuesDirectory); }
// Use this for initialization void Start() { if(m_oPlatformManager == null){ //Assert.LogWarning("m_oPlatformManager not linked"); m_oPlatformManager = GameObject.FindObjectOfType<PlatformManager>(); if(m_oPlatformManager == null){ //Assert.LogError("No PlatformManager in the scene"); return; } Debug.Log("Status = " + m_oPlatformManager.GetPlatformStatus()); } if (m_oInptuManager == null) { //Assert.LogWarning("m_oInptuManager not linked"); m_oInptuManager = GameObject.FindObjectOfType<InputManager> (); if (m_oInptuManager == null) { //Assert.LogError ("No InputManager in the scene"); return; } } }
public EditorBase() { PlatformManager = new PlatformManager(CreateWxPlatformManager()); Engine = new Engine(PlatformManager); Engine.Init(); // Search for the location of the main assets folder. string assetsPath; if (!SearchForAssetsDirectory(out assetsPath)) throw new Exception("Editor assets were not found"); Archive = new ArchiveVirtual(); Archive.MountDirectories(assetsPath, Allocator.GetHeap()); ResourceManager = Engine.ResourceManager; ResourceManager.Archive = Archive; EditorWindow = new EditorWindow(); WindowManager = Engine.WindowManager; MainWindow = CreateWindow(); var context = MainWindow.CreateContext(new RenderContextSettings()); MainView = MainWindow.CreateView(); MainView.ClearColor = Color.Red; MainWindow.Idle += Update; MainWindow.Render += Render; MainWindow.TargetResize += Resize; MainWindow.Show(true); MainWindow.MakeCurrent(); context.Init(); RenderDevice = Engine.RenderDevice; }
void Start () { instance = this; posStar = cubeBegin.transform.position; posLastCube = cubeBegin.transform.position; GameEventManager.GameStartEvent += GameStartInitPlatform; GameEventManager.GameOver += GameOver; GameEventManager.GameReStart += restart; GameEventManager.GameInitEvent += restart; objectQueue = new Queue<Transform>(numberOfObjects); //Transform obj = (Transform)(Instantiate (BigCube, BigCube.transform.position, Quaternion.identity)); // obj.transform.Rotate (0, 45, 0); // obj.gameObject.SetActive (true); // BigCube.gameObject.SetActive (false); // objectQueue.Enqueue (obj); for (int i = 0; i < numberOfObjects; i++) { AddNewBlock();//Recycle(); } //enabled = false; }
public Application() { PlatformManager = new PlatformManager(CreateWxPlatformManager()); Engine = new Engine(PlatformManager); Engine.Init(); // Search for the location of the main assets folder. string assetsPath; if (!SearchForAssetsDirectory(out assetsPath)) throw new Exception("Editor assets were not found"); Archive = new ArchiveVirtual(); Archive.MountDirectories(assetsPath, Allocator.GetHeap()); ResourceManager = Engine.ResourceManager; ResourceManager.Archive = Archive; NativeWindowManager = Engine.WindowManager; RenderDevice = Engine.RenderDevice; ModuleManager = new ModuleManager(); RemotingManager = new RemotingManager(ModuleManager); ModuleManager.Init(RemotingManager.ServiceManager); //Initiate global services WindowManager = new Windows.WindowManager(this); RemotingManager.ServiceManager.GetCreateImplementation<IWindowManager>(WindowManager); // FIXME: Introduce a better system to get at global objects (dependency injection?) RemotingManager.ServiceManager.Application = this; }
// Use this for initialization void Start() { instance = this; GameEventManager.GameStart += GameStart; GameEventManager.GameOver += GameOver; objectQueue = new Queue<Transform>(numberOfObjects); obstacleQueue = new Queue<Transform>(numberOfObjects); for (int i = 0; i < numberOfObjects; i++) { objectQueue.Enqueue((Transform)Instantiate(prefab, new Vector3(0f, 0f, -100f), Quaternion.identity)); obstacleQueue.Enqueue((Transform)Instantiate(obstacle, new Vector3(0f, 0f, -100f), Quaternion.identity)); enabled = false; } }
// Start is called before the first frame update void Start() { SetActions(); platformManager = GameObject.Find("PlatformManager").GetComponent <PlatformManager>(); }
/// <summary> /// Changing to the current platform when the menu is shown<br/> /// [Called by Beat Saber] /// </summary> /// <param name="firstActivation">Was this the first activation?</param> /// <param name="type">Type of activation</param> protected override void DidActivate(bool firstActivation, ActivationType type) { PlatformManager.ChangeToPlatform(); base.DidActivate(firstActivation, type); }
/// <summary> /// Initializes a new instance of the <see cref="PopupRoot"/> class. /// </summary> /// <param name="dependencyResolver"> /// The dependency resolver to use. If null the default dependency resolver will be used. /// </param> public PopupRoot(IAvaloniaDependencyResolver dependencyResolver) : base(PlatformManager.CreatePopup(), dependencyResolver) { }
private void Awake() { instance = this; }
private void Start() { platformManager = GameManager.Instance.PlatformManager; }
public static Window LoadDesignerWindow(string xaml, string assemblyPath, string xamlFileProjectPath) { Window window; Control control; using (PlatformManager.DesignerMode()) { var loader = AvaloniaLocator.Current.GetService <AvaloniaXamlLoader.IRuntimeXamlLoader>(); var stream = new MemoryStream(Encoding.UTF8.GetBytes(xaml)); if (loader == null) { throw new XamlLoadException("Runtime XAML loader is not registered"); } Uri baseUri = null; if (assemblyPath != null) { if (xamlFileProjectPath == null) { xamlFileProjectPath = "/Designer/Fake.xaml"; } //Fabricate fake Uri baseUri = new Uri($"avares://{Path.GetFileNameWithoutExtension(assemblyPath)}{xamlFileProjectPath}"); } var localAsm = assemblyPath != null?Assembly.LoadFile(Path.GetFullPath(assemblyPath)) : null; var loaded = loader.Load(stream, localAsm, null, baseUri, true); var style = loaded as IStyle; if (style != null) { var substitute = Design.GetPreviewWith((AvaloniaObject)style); if (substitute != null) { substitute.Styles.Add(style); control = substitute; } else { control = new StackPanel { Children = { new TextBlock { Text = "Styles can't be previewed without Design.PreviewWith. Add" }, new TextBlock { Text = "<Design.PreviewWith>" }, new TextBlock { Text = " <Border Padding=20><!-- YOUR CONTROL FOR PREVIEW HERE --></Border>" }, new TextBlock { Text = "</Design.PreviewWith>" }, new TextBlock { Text = "before setters in your first Style" } } } }; } else if (loaded is Application) { control = new TextBlock { Text = "Application can't be previewed in design view" } } ; else { control = (Control)loaded; } window = control as Window; if (window == null) { window = new Window() { Content = (Control)control }; } if (!window.IsSet(Window.SizeToContentProperty)) { if (double.IsNaN(window.Width)) { window.SizeToContent |= SizeToContent.Width; } if (double.IsNaN(window.Height)) { window.SizeToContent |= SizeToContent.Height; } } } window.Show(); Design.ApplyDesignModeProperties(window, control); return(window); }
/// <summary> /// Allows you to override the previous request<br/> /// Does nothing if there was no previous request /// </summary> public static void OverridePreviousRequest() { PlatformManager.OverridePreviousRequest(); }
private void Start() { platformManager = ReferenceManagerIndependent.Instance.PlatformManager; }
protected override void DidActivate(bool firstActivation, ActivationType type) { PlatformManager.InternalTempChangeToPlatform(PlatformManager.Instance.currentPlatformIndex); base.DidActivate(firstActivation, type); }
public void OnEnable() { _platformMnger = GameObject.FindObjectOfType <PlatformManager>(); }
protected override void DidDeactivate(DeactivationType deactivationType) { Plugin.Log("attempting to swap to platform 0"); PlatformManager.InternalTempChangeToPlatform(0); base.DidDeactivate(deactivationType); }
public void JoinExistingRoom(ulong roomID) { PlatformManager.TransitionToState(PlatformManager.State.JOINING_A_ROOM): Rooms.Join(roomID, true).OnComplete(JoinRoomCallback): }
void Start() { _platformManager = PlatformManager.Instance; _destroyedPlatformsLimit = ((SettingsManager.Instance.GetMaxNumberPlatforms()) / 2); }
/// <summary> /// Main entry point for the application. /// </summary> /// <remarks> /// <para> /// Responsible for instantiating the platform and determining whether to start the application as a Windows /// service or console/interactive application. /// </para> /// <para> /// The "-logLevel:*" argument is used to determine the logging level of the application. Acceptable values are: /// <list type="bullet"> /// <item> /// <term>trace</term> /// <description> /// The lowest logging level. The output for this level is extremely verbose and only outputs to the /// log file. /// </description> /// </item> /// <item> /// <term>debug</term> /// <description> /// Basic debugging information. These messages will appear in the console if this level is enabled. /// </description> /// </item> /// <item> /// <term>info</term> /// <description>The default logging level; contains basic status information.</description> /// </item> /// <item> /// <term>warn</term> /// <description>Contains warning messages.</description> /// </item> /// <item> /// <term>error</term> /// <description> /// Contains error messages. Typically errors produced on this level will not stop the application. /// </description> /// </item> /// <item> /// <term>fatal</term> /// <description>Fatal error messages; these errors stop the application.</description> /// </item> /// </list> /// Note that the levels are additive; each level contains the messages associated with that level specifically as /// well as all "higher" (more severe) levels. /// </para> /// <para> /// The "-(un)install-service" argument is used to install or uninstall the Windows service. If either of these /// arguments is used, the application performs the requested command and stops. Re-run the application omitting /// the argument to start normally. /// </para> /// <para> /// Any additional arguments will be discarded; the application does not check for, nor does it react to, arguments /// other than those listed above. /// </para> /// </remarks> /// <param name="args">Command line arguments.</param> /// <exception cref="ApplicationArgumentException"> /// Thrown when an error is encountered while parsing and applying command line arguments. /// </exception> /// <exception cref="ApplicationInitializationException"> /// Thrown when an error is encountered while initializing the program. /// </exception> internal static void Main(string[] args) { logger.EnterMethod(xLogger.Params((object)args)); logger.Heading(LogLevel.Info, Assembly.GetExecutingAssembly().GetName().Name + " " + Assembly.GetExecutingAssembly().GetName().Version.ToString(), true); logger.Info("Initializing application..."); try { // process the command line arguments used to start the application logger.Debug($"Program started with {(args.Length > 0 ? "arguments: " + string.Join(", ", args) : "no arguments.")}"); // process the argument array. if the method returns true, the application should exit. this should only happen // when an argument is used to cause the application to perform a maintenance task, such as installing or // uninstalling the Windows service. if (ProcessArguments(args)) { // if we do anything with the service, do it then quit. don't start the application if either argument was used. Console.WriteLine("Press any key to continue..."); Console.ReadLine(); return; } // instantiate the Application Manager. logger.Heading(LogLevel.Debug, "Initialization"); logger.Debug("Instantiating the Application Manager..."); try { applicationManager = ApplicationManager.Instantiate(managers); } catch (Exception ex) { logger.Exception(ex); throw new ApplicationInitializationException("Error instantiating the Program Manager. See the inner exception for details.", ex); } logger.Debug("The Program Manager was instantiated successfully."); // determine whether the application is being run as a Windows service or as a console application and start // accordingly. it is possible to run Windows services on UNIX using mono-service, however this functionality is // currently TBD. if ((PlatformManager.GetPlatformType() == PlatformType.Windows) && (!Environment.UserInteractive)) { logger.Info("Starting the application in service mode..."); ServiceBase.Run(new WindowsService()); } else { logger.Info("Starting the application in interactive mode..."); Start(args); Stop(); } } catch (Exception ex) { logger.Fatal("The application encountered a fatal error."); logger.Exception(LogLevel.Fatal, ex); } finally { logger.ExitMethod(); } }
private static void UpdateXaml2(Dictionary <string, object> dic) { var xamlInfo = new DesignerApiXamlFileInfo(dic); Window window; Control control; using (PlatformManager.DesignerMode()) { var loader = new AvaloniaXamlLoader(); var stream = new MemoryStream(Encoding.UTF8.GetBytes(xamlInfo.Xaml)); Uri baseUri = null; if (xamlInfo.AssemblyPath != null) { //Fabricate fake Uri baseUri = new Uri("resm:Fake.xaml?assembly=" + Path.GetFileNameWithoutExtension(xamlInfo.AssemblyPath)); } var loaded = loader.Load(stream, null, baseUri); var styles = loaded as Styles; if (styles != null) { var substitute = Design.GetPreviewWith(styles) ?? styles.Select(Design.GetPreviewWith).FirstOrDefault(s => s != null); if (substitute != null) { substitute.Styles.AddRange(styles); control = substitute; } else { control = new StackPanel { Children = { new TextBlock { Text = "Styles can't be previewed without Design.PreviewWith. Add" }, new TextBlock { Text = "<Design.PreviewWith>" }, new TextBlock { Text = " <Border Padding=20><!-- YOUR CONTROL FOR PREVIEW HERE--></Border>" }, new TextBlock { Text = "<Design.PreviewWith>" }, new TextBlock { Text = "before setters in your first Style" } } } }; } if (loaded is Application) { control = new TextBlock { Text = "Application can't be previewed in design view" } } ; else { control = (Control)loaded; } window = control as Window; if (window == null) { window = new Window() { Content = (Control)control }; } if (!window.IsSet(Window.SizeToContentProperty)) { window.SizeToContent = SizeToContent.WidthAndHeight; } } s_currentWindow?.Close(); s_currentWindow = window; window.Show(); Design.ApplyDesignerProperties(window, control); // ReSharper disable once PossibleNullReferenceException // Always not null at this point Api.OnWindowCreated?.Invoke(window.PlatformImpl.Handle.Handle); Api.OnResize?.Invoke(); } }
protected override void StringMessageReader(string msg) { string[] deltas = msg.Split('|'); switch (deltas[0]) { // ------------------------------------------------------ GAME STATUS UPDATE ------------------------------------------------------ case "PN": int ToSetID; if (Int32.TryParse(deltas[1], out ToSetID)) { PlayerNumber = ToSetID; ConnectionManager.getInstance().Connected(); IPAddressText.text = "Waiting for players...\n[IP: " + deltas[2] + "]"; } break; case "CN": int PlayerNumb; if (Int32.TryParse(deltas[1], out PlayerNumb)) { ConnectionManager.getInstance().ConnectedPlayer(PlayerNumb); } break; case "ST": DontDestroyOnLoad(gameObject); SceneManager.LoadScene("Game Scene"); SoundsManager.getInstance().StopAllSounds(); Invoke("ActivatePlayer", 1.5f); break; case "RD": int PlayerReady; if (Int32.TryParse(deltas[1], out PlayerReady)) { GameManager.getInstance().SetPlayerReady(PlayerReady); } break; case "PC": PlatformManager.getInstance().SetConfiguration(deltas); break; case "WIN": int WinnerNumb; if (Int32.TryParse(deltas[1], out WinnerNumb)) { GameCanvas.getInstance().transform.GetChild(0).gameObject.SetActive(false); GameCanvas.getInstance().transform.GetChild(1).gameObject.SetActive(false); GameCanvas.getInstance().transform.GetChild(2).gameObject.SetActive(true); GameCanvas.getInstance().transform.GetChild(2).GetChild(WinnerNumb + 1).gameObject.SetActive(true); Time.timeScale = 0f; } break; // ------------------------------------------------------ PLAYERS POSITIONS UPDATE ------------------------------------------------------ case "SBP": if (PlayerNumber != 0) { NPCPlayers[0].UpdatePosition(float.Parse(deltas[1]), float.Parse(deltas[2]), float.Parse(deltas[3])); } break; case "SEP": if (PlayerNumber != 1) { NPCPlayers[1].UpdatePosition(float.Parse(deltas[1]), float.Parse(deltas[2]), float.Parse(deltas[3])); } break; case "SLP": if (PlayerNumber != 2) { NPCPlayers[2].UpdatePosition(float.Parse(deltas[1]), float.Parse(deltas[2]), float.Parse(deltas[3])); } break; case "SSP": if (PlayerNumber != 3) { NPCPlayers[3].UpdatePosition(float.Parse(deltas[1]), float.Parse(deltas[2]), float.Parse(deltas[3])); } break; // ------------------------------------------------------ POWERS STATUS UPDATE ------------------------------------------------------ case "PWR": int SelectedPower; if (Int32.TryParse(deltas[1], out SelectedPower)) { PowerUpsManager.getInstance().Warning(SelectedPower, float.Parse(deltas[2]), float.Parse(deltas[3])); } break; case "OBS": int SelectedObstacle; if (Int32.TryParse(deltas[1], out SelectedObstacle)) { ObstaclesManager.getInstance().Warning(SelectedObstacle); } break; // ------------------------------------------------------ POWERS EFFECTS ------------------------------------------------------ case "FP": int FirePowerSafePlayer; if (Int32.TryParse(deltas[1], out FirePowerSafePlayer)) { PowerUpsManager.getInstance().transform.GetChild(1).gameObject.SetActive(false); GameCanvas.getInstance().transform.GetChild(3).GetChild(5).gameObject.SetActive(false); for (int i = 0; i < 4; i++) { if (i != FirePowerSafePlayer) { if (i == PlayerNumber) { GameManager.getInstance().transform.GetChild(3).GetChild(i).GetComponent <BaseController>().SetOnFire(); } else { GameManager.getInstance().transform.GetChild(3).GetChild(i).GetComponent <NPCController>().SetOnFire(); } } } } break; case "IP": int IcePowerSafePlayer; if (Int32.TryParse(deltas[1], out IcePowerSafePlayer)) { PowerUpsManager.getInstance().transform.GetChild(0).gameObject.SetActive(false); GameCanvas.getInstance().transform.GetChild(3).GetChild(5).gameObject.SetActive(false); for (int i = 0; i < 4; i++) { if (i != IcePowerSafePlayer) { if (i == PlayerNumber) { GameManager.getInstance().transform.GetChild(3).GetChild(i).GetComponent <BaseController>().SetFrozen(); } else { GameManager.getInstance().transform.GetChild(3).GetChild(i).GetComponent <NPCController>().SetFrozen(); } } } } break; case "CP": int ConfusionPowerSafePlayer; if (Int32.TryParse(deltas[1], out ConfusionPowerSafePlayer)) { PowerUpsManager.getInstance().transform.GetChild(2).gameObject.SetActive(false); GameCanvas.getInstance().transform.GetChild(3).GetChild(5).gameObject.SetActive(false); for (int i = 0; i < 4; i++) { if (i != ConfusionPowerSafePlayer) { if (i == PlayerNumber) { GameManager.getInstance().transform.GetChild(3).GetChild(i).GetComponent <BaseController>().SetConfused(); } else { GameManager.getInstance().transform.GetChild(3).GetChild(i).GetComponent <NPCController>().SetConfused(); } } } } break; case "BP": int BouncePowerSafePlayer; if (Int32.TryParse(deltas[1], out BouncePowerSafePlayer)) { PowerUpsManager.getInstance().transform.GetChild(3).gameObject.SetActive(false); GameCanvas.getInstance().transform.GetChild(3).GetChild(5).gameObject.SetActive(false); for (int i = 0; i < 4; i++) { if (i != BouncePowerSafePlayer) { if (i == PlayerNumber) { GameManager.getInstance().transform.GetChild(3).GetChild(i).GetComponent <BaseController>().SetBounce(); } else { GameManager.getInstance().transform.GetChild(3).GetChild(i).GetComponent <NPCController>().SetBounce(); } } } } break; default: Debug.Log("Error - message not recognized: " + msg); break; } }
public void Terminate() { PlatformManager.Terminate(); }
private void PlatformSelect(TableView ignored1, int idx) { PlatformManager.SetPlatformAndShow(idx); Settings.PlayerData.overrideEnvironmentSettings.overrideEnvironments = false; EnvironmentSceneOverrider.SetEnabled(true); }
private void Start() { Platforms = this; GroundTransform = ground; }
public HomeController() { _platformMgr = new PlatformManager(); }
public void LowerPlatforms() { PlatformManager.LowerPlatforms(); }
public static Window LoadDesignerWindow(string xaml, string assemblyPath) { Window window; Control control; using (PlatformManager.DesignerMode()) { var loader = new AvaloniaXamlLoader(); var stream = new MemoryStream(Encoding.UTF8.GetBytes(xaml)); Uri baseUri = null; if (assemblyPath != null) { //Fabricate fake Uri baseUri = new Uri("resm:Fake.xaml?assembly=" + Path.GetFileNameWithoutExtension(assemblyPath)); } var localAsm = assemblyPath != null?Assembly.LoadFile(Path.GetFullPath(assemblyPath)) : null; var loaded = loader.Load(stream, localAsm, null, baseUri); var styles = loaded as Styles; if (styles != null) { var substitute = styles.OfType <Style>().Select(Design.GetPreviewWith).FirstOrDefault(s => s != null); if (substitute != null) { substitute.Styles.AddRange(styles); control = substitute; } else { control = new StackPanel { Children = { new TextBlock { Text = "Styles can't be previewed without Design.PreviewWith. Add" }, new TextBlock { Text = "<Design.PreviewWith>" }, new TextBlock { Text = " <Border Padding=20><!-- YOUR CONTROL FOR PREVIEW HERE--></Border>" }, new TextBlock { Text = "<Design.PreviewWith>" }, new TextBlock { Text = "before setters in your first Style" } } } }; } else if (loaded is Application) { control = new TextBlock { Text = "Application can't be previewed in design view" } } ; else { control = (Control)loaded; } window = control as Window; if (window == null) { window = new Window() { Content = (Control)control }; } if (!window.IsSet(Window.SizeToContentProperty)) { window.SizeToContent = SizeToContent.WidthAndHeight; } } window.Show(); Design.ApplyDesignModeProperties(window, control); return(window); }
/// <summary> /// Initializes a new instance of the <see cref="Window"/> class. /// </summary> public Window() : this(PlatformManager.CreateWindow()) { }
/// <summary> /// Initializes a new instance of the <see cref="Window"/> class. /// </summary> public Window() : base(PlatformManager.CreateWindow()) { _maxPlatformClientSize = this.PlatformImpl.MaxClientSize; }
public TrayIcon() : this(PlatformManager.CreateTrayIcon()) { }
public EmbeddableControlRoot() : base(PlatformManager.CreateEmbeddableWindow()) { }
/// <summary> /// Swapping back to the standard menu environment when the menu is closed<br/> /// [Called by Beat Saber] /// </summary> /// <param name="deactivationType">Type of deactivation</param> protected override void DidDeactivate(DeactivationType deactivationType) { PlatformManager.ChangeToPlatform(0); base.DidDeactivate(deactivationType); }
public void RaisePlatforms() { PlatformManager.RaisePlatforms(); }
void Start() { if(m_oPlatformManager == null) { Debug.LogWarning("m_oPlatformManager not linked"); m_oPlatformManager = GameObject.FindObjectOfType<PlatformManager>(); if(m_oPlatformManager == null) { Debug.LogError("No PlatformManager in the scene"); return; } Debug.Log("Status = " + m_oPlatformManager.GetPlatformStatus()); } m_oInptuManager = GameObject.FindObjectOfType<InputManager>(); if(m_oInptuManager == null) { Debug.LogError("No InputManager in the scene"); } m_fShootingTime = m_oPlatformManager.GetShootingInterval(); m_oTimer = gameObject.AddComponent<Timer>(); m_oTimer.Start(m_fShootingTime, AllowShooting); m_oTransform = this.transform; CreateProjectiles(); m_rigidbody = gameObject.GetComponent<Rigidbody> (); }
void StartFirstPlatform() { firstpPlatformManager = GameObject.Find("PlatformSEStart").GetComponent <PlatformManager>(); }
void Awake() { universeSS = GameObject.FindGameObjectWithTag("Universe").GetComponent<Universe>(); terrainManagerSS = GameObject.Find("TerrainManager").GetComponent<PlatformManager>(); }
// Use this for initialization void Start() { if (pInstance == null) pInstance = this; else if (pInstance != this) Destroy (gameObject); platScaleZ = platform.transform.localScale.z; platScaleX = platform.transform.localScale.x; platformZSize = platformView * platScaleZ; initPlatforms (); print (zStart); print (platformZSize); }
void OnDestroy() { Instance = null; }
private void NewGameButtonClick(object sender, EventArgs e) { this.score = 0; this.myDoodle = new Doodle(); this.platformManager = new PlatformManager(); this.bonusManager = new BonusManager(); this.bulletManager = new BulletManager(); this.enemyManager = new EnemyManager(); this.GameControlPanel.Visible = false; this.MainTimer.Start(); }
void Awake() { Instance = this; }
// Use this for initialization void Start() { platformManager = GameObject.FindGameObjectWithTag("LevelManager").GetComponent<PlatformManager>(); scoreManager = GameObject.FindGameObjectWithTag("LevelManager").GetComponent<ScoreManager>(); }
private static void SetScalingFactor(double factor) { PlatformManager.SetDesignerScalingFactor(factor); s_currentWindow?.PlatformImpl?.Resize(s_currentWindow.ClientSize); }