void Awake() { enemyMan = GameObject.Find("EnemyManagerGO").GetComponent <EnemyManager>(); profileChanger = Camera.main.GetComponent <PostProcessChange>(); screenFade = blackScreen.GetComponent <Renderer>().material; player = GameObject.Find("Player"); //Make black screen transparent at first blackScreen.SetActive(true); Color fadeColor = screenFade.color; fadeColor.a = 0f; screenFade.color = fadeColor; profileChanger.darkness = false; //Get all zone scripts on gameobjects zones = GameObject.FindObjectsOfType(typeof(Zone)) as Zone[]; //Sort by zone name for easy access/lookup zonesSorted = new Dictionary <ZoneNames, Zone>(); Zone z; for (int i = 0; i < zones.Length; ++i) { z = zones[i].GetComponent <Zone>(); zonesSorted.Add(z.zone, z); } //Set current zone currentZone = zonesSorted[startingZone]; //Assign camera clamp values UpdateCameraClamp(); //Get flag manager flagMan = GameObject.Find("FlagManagerGO").GetComponent <FlagManager>(); instructMan = GameObject.Find("InstructionManagerGO").GetComponent <InstructionManager>(); }
public static void InitFlags() { FlagManager.flags.Clear(); FlagManager.flags.Add(1000, 0); for (int i = 1024; i < 1032; i++) { FlagManager.flags.Add(i, 0); } for (int j = 1032; j < 1040; j++) { FlagManager.flags.Add(j, 0); } for (int k = 1040; k < 1048; k++) { FlagManager.flags.Add(k, 0); } for (int l = 1048; l < 1064; l++) { FlagManager.flags.Add(l, 0); } FlagManager.flags.Add(1064, 0); //FlagManager.SetFlag(MissionManager.MainLineFlag, MissionManager.MainLineFlagInitValue, true); //FlagManager.SetFlag(MissionManager.BranchLineToggleFlag, MissionManager.BranchLineToggleFlagInitValue, true); FlagManager.InitMapFlag(); FlagManager.Init2DCutsceneFlag(); PlayerTeam.Instance.InitPlayerTeamFlags(); FlagManager.SetFlag(4, 0, true); FlagManager.SetFlag(3, 0, true); FlagManager.SetFlag(6, 1, true); FlagManager.SetFlag(7, 0, true); }
// Update is called once per frame void Update() { if (FlagManager.GetFlag(key) == value) { Trigger(); } }
void TryCapture(Transform other) { try { if (other.gameObject.transform.root.gameObject.GetComponent <FlagManager>().hasFlag) { other.gameObject.transform.root.gameObject.GetComponent <FlagManager>().hasFlag = false; Transform[] allChildren = other.gameObject.transform.root.gameObject.GetComponentsInChildren <Transform>(); foreach (Transform child in allChildren) { if (child.tag == "Flag") { Destroy(child.gameObject); } } if (other.gameObject.transform.root.tag == "aiTeam1") { scoreBoard.UpdateCaptures(1); } else { scoreBoard.UpdateCaptures(2); } FlagManager flagManager = other.gameObject.transform.root.gameObject.GetComponent <FlagManager>(); flagManager.ReturnFlag(); flagManager.WaypointManager.GetComponent <FlagWaypoints>().SetLocationState(LocationState.goToFlag); } } catch { } }
public AppSettingsWindow() { InitializeComponent(); Icon = Properties.Resources.BrickStudioIcon; StartupTab = SettingTab.LddEnvironment; FlagManager = new FlagManager(); }
// Use this for initialization void Start() { GameObject code = GameObject.Find("/SourceCode"); GameObject guideText = GameObject.Find("/Canvas/GuideText"); string source = Resources.Load <TextAsset>("source").text; float slideDistance = 9.5f; float slideDuration = 60.0f; if (FlagManager.getSeeScene("good") >= 1) { foreach (string e in emphasizeList) { source = source.Replace(e, "<color=#ff7c5e>" + e + "</color>"); } slideDistance = 7.0f; slideDuration = 10.0f; } code.GetComponent <TextMesh>().text = source; StartCoroutine(DelayMethod(0.8f, () => { SlideText st = code.GetComponent <SlideText>(); st.Slide(slideDistance, slideDuration); })); StartCoroutine(DelayMethod(slideDuration + 4.0f, () => { BlinkTextMesh btm = guideText.GetComponent <BlinkTextMesh>(); btm.Blink(); })); }
void Awake() { Debug.Log("awoke"); //Check if instance already exists if (instance == null) { Debug.Log("Instantiating gm"); //if not, set instance to this instance = this; fm = new FlagManager(); //Make a component maybe? Also don't want this here. } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, // meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } //Sets this to not be destroyed when reloading scene / Switching scenes DontDestroyOnLoad(gameObject); // VERY IMPORTANT }
private void ProjectTreeView_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { FlagManager.Unset("PreventSelection"); } }
private void InitializeViewComboBox() { using (FlagManager.UseFlag("ViewModeComboBox")) { var viewModes = new List <ViewModeInfo>(); var currentViewMode = ViewModeComboBox.SelectedItem != null ? (NavigationViewMode)ViewModeComboBox.SelectedValue : NavigationViewMode.All; viewModes.Add(new ViewModeInfo(NavigationViewMode.All, ViewModeAll.Text)); viewModes.Add(new ViewModeInfo(NavigationViewMode.Surfaces, ViewModeSurfaces.Text)); if (ProjectManager.IsProjectOpen && CurrentProject.Flexible) { viewModes.Add(new ViewModeInfo(NavigationViewMode.Bones, ViewModeBones.Text)); } else { viewModes.Add(new ViewModeInfo(NavigationViewMode.Collisions, ViewModeCollisions.Text)); viewModes.Add(new ViewModeInfo(NavigationViewMode.Connections, ViewModeConnections.Text)); } ViewModeComboBox.DataSource = viewModes; ViewModeComboBox.ValueMember = "ViewMode"; ViewModeComboBox.DisplayMember = "DisplayName"; if (viewModes.Any(x => x.ViewMode == currentViewMode)) { currentViewMode = NavigationViewMode.All; } ViewModeComboBox.SelectedValue = currentViewMode; } }
private void InitMacros() { macroMap = new Dictionary <string, MacroFn>() { { "test", (args) => "test" }, { "flag", (args) => FlagManager.GetFlag(args[1]) }, { "color", ColorMacro }, { "c", ColorMacro }, { "img", ImgMacro }, { "control", ControlMacro }, { "goalItem", GoalItemMacro }, { "goalFruitant", GoalFruitantMacro }, { "devourer", DevourerMacro }, { "weather", (args) => FlagManager.GetFlag("goal") == "desert" ? "snowfall" : "rainfall" }, #region Character Name Shortcuts { "soma", (args) => ColorMacro("color", "soma", "Soma") }, { "mana", (args) => ColorMacro("color", "mana", "Mana") }, { "amrita", (args) => ColorMacro("color", "amrita", "Amrita") }, { "nec", (args) => ColorMacro("color", "nec", "Nec") }, { "nectar", (args) => ColorMacro("color", "nec", "Nectar") }, #endregion #region Flavor Name Shortcuts { "spicy", (args) => ColorMacro("color", "spicy", "Spicy") + " " + ImgMacro("img", "IconSpicy") }, { "sweet", (args) => ColorMacro("color", "sweet", "Sweet") + " " + ImgMacro("img", "IconSweet") }, { "bitter", (args) => ColorMacro("color", "bitter", "Bitter") + " " + ImgMacro("img", "IconBitter") }, { "sour", (args) => ColorMacro("color", "sour", "Sour") + " " + ImgMacro("img", "IconSour") }, { "umami", (args) => ColorMacro("color", "umami", "Umami") + " " + ImgMacro("img", "IconUmami") }, { "salty", (args) => ColorMacro("color", "salty", "Salty") + " " + ImgMacro("img", "IconSalty") }, #endregion }; }
private void ViewModeComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (!FlagManager.IsSet("ViewModeComboBox") && ProjectManager.IsProjectOpen) { FilterNavigation(); } }
private void FlexTextBox_Validating(object sender, CancelEventArgs e) { if (FlagManager.IsSet(nameof(FillFlexValues))) { return; } if (!string.IsNullOrEmpty(FlexTextBox.Text)) { var matValues = FlexTextBox.Text.Split(';', ','); if (matValues.Length != 5) { MessageBox.Show("Invalid number of values"); e.Cancel = true; return; } var invalidValues = new List <string>(); for (int i = 0; i < matValues.Length; i++) { if (!Utilities.NumberHelper.SmartTryParse(matValues[i].Trim(), out _)) { invalidValues.Add(matValues[i]); } } if (invalidValues.Any()) { MessageBox.Show($"Invalid values: {string.Join(", ", invalidValues)}"); e.Cancel = true; return; } } }
private void UpdateElementList(bool rebuild) { string prevSelectedID = ElementsComboBox.ComboBox.SelectedValue as string; using (FlagManager.UseFlag(nameof(UpdateElementList))) { if (rebuild || CurrentProject == null) { Connections.Clear(); } if (CurrentProject != null) { var studConnectors = CurrentProject.GetAllElements <PartConnection>(); if (rebuild) { Connections.AddRange(studConnectors); } else { Connections.SyncItems(studConnectors); } } } string currentSelectedID = ElementsComboBox.ComboBox.SelectedValue as string; if (prevSelectedID != currentSelectedID) { SetCurrentObject(ElementsComboBox.SelectedItem as PartConnection, false); } }
public void UpdateMenuItemStates() { using (FlagManager.UseFlag("UpdateMenuItemStates")) { if (SettingsManager.HasInitialized) { File_CreateFromBrickMenu.Enabled = LDDEnvironment.Current?.IsValidInstall ?? false; ExportBrickMenuItem.Enabled = LDDEnvironment.Current?.IsValidInstall ?? false; } else { File_CreateFromBrickMenu.Enabled = false; ExportBrickMenuItem.Enabled = false; } File_SaveMenu.Enabled = ProjectManager.IsProjectOpen; File_SaveAsMenu.Enabled = ProjectManager.IsProjectOpen; File_CloseProjectMenu.Enabled = ProjectManager.IsProjectOpen; Edit_ImportMeshMenu.Enabled = ProjectManager.IsProjectOpen; Edit_ValidatePartMenu.Enabled = ProjectManager.IsProjectOpen; Edit_GenerateFilesMenu.Enabled = ProjectManager.IsProjectOpen; } UpdateUndoRedoMenus(); if (SettingsManager.HasInitialized) { UpdateBuildConfigs(); } }
private void UpdateConnectorList(bool rebuild) { string prevSelectedID = ConnectorComboBox.ComboBox.SelectedValue as string; using (FlagManager.UseFlag("UpdateConnectorList")) { if (rebuild) { Connections.Clear(); } if (CurrentProject != null) { var studConnectors = CurrentProject.GetAllElements <PartConnection>(x => x.ConnectorType == LDD.Primitives.Connectors.ConnectorType.Custom2DField); if (rebuild) { Connections.AddRange(studConnectors); } else { Connections.SyncItems(studConnectors); } } } string currentSelectedID = ConnectorComboBox.ComboBox.SelectedValue as string; if (prevSelectedID != currentSelectedID) { FillSelectedConnector(false); } }
/// <summary> /// Constructor by Account / Id /// </summary> internal GraalPlayer(Framework Server, Int16 Id) { this.Server = Server; this.Id = Id; this.ColorManager = new ColorManager(new ColorManager.dSendColors(SendColors)); this.FlagManager = new FlagManager(new FlagManager.dSendFlag(SendFlag)); }
private void cboMarginEditMode_SelectedIndexChanged(object sender, EventArgs e) { if (!IsLoading && CurrentLayout != null) { if (MarginModified) { CacheCurrentValues(); if (CachedValues.ContainsKey(MarginEditMode.All) && EditMode != MarginEditMode.All) { CachedValues.Remove(MarginEditMode.All); } } EditMode = (MarginEditMode)cboMarginEditMode.SelectedValue; using (FlagManager.UseFlag("ForceRead")) { if (CachedValues.ContainsKey(EditMode)) { ReadCachedValues(); } else { ReadMarginValues(); } } MarginModified = false; SetMarginValues(null); UpdateMarginsUI(); } }
// Start is called before the first frame update void Start() { flagManager = GameObject.Find("FlagManager").GetComponent <FlagManager>(); vcamChange = false; }
// Update is called once per frame void Update() { if (flagManager == null) { flagManager = GameObject.Find("FlagManager").GetComponent <FlagManager>(); } }
// Start is called before the first frame update void Start() { source = GetComponent <CriAtomSource>(); _gururinRb2d = GameObject.Find("Gururin").GetComponent <Rigidbody2D>(); playerMove = GameObject.Find("Gururin").GetComponent <PlayerMove>(); gameController = GameObject.Find("GameController").GetComponent <Gamecontroller>(); flagManager = GameObject.Find("FlagManager").GetComponent <FlagManager>(); _gpQuaternion = gearPos.transform.rotation; for (int i = 0; i < moveGear.Length; i++) { moveGear[i] = true; } //gearCol = gear.GetComponent<PolygonCollider2D>(); if (GetComponent <GanGanKamen.BossHand>() != null) { bossHand = GetComponent <GanGanKamen.BossHand>(); } if (GetComponent <GanGanKamen.BossStageGear>() != null) { stageGear = GetComponent <GanGanKamen.BossStageGear>(); } }
private void Awake() { if (instance == null) { instance = this; } }
private void FillSelectionDetails(PartElement selection) { if (SelectedElement != null) { SelectedElement.PropertyChanged -= SelectedElement_PropertyChanged; SelectedElement = null; } using (FlagManager.UseFlag("FillSelectionDetails")) { FillElementProperties(selection); if (ProjectManager.SelectedElements.Count > 1) { FillStudRefDetails(null); } else { FillStudRefDetails(selection as PartCullingModel); } SelectedElement = selection; if (SelectedElement != null) { SelectedElement.PropertyChanged += SelectedElement_PropertyChanged; } } }
private void OnTriggerEnter2D(Collider2D collision) { if (FlagManager.GetFlag("bossFight") == "true" && BGMManager.instance.CurrBgmSource.clip != music) { BGMManager.instance.CrossFadeBgm(music, 2); } }
// Start is called before the first frame update void Start() { flagManager = GameObject.Find("FlagManager").GetComponent <FlagManager>(); config = GameObject.Find("ConfigCanvas").GetComponent <Configuration>(); //初期設定でコントローラーの非活性化 controllerObject.SetActive(false); /*Arrow_RR.SetActive(false); * Arrow_RB.SetActive(false); * Arrow_LR.SetActive(false); * Arrow_LB.SetActive(false);*/ poslimit.x = 0.12f; poslimit.y = 0.15f; jamp = 0.5f; initial = 10; area = 0.2f; isFlick = false; sensitivity = config.sensitivity; flickdistance = config.flickdistance; controllerposition = config.controllerposition; flick = 0.1f + flickdistance; }
// Start is called before the first frame update void Start() { uiManager_ = UIManager.Instance; flagManager_ = FlagManager.Instance; // If NPC still has dialogue, show it as interactible. UnityAction <FlagManager.EventFlag> checkStillInteractible = new UnityAction <FlagManager.EventFlag>((FlagManager.EventFlag flag) => { if (currTalkableNPC_ == null) { return; } currTalkableNPC_.SetInteractable(currTalkableNPC_.HasAvailableModel()); }); flagManager_.AddListener(checkStillInteractible); uiManager_.Player = this; isWeb = Application.platform != RuntimePlatform.WebGLPlayer; dialogueCompletedCb_ = () => { state_ = PlayerDialogueState.Inactive; return(true); }; }
private void Awake() { if (flagManager == null) { flagManager = FindObjectOfType <FlagManager>(); } }
private void BuildConfigListView_SelectedIndexChanged(object sender, EventArgs e) { if (FlagManager.IsSet(nameof(FillSettings))) { return; } if (FlagManager.IsSet(nameof(SetSelectedBuildConfig))) { return; } if (IsEditingConfig) { SetSelectedBuildConfig(SelectedBuildConfig, false); return; } if (BuildConfigListView.SelectedItems.Count == 1 && BuildConfigListView.SelectedItems[0].Tag is BuildConfiguration config) { SetSelectedBuildConfig(config, true); } //else if (SelectedBuildConfig != null) //{ // SetSelectedBuildConfig(SelectedBuildConfig, false); //} }
/// <summary> /// Initialize any components required by this state. /// </summary> public override void Initialize() { ServiceManager.Game.FormManager.ClearWindow(); Options options = ServiceManager.Game.Options; RendererAssetPool.DrawShadows = GraphicOptions.ShadowMaps; mouseCursor = new MouseCursor(options.KeySettings.Pointer); mouseCursor.EnableCustomCursor(); renderer = ServiceManager.Game.Renderer; fps = new FrameCounter(); Chat = new ChatArea(); Projectiles = new ProjectileManager(); Tiles = new TexturedTileGroupManager(); Utilities = new UtilityManager(); cd = new Countdown(); Lazers = new LazerBeamManager(this); Scene.Add(Lazers, 0); Players = new PlayerManager(); currentGameMode = ServiceManager.Theater.GetCurrentGameMode(); Flags = new FlagManager(); Bases = new BaseManager(); EnvironmentEffects = new EnvironmentEffectManager(); buffbar = new BuffBar(); Scores = new ScoreBoard(currentGameMode, Players); input = new ChatInput(new Vector2(5, ServiceManager.Game.GraphicsDevice.Viewport.Height), 300);//300 is a magic number...Create a chat width variable. input.Visible = false; hud = HUD.GetHudForPlayer(Players.GetLocalPlayer()); localPlayer = Players.GetLocalPlayer(); Scene.MainEntity = localPlayer; sky = ServiceManager.Resources.GetTexture2D("textures\\misc\\background\\sky"); tips = new GameTips(new GameContext(CurrentGameMode, localPlayer)); helpOverlay = new HelpOverlay(); }
// Start is called before the first frame update void Start() { blocking = false; _pushSE = GameObject.Find("SE_item(CriAtomSource)").GetComponent <CriAtomSource>(); _blockSE = GetComponent <CriAtomSource>(); _gameController = GameObject.Find("GameController").GetComponent <Gamecontroller>(); _flagManager = GameObject.Find("FlagManager").GetComponent <FlagManager>(); }
public Option() { gm = GameManager.instance; fm = gm.fm; rarity = 0; rewards = new Option[0] { }; }
// Start is called before the first frame update void Start() { flagManager = GameObject.Find("FlagManager").GetComponent <FlagManager>(); config = GameObject.Find("ConfigCanvas").GetComponent <Configuration>(); button = false; _volumeDown = false; }
/// <summary> /// Constructor /// </summary> internal GraalLevel(Framework Server, String LevelName) { this.Server = Server; this.Name = LevelName; this.FlagManager = new FlagManager(null); }
/// <summary> /// Ensures all references are released. /// </summary> public void Dispose() { players = null; flags = null; bases = null; utilities = null; localPlayer = null; renderTarget = null; texture = null; mapObjectTexture = null; IsDisposed = true; }
void Start() { //オブジェクトのImageを入手 image = gameObject.GetComponent<Image>(); //ステージの番号を取得 stageNum = PlayerPrefs.GetInt("STORY_NUM"); //ステージの番号によって、取得するパスの変更 if (stageNum == 11) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara1-1"; } else { filepath = "Text/RightCharacter/rightChara1-1"; } } else if (stageNum == 12) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara1-2"; } else { filepath = "Text/RightCharacter/rightChara1-2"; } } else if (stageNum == 21) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara2-1"; } else { filepath = "Text/RightCharacter/rightChara2-1"; } } else if (stageNum == 22) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara2-2"; } else { filepath = "Text/RightCharacter/rightChara2-2"; } } else if (stageNum == 31) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara3-1"; } else { filepath = "Text/RightCharacter/rightChara3-1"; } } else if (stageNum == 32) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara3-2"; } else { filepath = "Text/RightCharacter/rightChara3-2"; } } else if (stageNum == 41) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara4-1"; } else { filepath = "Text/RightCharacter/rightChara4-1"; } } else if (stageNum == 42) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara4-2"; } else { filepath = "Text/RightCharacter/rightChara4-2"; } } else if (stageNum == 51) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara5-1"; } else { filepath = "Text/RightCharacter/rightChara5-1"; } } else if (stageNum == 52) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara5-2"; } else { filepath = "Text/RightCharacter/rightChara5-2"; } } else if (stageNum == 53) { if (leftSide == true) { filepath = "Text/LeftCharacter/leftChara5-3"; } else { filepath = "Text/RightCharacter/rightChara5-3"; } } else { filepath = "Text/error"; } // this.read(); //読み込み方法変更 ReadTextData(); flagManager = sentenceTextController.GetComponent<FlagManager>(); //キャラクターのチェンジ if (scenarios[flagManager.clickCounter] == "0") { image.sprite = limpidity; } else if (scenarios[flagManager.clickCounter] == "1") { image.sprite = alice_On; } else if (scenarios[flagManager.clickCounter] == "2") { image.sprite = alice_Off; } else if (scenarios[flagManager.clickCounter] == "3") { image.sprite = aliceSmile_On; } else if (scenarios[flagManager.clickCounter] == "4") { image.sprite = aliceSmile_Off; } else if (scenarios[flagManager.clickCounter] == "5") { image.sprite = aliceAmazing_On; } else if (scenarios[flagManager.clickCounter] == "6") { image.sprite = aliceAmazing_Off; } else if (scenarios[flagManager.clickCounter] == "7") { image.sprite = madHatter_On; } else if (scenarios[flagManager.clickCounter] == "8") { image.sprite = madHatter_Off; } else if (scenarios[flagManager.clickCounter] == "9") { image.sprite = madHatterCrazy_On; } else if (scenarios[flagManager.clickCounter] == "10") { image.sprite = madHatterCrazy_Off; } else if (scenarios[flagManager.clickCounter] == "11") { image.sprite = sisterAlice_On; } else if (scenarios[flagManager.clickCounter] == "12") { image.sprite = sisterAlice_Off; } else if (scenarios[flagManager.clickCounter] == "13") { image.sprite = whiteRabbit_On; } else if (scenarios[flagManager.clickCounter] == "14") { image.sprite = whiteRabbit_Off; } else if (scenarios[flagManager.clickCounter] == "15") { image.sprite = cheshireCat_On; } else if (scenarios[flagManager.clickCounter] == "16") { image.sprite = cheshireCat_Off; } else if (scenarios[flagManager.clickCounter] == "17") { image.sprite = queenOfHeart_On; } else if (scenarios[flagManager.clickCounter] == "18") { image.sprite = queenOfHeart_Off; } else if (scenarios[flagManager.clickCounter] == "19") { image.sprite = queenOfHeartAnger_On; } else if (scenarios[flagManager.clickCounter] == "20") { image.sprite = queenOfHeartAnger_Off; } else if (scenarios[flagManager.clickCounter] == "21") { image.sprite = queenOfHeartPale_On; } else if (scenarios[flagManager.clickCounter] == "22") { image.sprite = queenOfHeartPale_Off; } else if (scenarios[flagManager.clickCounter] == "23") { image.sprite = queenOfHeartSmile_On; } else if (scenarios[flagManager.clickCounter] == "24") { image.sprite = queenOfHeartSmile_Off; } else if (scenarios[flagManager.clickCounter] == "25") { image.sprite = greenCaterpillarOn; } else if (scenarios[flagManager.clickCounter] == "26") { image.sprite = greenCaterpillarOff; } else if (scenarios[flagManager.clickCounter] == "27") { image.sprite = trumpSoldier_On; } else if (scenarios[flagManager.clickCounter] == "28") { image.sprite = trumpSoldier_Off; } }
/// ///////////////////////////////////////////////////////////////////////// void Start() { CameraFade.StartAlphaFade(Color.black, true, 1.0f, 0.5f); int num = PlayerPrefs.GetInt("STORY_NUM"); if (num == 11) { filepath = "Text/Name/name1-1"; } else if (num == 12) { filepath = "Text/Name/name1-2"; } else if (num == 21) { filepath = "Text/Name/name2-1"; } else if (num == 22) { filepath = "Text/Name/name2-2"; } else if (num == 31) { filepath = "Text/Name/name3-1"; } else if (num == 32) { filepath = "Text/Name/name3-2"; } else if (num == 41) { filepath = "Text/Name/name4-1"; } else if (num == 42) { filepath = "Text/Name/name4-2"; } else if (num == 51) { filepath = "Text/Name/name5-1"; } else if (num == 52) { filepath = "Text/Name/name5-2"; } else if (num == 53) { filepath = "Text/Name/name5-3"; } else { filepath = "Text/error"; } //this.read(); ReadTextData(); flagManager = sentenceTextController.GetComponent<FlagManager>(); TextUpdate(); }
public void SetMap(Map map, GamePlayState _state) { currentGameMode = _state.CurrentGameMode; flags = _state.Flags; utilities = _state.Utilities; bases = _state.Bases; try { GraphicsDevice device = Renderer.GraphicOptions.graphics.GraphicsDevice; PresentationParameters pp = device.PresentationParameters; renderTarget = new RenderTarget2D(device, (int)map.Width * miniMapScaleFactor + 2 * miniMapBorderBuffer, (int)map.Height * miniMapScaleFactor + 2 * miniMapBorderBuffer, 1, SurfaceFormat.Color, pp.MultiSampleType, pp.MultiSampleQuality, RenderTargetUsage.PreserveContents); DepthStencilBuffer previousDepth = device.DepthStencilBuffer; device.DepthStencilBuffer = null; device.SetRenderTarget(0, renderTarget); device.Clear(Color.Black); ServiceManager.Game.Batch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.None); Texture2D miniMapDrawer = ServiceManager.Resources.GetTexture2D("textures\\misc\\MiniMap\\wallandbackground"); for (uint x = 0; x < map.Width; x++) { for (uint y = 0; y < map.Height; y++) { Tile tmpTile = map.GetTile(x, y); if (!tmpTile.IsPassable) ServiceManager.Game.Batch.Draw(miniMapDrawer, new Vector2(x * miniMapScaleFactor + miniMapBorderBuffer, y * miniMapScaleFactor + miniMapBorderBuffer), new Rectangle(0, 0, miniMapScaleFactor, miniMapScaleFactor), Color.White); } } ServiceManager.Game.Batch.End(); device.DepthStencilBuffer = previousDepth; device.SetRenderTarget(0, null); texture = renderTarget.GetTexture(); renderTarget = new RenderTarget2D(device, 235, 235, 1, SurfaceFormat.Color, pp.MultiSampleType, pp.MultiSampleQuality, RenderTargetUsage.PreserveContents); } catch (Exception ex) { Console.Error.WriteLine(ex); } }