public void Update_Player_Stat_Test() { Player_Stat player_Stat = new Player_Stat(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Edit(player_Stat); }
public void Delete_Player_Stat_Test() { Player_Stat player_Stat = new Player_Stat(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Delete(player_Stat); }
void Start() { wander = GetComponent <Wander>(); theAudio = FindObjectOfType <AudioManager>(); thePlayerStat = FindObjectOfType <Player_Stat>(); current_interMWT = inter_MoveWaitTime; }
// Start is called before the first frame update void Start() { animator = GetComponent <Animator>(); thePlayerStat = FindObjectOfType <Player_Stat>(); currentHp = hp; getGold = Random.Range(500, 1000); }
public void Insert_Player_Stat_Test() { Player_Stat player_Stat = new Player_Stat(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); Database_Manipulator manipulator = new Database_Manipulator(); manipulator.Insert(player_Stat); }
private Player_Stat ProjectPlayerStats(List <int> stat_ids) { int rush_yards = 0, pass_yards = 0, receiving_yards = 0, tds = 0, fumbles = 0, interceptions_thrown = 0, tackles = 0, forced_fumbles = 0, interceptions = 0; int sacks = 0; foreach (int id in stat_ids) { Player_Stat stat = GetPlayerStat(id); rush_yards += stat.Rush_Yards; pass_yards += stat.Pass_Yards; receiving_yards += stat.Receiving_Yards; tds += stat.TDs; fumbles += stat.Fumbles; interceptions_thrown += stat.Interceptions_Thrown; tackles += stat.Tackles; sacks += stat.Sacks; forced_fumbles += stat.Forced_Fumbles; interceptions += stat.Interceptions; } rush_yards /= stat_ids.Count; pass_yards /= stat_ids.Count; receiving_yards /= stat_ids.Count; tds /= stat_ids.Count; fumbles /= stat_ids.Count; interceptions_thrown /= stat_ids.Count; tackles /= stat_ids.Count; forced_fumbles /= stat_ids.Count; interceptions /= stat_ids.Count; sacks /= stat_ids.Count; return(new Player_Stat(0, 2016, rush_yards, pass_yards, receiving_yards, tds, fumbles, interceptions_thrown, tackles, sacks, forced_fumbles, interceptions)); }
// Start is called before the first frame update void Start() { instance = this; currentHp = hp; currentMp = mp; currentGage = 0; currentExp = 0; }
// Start is called before the first frame update void Start() { p_stat = GameObject.Find("Player_Manager").GetComponent <Player_Stat>(); hp = GameObject.Find("Hp").GetComponent <Text>(); power = GameObject.Find("Power").GetComponent <Text>(); agility = GameObject.Find("Agility").GetComponent <Text>(); speed = GameObject.Find("Speed").GetComponent <Text>(); Status_Menu = GameObject.Find("Status"); Status_Menu.SetActive(false); }
void Start() { theStat = FindObjectOfType <Player_Stat>(); theNPC = FindObjectOfType <NPCcollisoncheck>(); theDM = FindObjectOfType <Dialog_Manager>(); itemList.Add(new Item(10001, "체력 포션", "체력을 10 회복한다.", Item.ItemType.Use)); itemList.Add(new Item(10002, "SP 포션", "스킬 게이지를 10 채운다.", Item.ItemType.Use)); itemList.Add(new Item(10003, "와인", "레티시아가 좋아하는 와인이다.\n선물하려면 레티시아 근처에서\nG를 누르자.\n먹으면 체력을 10 회복한다.", Item.ItemType.Use)); itemList.Add(new Item(10004, "푸른 방울꽃", "세렌이 좋아하는 꽃이다.\n선물하려면 세렌 근처에서\nG를 누르자.\n먹으면 체력을 10 회복한다.", Item.ItemType.Use)); itemList.Add(new Item(20001, "롱소드", "기본적인 형태의 장검", Item.ItemType.Equip, 3)); itemList.Add(new Item(20101, "레더 아머", "가죽으로 만든 가벼운 방어구", Item.ItemType.Equip, 0, 1)); itemList.Add(new Item(20201, "레티시아의 목걸이", "레티시아가 잃어버린\n목걸이, 다시 가져다 주자.", Item.ItemType.Equip, 0, 1)); }
private void Awake() { enemyStat = GetComponent <Enemy_Stat>(); target = FindObjectOfType <Player_Stat>(); rb = GetComponent <Rigidbody2D>(); if (rb == null) { rb = gameObject.AddComponent <Rigidbody2D>(); } rb.isKinematic = false; rb.gravityScale = 0; rangeAggro = (enemyStat.enemySize == EnemySize.Small) ? Random.Range(20, 30) : Random.Range(15, 25); }
private Player_Stat GetPlayerStat(int id) { string get_stats_command = "SELECT Rush_Yards, Pass_Yards, Receiving_Yards, TDs, Fumbles, Interceptions_Thrown, Tackles, Sacks, Forced_Fumbles, Interceptions FROM Player_Stats WHERE Player_Stat_Id = " + id; SqlCommand command = new SqlCommand(get_stats_command, connection); connection.Open(); var reader = command.ExecuteReader(); reader.Read(); Player_Stat stat = new Player_Stat(0, 2016, reader.GetInt32(0), reader.GetInt32(1), reader.GetInt32(2), reader.GetInt32(3), reader.GetInt32(4), reader.GetInt32(5), reader.GetInt32(6), reader.GetInt32(7), reader.GetInt32(8), reader.GetInt32(9)); connection.Close(); return(stat); }
void Awake() { // # 초기값으로 설정되어야 하는 값들 추가하기 instance = this; healthMax = 100f; RadioActive = 0f; DefaultHealthMax = 100f; DefaultStaminaMax = 100f; Max_Stamina = DefaultStaminaMax; is_Continued_Shot = false; is_Continued_Shot2 = false; ChargingSpeed = 1.2f; criticalDamage = 150f; criticalPercent = 10f; dashCool = 30; DashTime = 0.4f; Burning_DMG = 7f; burningTime = 5f; SkillLimit = 0; }
// Start is called before the first frame update void Start() { TheDM = FindObjectOfType <Dialog_Manager>(); theDB = FindObjectOfType <DataBaseManager>(); theStat = FindObjectOfType <Player_Stat>(); }
// Start is called before the first frame update void Start() { targetSwitch = false; playerstat = GetComponent <Player_Stat>(); playermovement = GetComponent <Player_Movement>(); }
// Start is called before the first frame update void Start() { charactercontroller = GetComponent <CharacterController>(); playerstat = GetComponent <Player_Stat>(); playerin = GetComponent <Player_Input>(); }
void Awake() { P_Move = GameObject.Find("Player_Manager").GetComponent <Player_Move>(); P_Stat = GameObject.Find("Player_Manager").GetComponent <Player_Stat>(); }
// Start is called before the first frame update void Start() { theInven = FindObjectOfType <Inventory>(); theStat = FindObjectOfType <Player_Stat>(); }
void Awake() { G_State = GameObject.Find("Game_Manager").GetComponent <Game_State>(); P_Stat = GameObject.Find("Player_Manager").GetComponent <Player_Stat>(); }
public void CallSave() { theDatabase = FindObjectOfType <DataBaseManager>(); thePlayer = FindObjectOfType <Player_Movement>(); thePlayerStat = FindObjectOfType <Player_Stat>(); theEquip = FindObjectOfType <Equipment>(); theInven = FindObjectOfType <Inventory>(); data.playerX = thePlayer.transform.position.x; data.playerY = thePlayer.transform.position.y; data.playerZ = thePlayer.transform.position.z; data.playerLv = thePlayerStat.character_Lv; data.playerHP = thePlayerStat.hp; data.playerMP = thePlayerStat.mp; data.playerCurrentHP = thePlayerStat.currentHp; data.playerCurrentMP = thePlayerStat.currentMp; data.playerCurrentEXP = thePlayerStat.currentExp; data.playerATK = thePlayerStat.atk; data.playerDEF = thePlayerStat.def; data.added_atk = theEquip.added_atk; data.added_def = theEquip.added_def; data.playerGlod = thePlayerStat.Gold; //호감도 data.favorLetitia = thePlayerStat.favorability_Letitia; data.favorSeren = thePlayerStat.favorability_Seren; data.mapName = thePlayer.currentMapName; //data.sceneName = thePlayer.currentSceneName; //이벤트 기록 data.HasEvent001 = theDatabase.has_event001; data.HasEvent002 = theDatabase.has_event002; data.HasEventLetitia001 = theDatabase.has_eventLetitia001; data.HasEventLetitia002 = theDatabase.has_eventLetitia002; data.HasEventLetitia003 = theDatabase.has_eventLetitia003; data.HasEventLetitia004 = theDatabase.has_eventLetitia004; data.HasEventSeren001 = theDatabase.has_eventSeren001; data.HasEventSeren002 = theDatabase.has_eventSeren002; data.HasEventSeren003 = theDatabase.has_eventSeren003; data.HasEventSeren004 = theDatabase.has_eventSeren004; Debug.Log("기초 데이터 성공"); data.playerItemInventory.Clear(); data.playerItemInventoryCount.Clear(); data.playerEquipItem.Clear(); for (int i = 0; i < theDatabase.var_name.Length; i++) { data.varNameList.Add(theDatabase.var_name[i]); data.varNumberList.Add(theDatabase.var[i]); } for (int i = 0; i < theDatabase.switch_name.Length; i++) { data.swNameList.Add(theDatabase.switch_name[i]); data.swList.Add(theDatabase.switches[i]); } List <Item> itemList = theInven.SaveItem(); for (int i = 0; i < itemList.Count; i++) { Debug.Log("인벤토리의 아이템 저장 완료 : " + itemList[i].itemID); data.playerItemInventory.Add(itemList[i].itemID); data.playerItemInventoryCount.Add(itemList[i].itemCount); } for (int i = 0; i < theEquip.equipItemList.Length; i++) { data.playerEquipItem.Add(theEquip.equipItemList[i].itemID); Debug.Log("장착된 아이템 저장 완료 : " + theEquip.equipItemList[i].itemID); } BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.dataPath + "/SaveFile.dat"); bf.Serialize(file, data); file.Close(); Debug.Log(Application.dataPath + "의 위치에 저장했습니다."); }
// Start is called before the first frame update void Start() { playerstat = player.GetComponent <Player_Stat>(); }
// Start is called before the first frame update void Start() { theStat = FindObjectOfType <Player_Stat>(); }
// Start is called before the first frame update void Start() { thePlayerStat = FindObjectOfType <Player_Stat>(); theAudio = FindObjectOfType <AudioManager>(); }
public void CallLoad() { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.dataPath + "/SaveFile.dat", FileMode.Open); if (file != null && file.Length > 0) { data = (Data)bf.Deserialize(file); theDatabase = FindObjectOfType <DataBaseManager>(); thePlayer = FindObjectOfType <Player_Movement>(); thePlayerStat = FindObjectOfType <Player_Stat>(); theEquip = FindObjectOfType <Equipment>(); theInven = FindObjectOfType <Inventory>(); thePlayer.currentMapName = data.mapName; //thePlayer.currentSceneName = data.sceneName; vector.Set(data.playerX, data.playerY, data.playerZ); thePlayer.transform.position = vector; thePlayerStat.character_Lv = data.playerLv; thePlayerStat.hp = data.playerHP; thePlayerStat.mp = data.playerMP; thePlayerStat.currentHp = data.playerCurrentHP; thePlayerStat.currentMp = data.playerCurrentMP; thePlayerStat.currentExp = data.playerCurrentEXP; thePlayerStat.atk = data.playerATK; thePlayerStat.def = data.playerDEF; thePlayerStat.Gold = data.playerGlod; //호감도 thePlayerStat.favorability_Letitia = data.favorLetitia; thePlayerStat.favorability_Seren = data.favorSeren; theEquip.added_atk = data.added_atk; theEquip.added_def = data.added_def; //이벤트 기록 theDatabase.has_event001 = data.HasEvent001; theDatabase.has_event002 = data.HasEvent002; theDatabase.has_eventLetitia001 = data.HasEventLetitia001; theDatabase.has_eventLetitia002 = data.HasEventLetitia002; theDatabase.has_eventLetitia003 = data.HasEventLetitia003; theDatabase.has_eventLetitia004 = data.HasEventLetitia004; theDatabase.has_eventSeren001 = data.HasEventSeren001; theDatabase.has_eventSeren002 = data.HasEventSeren002; theDatabase.has_eventSeren003 = data.HasEventSeren003; theDatabase.has_eventSeren004 = data.HasEventSeren004; theDatabase.var = data.varNumberList.ToArray(); theDatabase.var_name = data.varNameList.ToArray(); theDatabase.switches = data.swList.ToArray(); theDatabase.switch_name = data.swNameList.ToArray(); for (int i = 0; i < theEquip.equipItemList.Length; i++) { for (int x = 0; x < theDatabase.itemList.Count; x++) { if (data.playerEquipItem[i] == theDatabase.itemList[x].itemID) { theEquip.equipItemList[i] = theDatabase.itemList[x]; Debug.Log("장착된 아이템을 로드했습니다 : " + theEquip.equipItemList[i].itemID); break; } } } List <Item> itemList = new List <Item>(); for (int i = 0; i < data.playerItemInventory.Count; i++) { for (int x = 0; x < theDatabase.itemList.Count; x++) { if (data.playerItemInventory[i] == theDatabase.itemList[x].itemID) { itemList.Add(theDatabase.itemList[x]); Debug.Log("인벤토리 아이템을 로드했습니다 : " + theDatabase.itemList[x].itemID); break; } } } for (int i = 0; i < data.playerItemInventoryCount.Count; i++) { itemList[i].itemCount = data.playerItemInventoryCount[i]; } theInven.LoadItem(itemList); theEquip.ShowText(); RPGGameManager theGM = FindObjectOfType <RPGGameManager>(); theGM.LoadStart(); SceneManager.LoadScene(data.mapName); } else { Debug.Log("저장된 세이브 파일이 없습니다"); } file.Close(); }