static void Main(string[] args) { try { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Console.Title = Constants.ConsoleTitle; Console.CursorVisible = false; Console.SetWindowSize(Constants.ConsoleWidowsWidth, Constants.ConsoleWindowHeight); DateTime Timer1 = DateTime.Now; Output.WriteHeader(); ConfigurationManager.Initialize(); DatabaseManager.Initialize(); SpacesManager.Initialize(); CatalogManager.Initialize(); ChestManager.Initialize(); SessionsManager.Initialize(); SocketManager.Initialize(); Input.Initialize(); using (DatabaseClient client = DatabaseManager.GetClient()) { client.ExecuteScalar("UPDATE boombang_statics SET Clients=0 WHERE ID = 1"); } Output.WriteLine("Server started seddefully (" + new TimeSpan(DateTime.Now.Ticks + Timer1.Ticks).TotalSeconds + " seconds)! Press the enter key to execute a command."); } catch (Exception ex) { Output.WriteLine("Can't initialize the server. Exception: " + ex.ToString(), OutputLevel.CriticalError); Console.ReadKey(); } }
}; //purple private void Awake() { sprite = GetComponent <SpriteRenderer>(); chestManager = FindObjectOfType <ChestManager>(); healthText = GameObject.Find(gameObject.name + "/Text").GetComponent <TextMeshPro>(); spawnOffset = new Vector3(0, 0.29f, 0); }
protected virtual void OnClear() { Vector3 pos = TileManager.GetPositionInGoundCurrent(); pos = new Vector3Int(Mathf.FloorToInt(pos.x), Mathf.FloorToInt(pos.y), 0) + new Vector3(0.5f, 0.5f, 0); ChestManager.SpawnReWardChest(Data.colorChest, Data.typeChest, pos); PlayerController.PlayerCurrent.setLimitMove(null); }
void Awake() { if (instance != null) { Debug.LogWarning("Что то не то!!!"); return; } instance = this; }
/********* ** Public methods *********/ /// <summary>The mod entry point, called after the mod is first loaded.</summary> /// <param name="helper">Provides simplified APIs for writing mods.</param> public override void Entry(IModHelper helper) { this.Config = this.Helper.ReadConfig <ModConfig>(); this.DialogueManager = new DialogueManager(this.Config, helper.Content, this.Monitor); this.ChestManager = new ChestManager(this.Monitor); helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded; helper.Events.Input.ButtonPressed += this.OnButtonPressed; }
/********* ** Public methods *********/ /// <summary>The mod entry point, called after the mod is first loaded.</summary> /// <param name="helper">Provides simplified APIs for writing mods.</param> public override void Entry(IModHelper helper) { this.Config = this.Helper.ReadConfig <ModConfig>(); this.DialogueManager = new DialogueManager(this.Config, helper.Content, this.Monitor); this.ChestManager = new ChestManager(this.Monitor); SaveEvents.AfterLoad += this.SaveEvents_AfterLoad; ControlEvents.KeyReleased += this.ControlEvents_KeyReleased; }
// Use this for initialization void Start() { chestManager = GetComponent <ChestManager>(); if (chestManager == null) { chestTrigger = GetComponent <ChestTrigger>(); } boatRb = GetComponentInParent <Rigidbody>(); lastVelocity = boatRb.velocity; }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
public void ToggleChest(ChestManager chest) { Start(); if (chest.chestId == -1) { chestId = AddChest(chest); chest.chestId = chestId; } activeInventory = chest.chestInventory; ToggleParent(); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
public void OnBuy(string code) { if (!PermitChoose) { return; } for (int i = 0; i < listElement.Length; i++) { Element a = listElement[i]; if (a.codeName == code) { if (listElement[i].chest != null) { Notification.ReMind(Languages.getString("BanDaMuaLoaiRuongNayRoi")); return; } ColorChest c = ColorChest.Copper; TypeChest t = TypeChest.WeaponCopper; switch (listElement[i].codeName) { case "RuongDong": c = ColorChest.Copper; t = TypeChest.WeaponCopper; break; case "RuongBac": c = ColorChest.Silver; t = TypeChest.WeaponSilver; break; case "RuongVang": c = ColorChest.Gold; t = TypeChest.WeaponGold; break; } if (!Personal.TryToSubDOLA(a.price)) { Notification.ReMind(Languages.getString("MuaThatBai")); break; } a.chest = ChestManager.SpawnStartChest(c, t, CodeMap.Map1, a.positionSpawn.position); if (a.chest != null) { } else { Notification.NoticeBelow(Languages.getString("CoLoiXayRaVoiHanhDongNay")); } break; } } PermitChoose = false; DeShow(); }
// Use this for initialization private void Awake() { inventoryManager = GameObject.FindGameObjectWithTag("InventoryManager"); chestManager = inventoryManager.GetComponent <ChestManager>(); newItem = new ChestManager.ChestItem(); itemGenerator = inventoryManager.GetComponent <ItemGenerator>(); items = new List <ChestManager.ChestItem>(); }
private void LoadData() { Physics2D.IgnoreLayerCollision(LayerMask.NameToLayer("Player"), LayerMask.NameToLayer("Enemy")); SceneManager.sceneLoaded += (Scene, Load) => Languages.UpdateLanguageInScene(); Languages.LanguageCurrent = Languages.Nation.VietNam; Languages.LoadData(); VFXManager.LoadData(); ChestManager.LoadData(); RewardManager.LoadData(); WeaponManager.LoadData(); DataMap.LoadData(); }
private void Awake() { turnCountText = GameObject.Find("Canvas/TurnCount").GetComponent <TextMeshProUGUI>(); resolveCountText = GameObject.Find("Canvas/ResolveCount").GetComponent <TextMeshProUGUI>(); chestManager = FindObjectOfType <ChestManager>(); GridHelper.grid = FindObjectOfType <Grid>(); GridHelper.groundTilemap = GameObject.Find("Environment/Grid/GroundTilemap").GetComponent <Tilemap>(); GridHelper.waterTilemap = GameObject.Find("Environment/Grid/WaterTilemap").GetComponent <Tilemap>(); GridHelper.SetAllTileFlags(); turnCount = 0.5f; }
void Awake() { if (chestManager == null) { chestManager = this.GetComponent <ChestManager>(); chestList.Clear(); } else if (chestManager != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
// Use this for initialization void Start() { Screen.orientation = ScreenOrientation.Landscape; boardScript = GetComponent <BoardManager>(); mainCamera = GetComponent <CameraManager>(); home = GetComponent <HomeManager>(); chest = GetComponent <ChestManager> (); time = GetComponent <TimeManager> (); wave = GetComponent <WaveManager> (); UI = GetComponent <UIManager>(); guard = GetComponent <GuardManager> (); sound = GetComponent <SoundManager> (); bar = GetComponent <BarManager> (); score = GetComponent <ScoreManager> (); InitGame(); }
public void OnPointerDown(PointerEventData eventData) { if (chestData) { if (!chest) { chest = FindObjectOfType <ChestManager>(); } chest.BuildChestUI(chestData); chest.ActivatePanel(); inventoryManager.panelFolder.gameObject.SetActive(true); } else { Debug.LogError("Bau sem dados para montagem"); } }
public override void Initialize() { #if DEBUG Debug.Listeners.Add(new TextWriterTraceListener(Console.Out)); #endif Directory.CreateDirectory("infchests"); _connection = new SqliteConnection($"uri=file://{SqlitePath},Version=3"); _database = new ChestManager(_connection); ServerApi.Hooks.NetGetData.Register(this, OnNetGetData); ServerApi.Hooks.GamePostInitialize.Register(this, OnGamePostInitialize); ServerApi.Hooks.WorldSave.Register(this, OnWorldSave); Commands.ChatCommands.Add(new Command("infchests.chest", ChestCmd, "chest")); Commands.ChatCommands.Add(new Command("infchests.exportchests", ExportChests, "exportchests")); Commands.ChatCommands.Add(new Command("infchests.migratechests", MigrateChests, "migratechests")); }
// Update is called once per frame void Update() { BasicDemoScript demoScript = FindObjectOfType <BasicDemoScript>(); float distanceToWaypoint = Vector3.Distance(this.gameObject.transform.position, Camera.main.transform.position); if (distanceToWaypoint < 1.5 && InFrontOfCamera(Camera.main, this.gameObject) && demoScript.searching && !objectFound) { objectFound = true; demoScript.objectsFound++; Debug.Log(this.gameObject.transform.GetChild(0).name); if (this.gameObject.transform.GetChild(0).name.Contains("ChestContainer")) { Debug.Log("Found Chest Container"); ChestManager chestManager = this.gameObject.transform.GetChild(0).GetComponent <ChestManager>(); Debug.Log("Chest Manager"); chestManager.found = true; Debug.Log("chestmanager found"); return; } InventoryManager inventoryManager = FindObjectOfType <InventoryManager>(); if (this.gameObject.transform.GetChild(0).name.Contains("KeyContainer")) { //inventoryManager.KeyFound(); } else if (this.gameObject.transform.GetChild(0).name.Contains("ShovelContainer")) { //inventoryManager.ShovelFound(); } Animator[] animators = this.gameObject.GetComponentsInChildren <Animator>(); foreach (Animator a in animators) { a.enabled = true; } var renderers = this.gameObject.GetComponentsInChildren <Renderer>(); foreach (Renderer r in renderers) { r.enabled = true; } } }
/********* ** Private methods *********/ private void SaveEvents_AfterLoad(object sender, EventArgs e) { try { this.Config = this.Helper.ReadConfig <ModConfig>(); this.ChestManager = new ChestManager(this.Monitor); if (!Enum.TryParse(this.Config.Keybind, true, out this.ActionKey)) { this.ActionKey = Keys.G; this.Monitor.Log("Error parsing key binding. Defaulted to G"); } ChestManager.ParseChests(this.Config.Chests); } catch (Exception ex) { this.Monitor.Log(ex.ToString(), LogLevel.Error); } }
// Use this for initialization void Start() { speed = 5; gameController = GameObject.Find("_GameManager"); BoardManager bm = gameController.GetComponent <BoardManager> (); house = gameController.GetComponent <HomeManager> ().GetDoor(); columns = bm.GetColumnsDecalage(); rows = bm.GetRowsDecalage(); tabGuard = gameController.GetComponent <GuardManager> ().GetTabGuard(); chestManager = gameController.GetComponent <ChestManager> (); touchMonster = GetComponent <TouchMonster> (); nearGuard = NearGuard(); if (nearGuard.GetComponent <Life> ().GetAlive() == false) { focusGuard = false; focusHome = true; target = house; } else { focusGuard = true; focusHome = false; target = nearGuard.transform.position; } isDead = false; focusOut = false; target = new Vector2((int)target.x, (int)target.y); taille = columns * rows; grid = bm.GetGrid(); col = false; Vector2 start = new Vector2(transform.position.x, transform.position.y); targetOut = start; UpdatePath(start, target); GetPath(start); }
// Start is called before the first frame update void Awake() { instance = this; DontDestroyOnLoad(gameObject); }
/// <summary> /// 플레이어 정보 저장 /// </summary> /// <param name="player"></param> public void Save(PlayerCtrl player, int saveSlot) { #region 저장할때 인벤 정보를 가져온다 //DataManager가 GameManager와 같이 묶여 있어서 //싱글턴처럼 사용 됨 //인벤 정보를 가지고 있지 않는 씬에서 에러 발생 방지 InventoryData invenData = GameObject.FindGameObjectWithTag("INVENTORY").GetComponent <InventoryData>(); ChestManager chestData = GameObject.FindGameObjectWithTag("ChestData").GetComponent <ChestManager>(); #endregion BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(dataPath[saveSlot]); PlayerData saveData = new PlayerData(); #region 레이어 캐릭터 정보 저장 saveData.charName = player.CharName; saveData.nHp = player.NHp; saveData.nMaxHp = player.NMaxHp; saveData.fMana = player.FMana; saveData.fMaxMana = player.FMaxMana; saveData.fThirst = player.FThirst; saveData.fMaxThirst = player.FMaxThirst; saveData.fSatiety = player.FSatiety; saveData.fMaxSatiety = player.FMaxSatiety; saveData.nMaxUpgradeHp = player.NMaxUpgradeHp; saveData.fMaxUpgradeMana = player.FMaxUpgradeMana; saveData.fMaxUpgradeThirst = player.FMaxUpgradeThirst; saveData.fMaxUpgradeSatiety = player.FMaxUpgradeSatiety; saveData.fSpeed = player.FSpeed; saveData.fWeight = player.FWeight; saveData.fMaxWeight = player.FMaxWeight; saveData.nAmmo = player.NAmmo; saveData.nMaxAmmo = player.NMaxAmmo; saveData.nMoney = player.NMoney; saveData.nMaterial = player.NMaterial; saveData.nPartsMaterial = player.NPartsMaterial; saveData.UseSkillMana1 = player.UseMana[0]; saveData.UseSkillMana2 = player.UseMana[1]; saveData.UseSkillMana3 = player.UseMana[2]; saveData.stageClearList = player.StageList; #endregion //세이브를 여러번 하다보면 아이템이 중복 저장 될수 있기 때문에 삭제를 먼저 해준다 #region 저장 슬롯에 저장되어 있는 아이템 정보 초기화 saveData.weaponeParts1_1.Clear(); saveData.weaponeParts1_2.Clear(); saveData.weaponeParts1_3.Clear(); saveData.weaponeParts2_1.Clear(); saveData.weaponeParts2_2.Clear(); saveData.weaponeParts2_3.Clear(); saveData.quickSlot_1.Clear(); saveData.quickSlot_2.Clear(); saveData.quickSlot_3.Clear(); saveData.upgradeSlot.Clear(); saveData.playerBagInven.Clear(); saveData.playerPartsInven.Clear(); saveData.playerSubInven.Clear(); saveData.chestBagInven.Clear(); saveData.chestPartsInven.Clear(); saveData.chestSubInven.Clear(); #endregion #region 슬롯에 있는 아이템 정보 저장 //player BagItemDataSave(saveData.playerBagInven, invenData.BagInvenList); PartsItemDataSave(saveData.playerPartsInven, invenData.PartsInvenList); SubItemDataSave(saveData.playerSubInven, invenData.SubInvenList); //Chest BagItemDataSave(saveData.chestBagInven, chestData.ChestBagInven); PartsItemDataSave(saveData.chestPartsInven, chestData.ChestPartsInven); SubItemDataSave(saveData.chestSubInven, chestData.ChestSubInven); //upgrade PartsItemDataSave(saveData.upgradeSlot, chestData.UpgradeSlot); //Weapone PartsItemDataSave(saveData.weaponeParts1_1, chestData.WeaponePartsSlot1_1); PartsItemDataSave(saveData.weaponeParts1_2, chestData.WeaponePartsSlot1_2); PartsItemDataSave(saveData.weaponeParts1_3, chestData.WeaponePartsSlot1_3); PartsItemDataSave(saveData.weaponeParts2_1, chestData.WeaponePartsSlot2_1); PartsItemDataSave(saveData.weaponeParts2_2, chestData.WeaponePartsSlot2_2); PartsItemDataSave(saveData.weaponeParts2_3, chestData.WeaponePartsSlot2_3); //quick Slot QuickSlotDataSave(saveData.quickSlot_1, chestData.QuickSlot_1); QuickSlotDataSave(saveData.quickSlot_2, chestData.QuickSlot_2); QuickSlotDataSave(saveData.quickSlot_3, chestData.QuickSlot_3); #endregion // Debug.Log("Bag Inven Count : " + saveData.playerBagInven.Count); bf.Serialize(file, saveData); file.Close(); }
// Update is called once per frame void Update() { GameObject player = GameObject.FindWithTag("Player"); foreach (var keymap in directionKeymaps) { if (Input.GetKeyDown(keymap.Key)) { player.GetComponent <Player>().Move(keymap.Value); break; } } foreach (Touch touch in Input.touches) { if (touch.phase == TouchPhase.Ended && !IsTouchOverUIObject(touch)) { // if (touch.phase == TouchPhase.Ended) { ray = Camera.main.ScreenPointToRay(touch.position); CheckArrayOfEnemies(); if (clickedOnEnemy) { clickedOnEnemy = false; } else { // Check if there is an item to be picked up int dx = Mathf.RoundToInt(ray.origin.x - player.transform.position.x); int dy = Mathf.RoundToInt(ray.origin.y - player.transform.position.y); Level level = GameObject.FindWithTag("Level").GetComponent <Level>(); Position clickInLevelPosition = new Position(Mathf.RoundToInt(ray.origin.x), Mathf.RoundToInt(ray.origin.y)); Inventory inventory = GameObject.Find("Inventory").GetComponent <Inventory>(); DroppedItem droppedItem = level.DroppedItemAtPosition(clickInLevelPosition); if (droppedItem != null) { inventory.AddItem(droppedItem.itemID); level.RemoveDroppedItem(clickInLevelPosition); EventLogger eventLogger = GameObject.Find("EventLog").GetComponent <EventLogger>(); eventLogger.ToLog("Picked up " + inventory.database.FetchItemByID(droppedItem.itemID).Title); } else if (level.ChestAtPosition(clickInLevelPosition) != -1) { ChestManager chestManager = GameObject.Find("ChestManager").GetComponent <ChestManager>(); chestManager.SetOpen(true); } else { // If there isn't an item to be picked up, move the player in the cursor direcitiion Direction?direction = new Vector(dx, dy).ToDirection(); if (direction.HasValue) { player.GetComponent <Player> ().Move(direction.Value); } } } } } if (Input.GetMouseButtonDown(0)) { // Read as: If the poiter is NOT on a UI element if (!IsPointerOverUIObject()) { ray = Camera.main.ScreenPointToRay(Input.mousePosition); CheckArrayOfEnemies(); if (clickedOnEnemy) { clickedOnEnemy = false; } else { // Check if there is an item to be picked up int dx = Mathf.RoundToInt(ray.origin.x - player.transform.position.x); int dy = Mathf.RoundToInt(ray.origin.y - player.transform.position.y); Level level = GameObject.FindWithTag("Level").GetComponent <Level>(); Position clickInLevelPosition = new Position(Mathf.RoundToInt(ray.origin.x), Mathf.RoundToInt(ray.origin.y)); Inventory inventory = GameObject.Find("Inventory").GetComponent <Inventory>(); DroppedItem droppedItem = level.DroppedItemAtPosition(clickInLevelPosition); if (droppedItem != null) { inventory.AddItem(droppedItem.itemID); level.RemoveDroppedItem(clickInLevelPosition); EventLogger eventLogger = GameObject.Find("EventLog").GetComponent <EventLogger>(); eventLogger.ToLog("Picked up " + inventory.database.FetchItemByID(droppedItem.itemID).Title); } else if (level.ChestAtPosition(clickInLevelPosition) != -1) { ChestManager chestManager = GameObject.Find("ChestManager").GetComponent <ChestManager>(); chestManager.SetOpen(true); } else { // If there isn't an item to be picked up, move the player in the cursor direcitiion Direction?direction = new Vector(dx, dy).ToDirection(); if (direction.HasValue) { player.GetComponent <Player> ().Move(direction.Value); } } } } } }
public void SearchBegins() { chestManager = FindObjectOfType <ChestManager>(); }
private int AddChest(ChestManager chest) { chests.Add(chest); return(chests.Count - 1); }
public void AdvanceDemo() { switch (currentAppState) { case AppState.DemoStepInit: HideButton(); arTapToPlace.EnableIndicator(true); arTapToPlace.objectToPlace = keyPrefab; currentAppState = AppState.DemoStepPlaceKey; break; case AppState.DemoStepPlaceKey: arTapToPlace.objectToPlace = shovelPrefab; currentAppState = AppState.DemoStepPlaceShovel; break; case AppState.DemoStepPlaceShovel: arTapToPlace.objectToPlace = chestPrefab; currentAppState = AppState.DemoStepPlaceChest; break; case AppState.DemoStepPlaceChest: arTapToPlace.EnableIndicator(false); HideObjects(); ShowButton(); ChestManager chestManager = FindObjectOfType <ChestManager>(); chestManager.placing = false; currentAppState = AppState.DemoStepConfirmPlacement; break; case AppState.DemoStepConfirmPlacement: HideButton(); ShowInventory(); searching = true; arTapToPlace.EnableSelect(true); InventoryManager inventoryManager = FindObjectOfType <InventoryManager>(); inventoryManager.SearchBegins(); currentAppState = AppState.DemoStepSearching; break; case AppState.DemoStepSearching: ShowButton(); HideInventory(); searching = false; arTapToPlace.EnableSelect(false); currentAppState = AppState.DemoStepFoundAllItems; break; case AppState.DemoStepFoundAllItems: HideButton(); readyToOpenChest = true; DisablePlaneColliders(); currentAppState = AppState.DemoStepComplete; break; case AppState.DemoStepComplete: break; default: Debug.Log("Error, got into a bad state " + currentAppState.ToString()); break; } }
// Use this for initialization void Start() { instance = this; openedChests = new bool[chests.Length]; }
void Start() { chestManager = ChestManager.instance; IndexSlot = transform.GetSiblingIndex(); inventory = Inventory.instance; }
public override void SetUp(RoundData roundData) { base.SetUp(roundData); ChestManager.SpawnReWardChest(roundData.colorChest, Data.typeChest, (Vector2)Data.position); }