private void Source_CheckChanged(object sender, RoutedEventArgs e) { if (!_loaded) { return; } if (SourceAuto.IsChecked.HasValue && SourceAuto.IsChecked.Value) { PlayerConfig.Current.Lyric.LyricSource = LyricSource.Auto; } else if (SourceNetease.IsChecked.HasValue && SourceNetease.IsChecked.Value) { PlayerConfig.Current.Lyric.LyricSource = LyricSource.Netease; } else if (SourceKugou.IsChecked.HasValue && SourceKugou.IsChecked.Value) { PlayerConfig.Current.Lyric.LyricSource = LyricSource.Kugou; } else if (SourceQqMusic.IsChecked.HasValue && SourceQqMusic.IsChecked.Value) { PlayerConfig.Current.Lyric.LyricSource = LyricSource.QqMusic; } ReloadLyric(); PlayerConfig.SaveCurrent(); }
/// <summary> /// This function is called when the object becomes enabled and active. /// </summary> void OnEnable() { if (MainMenu == null || MainMenu.CurrentGameMode == null) { return; } var maxPlayers = MainMenu.CurrentGameMode.MaxPlayers; for (byte i = 0; i < players.Length; i++) { var playerConfig = new PlayerConfig(); playerConfig.PlayerID = i; playerConfig.LocalPlayerID = (sbyte)i; playerConfig.Selection.CharacterID = Characters[0].Id; playerConfig.Selection.Pallete = i; players[i].Config = playerConfig; players[i].SetActive(false); players[i].gameObject.SetActive(i < maxPlayers); } var networkManager = NetworkManager.Instance; if (networkManager == null || !networkManager.IsServer) { return; } foreach (var client in networkManager.Server.Clients) { players[client.PlayerID].Config = client.Config; players[client.PlayerID].SetActive(true); } }
void Start() { data = GetComponent <MysqlScript>(); m_player = new PlayerConfig(); m_player = data.GetPlayer(0); //gold lvl attack weaponnormlname m_player.Int_Attack = 10f; m_player.Int_MaxLife = m_player.int_Lvl * 20; Debug.Log("Int_MaxLife" + m_player.Int_MaxLife); m_player.weapon_Normal = m_Weapon[0].weapon_prefab; m_player.weapon_Storing = m_Weapon[6].weapon_prefab; m_player.weapon_Special = m_Weapon[5].weapon_prefab; int_NowMapLevel = 1; Gamelvl = new int[16]; for (int i = 0; i < 16; i++) { Gamelvl[i] = 0; } for (int i = 0; i <= 1; i++) { Gamelvl[i] = 1; } if (m_StaticVal.DisFrame == true) { GetComponent <Frame>().show = true; } }
public void Setup() { _messageProvider = new Mock <IMessageProvider>(); _playerConfig = new PlayerConfig { AskLevel = 10, RespondLevel = 10, Timeout = 11, GameName = "Default", TeamNumber = 1 }; _gameService = new Mock <IGameService>(); _playerState = new PlayerState(_playerConfig); _game = new GameInfo() { BoardSize = new BoardSize { GoalArea = 20, TaskArea = 20, X = 20 } }; _assignedPlayerId = Guid.NewGuid().ToString(); _playerState.Game = _game; _playerState.Id = _assignedPlayerId; _playerState.Board = new Board(_game.BoardSize); }
private void OpenHyperlink(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) { var p = e.Parameter.ToString(); if (p == "later") { Close(); } else if (p == "ignore") { PlayerConfig.Current.IgnoredVer = _release.NewVerString; PlayerConfig.SaveCurrent(); Close(); } else if (p == "update") { UpdateWindow updateWindow = new UpdateWindow(_release, _mainWindow); updateWindow.Show(); Close(); } else { Process.Start(p); } }
private void TextBox_KeyUp(object sender, KeyEventArgs e) { if (e == null) { _holdingCtrl = false; _holdingShift = false; _holdingAlt = false; } else if (e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl) { _holdingCtrl = false; } else if (e.Key == Key.LeftShift || e.Key == Key.RightShift) { _holdingShift = false; } else if (e.Key == Key.LeftAlt || e.Key == Key.RightAlt) { _holdingAlt = false; } var textBox = (TextBox)sender; GetHotKeyValue(textBox); PlayerConfig.SaveCurrent(); }
override public void Reset() { // TODO get player default sens //Program.GameConsole.SendCommand("sensitivity 0.8;"); //Program.GameConsole.SendCommand("exec reset.cfg"); PlayerConfig.ResetConfig(); }
/** * <summary> * Reads the constants from the config * </summary> */ protected override void Setup(PlayerConfig config) { this.maxJumpDuration = config.maxJumpDuration; this.jumpVelocity = config.airJumpStartVelocity; this.gravityDuringJump = config.gravityDuringJump; this.jumpSound = config.jumpSound; }
public MouseControlService( Transform player, MovementEventRepository movementEventRepository, DirectionHelper directionHelper, PickupEventRepository pickupEventRepository, InteractWithNpcEventRepository interactWithNpcEventRepository, NewTextEventRepository newTextEventRepository, FinishDialogueEventRepository finishDialogueEventRepository, InteractWithSceneTransferEventRepository interactWithSceneTransferEventRepository, StartDialogueEventRepository startDialogueEventRepository, PlayerConfig config) { this.movementEventRepository = movementEventRepository ?? throw new ArgumentNullException(nameof(movementEventRepository)); this.directionHelper = directionHelper ?? throw new ArgumentNullException(nameof(directionHelper)); this.pickupEventRepository = pickupEventRepository ?? throw new ArgumentNullException(nameof(pickupEventRepository)); this.player = player; this.newTextEventRepository = newTextEventRepository ?? throw new ArgumentNullException(nameof(newTextEventRepository)); this.finishDialogueEventRepository = finishDialogueEventRepository ?? throw new ArgumentNullException(nameof(finishDialogueEventRepository)); this.interactWithSceneTransferEventRepository = interactWithSceneTransferEventRepository ?? throw new ArgumentNullException(nameof(interactWithSceneTransferEventRepository)); this.startDialogueEventRepository = startDialogueEventRepository; this.interactWithNpcEventRepository = interactWithNpcEventRepository ?? throw new ArgumentNullException(nameof(interactWithNpcEventRepository)); this.config = config ?? throw new ArgumentNullException(nameof(config)); previousPointClicked = new Vector3(0, 0, 0); previousClickDateTime = DateTime.UtcNow; }
private void SaveScore(PlayerConfig p, long value) { var playerConf = p; playerConf.Point = value; playerConf.Save(); }
public Task Initialize(PlayerConfig config, bool isView = false) { States = Instantiate(States); // Create a per-player copy of the builder. StateController = States.BuildCharacterControllerImpl(new StateControllerBuilder()); stateMap = StateController.States.ToDictionary(s => s.Id, s => s); return(Task.WhenAll(stateMap.Values.Select(s => s.Initalize(config, gameObject, isView)).Where(t => t != null))); }
private void Refresh() { if (nameLabel != null) { nameLabel.text = info.baseInfo.name.ToString(); } if (levelLabel != null) { levelLabel.text = ConfigMng.Instance.GetLevelDes((int)info.baseInfo.lev); } if (leaderTag != null) { leaderTag.SetActive((int)info.baseInfo.uid == GameCenter.teamMng.LeaderId); } if (hpSlider != null) { hpSlider.value = info.baseInfo.hp / (float)info.baseInfo.limit_hp; } if (isRobot != null) { isRobot.SetActive(info.baseInfo.robot_state == 1); } PlayerConfig playerConfig = ConfigMng.Instance.GetPlayerConfig((int)info.baseInfo.prof); if (mateIcon != null && playerConfig != null) { mateIcon.spriteName = playerConfig.res_head_Icon; } }
protected override void OnEnter(params object[] objs) { base.OnEnter(objs); if (objs != null && objs.Length > 0) { _moveCallback = (Action <Character>)objs[0]; } else { _moveCallback = null; } m_Animator.SetInteger("Index", (int)E_AnimatorIndex.Moving); _speedCurve = 0; DOTween.To(() => _speedCurve, s => _speedCurve = s, 1, 0.15f); _runAudio = ""; if (m_Owner.GetType().IsAssignableFrom(typeof(Player))) { _runAudio = PlayerConfig.GetData(m_Owner.Id).RunAudio; } else if (m_Owner.GetType().IsAssignableFrom(typeof(Monster))) { _runAudio = PlayerConfig.GetData(m_Owner.Id).RunAudio; } if (!string.IsNullOrEmpty(_runAudio)) { AudioManager.Instance.PlayAudio(_runAudio, null, true); } }
private void Start() { _playerConfig = PlayerConfig.GetConfig(_playerNum); SetColor(_playerConfig.PlayerColor, 0.4f); _playerConfig.PlayerHealth.OnHpChanged += OnHpChanged; }
private void TextBox_KeyUp(object sender, KeyEventArgs e) { if (e == null) { _holdingCtrl = false; _holdingShift = false; _holdingAlt = false; } else { switch (e.Key) { case Key.LeftCtrl: case Key.RightCtrl: _holdingCtrl = false; break; case Key.LeftShift: case Key.RightShift: _holdingShift = false; break; case Key.LeftAlt: case Key.RightAlt: _holdingAlt = false; break; } } var textBox = (TextBox)sender; GetHotKeyValue(textBox); PlayerConfig.SaveCurrent(); }
//initializes level values public void initialize() { damageTaken = 0; damageDealt = 0; numDogsDied = 0; dead = new bool[3] { false, false, false }; newLevel = brrrr.myCoolLevel; playa = brrrr.myCoolPlayer; NMEs = new Queue <EnemyStatsConfig>(newLevel.enemies); dogs = playa.yourTeam; chews = playa.yourPack; background = newLevel.background; backgroundSpriteRenderer = GetComponent <SpriteRenderer>(); backgroundSpriteRenderer.sprite = background; howManyDogs = 0; for (int i = 0; i < dogs.Length; i++) { if (dogs[i] != null) { howManyDogs++; } } }
void Awake() { name = PLAYER_OBJ_NAME; config = GetComponent <PlayerConfig>(); // TODO: Change this to come from player configuration later config.PlayerItemId = (int)PlayerItemLibrary.JUMP; gadgets = GetComponent <PlayerGadgets>(); gadgets.player = this; input = GetComponent <PlayerControls>(); input.GetItemEvent().AddListener(UseItem); Rigidbody = GetComponent <Rigidbody>(); Collider = GetComponentInChildren <BoxCollider>(); Weight = 200; GameObject playerPath = new GameObject(PLAYER_PATH_NAME); PlayerTrailPath = playerPath.AddComponent <Path>(); PlayerTrailPath.rayColor = PLAYER_PATH_COLOR; // TODO: Remove this in the future StartCoroutine(GameSceneManager.Instance.SetUpGameScene()); HeistService.Instance.CreateHeist(); }
void Start() { playerConfig = ConfigManager.main.GetConfig("PlayerConfig") as PlayerConfig; gameConfig = ConfigManager.main.GetConfig("GameConfig") as GameConfig; fireConfig = ConfigManager.main.GetConfig("FireConfig") as FireConfig; playerHandConfig = ConfigManager.main.GetConfig("PlayerHandConfig") as PlayerHandConfig; }
/// <summary> /// 刷新属性信息,以及对比信息 /// </summary> protected void RefreshProperty() { if (curEquipInfo == null) { return; } if (itemGS != null) { // 装备基础战力 + //装备基础战力 * 强化加成比例+装备基础战力*加星加成比例 + //附加属性战力*加星加成比例 + itemGS.text = curEquipInfo.GS.ToString(); } // if (itemLev != null) // itemLev.text = curEquipInfo.ItemStrColor + (curEquipInfo.UpgradeLv > 0?curEquipInfo.UpgradeLv.ToString():""); if (itemProf != null) { PlayerConfig playerConfig = ConfigMng.Instance.GetPlayerConfig(curEquipInfo.NeedProf); bool selfEquip = curEquipInfo.CheckClass(GameCenter.mainPlayerMng.MainPlayerInfo.Prof); string colorStr = selfEquip?"[00ff00]{0}[-]":"[ff0000]{0}[-]"; itemProf.text = playerConfig == null?string.Format(colorStr, ConfigMng.Instance.GetUItext(194)) : string.Format(colorStr, playerConfig.name); } if (itemSlot != null) { itemSlot.text = curEquipInfo.SlotName; } }
// Use this for initialization void Start() { animator = GetComponent <Animator>(); purchaseSelector = GetComponent <PurchaseSelector>(); playerConfig = GameObject.FindObjectOfType <PlayerConfig>(); gameSystem = GameObject.FindObjectOfType <GameSystem>(); }
void Awake() { if (Instance == null) { Instance = this; } }
void Start() { rb = GetComponent <Rigidbody>(); GM = FindObjectOfType <GameManager>(); playerConfig = new PlayerConfig(gameObject); tweenData = new TweenData(); playerConfig.speed = 20; ph_Pointer = transform.Find("ph_pointer").gameObject; body = transform.Find("body").gameObject; ph_pointerRadius = (transform.position - ph_Pointer.transform.position).magnitude; fireDelegate += fireFeedback; fireDelegate += fireProjectile; fireDelegate += () => { windSource.Play(); }; fireDelegate += () => { if (!GM.gameOver) { GM.numberTimesFired++; } }; }
public static bool saveOpponent(string user, string passHash, PlayerConfig playerConfig, PlayerConfig opponentConfig) { WebClient connection = new WebClient(); NameValueCollection postData = new NameValueCollection(); postData["user"] = user; postData["pass"] = security.SHA256(passHash); postData["playerData"] = JsonConvert.SerializeObject(playerConfig); postData["opponentData"] = JsonConvert.SerializeObject(opponentConfig); postData["opponentData_hash"] = security.SHA256(opponentConfig); string response = security.webAPI("saveOpponent", postData); if (response == "3") { Debug.Log("Opponent: Save successful"); return(true); } else { Debug.Log("Opponent: Save NOT successful"); return(false); } }
public void StartM() { mineGraber = grabCollider.GetComponent <Graber>(); mineGraber.isMine = photonView.IsMine; playerConfig = Resources.Load <PlayerConfig>("PlayerConfigData"); audioSource = GetComponent <AudioSource>(); }
/// <summary> /// Initialisiert die Komponente. /// </summary> void Start() { pcc = GetComponentInParent <PlayerConfig> (); goldText = GameObject.Find("txt_gold").GetComponent <Text> (); // Erhoehe Stand der Waehrung jede halbe Sekunde InvokeRepeating("IncreaseGold", 0, 5.0f); // Initialisiere Gegenstaende item0 = GameObject.Find("btn_item_0").GetComponent <Button> (); item0.onClick.AddListener(delegate { UseItem(0); }); item1 = GameObject.Find("btn_item_1").GetComponent <Button> (); item1.onClick.AddListener(delegate { UseItem(1); }); item2 = GameObject.Find("btn_item_2").GetComponent <Button> (); item2.onClick.AddListener(delegate { UseItem(2); }); item4 = GameObject.Find("btn_item_4").GetComponent <Button> (); item4.onClick.AddListener(delegate { UseItem(4); }); item5 = GameObject.Find("btn_item_5").GetComponent <Button> (); item5.onClick.AddListener(delegate { UseItem(5); }); }
/// <summary> /// 设置所属玩家 /// </summary> /// <param name="_player"></param> public void SetPlayer(PlayerBase _player) { player = _player; defaultAbilityList.Clear(); defaultAbilityCount = 0; curDefaultAbilityIndex = 0; if (player == null) { return; } PlayerConfig playerRef = ConfigMng.Instance.GetPlayerConfig(player.Prof); if (playerRef != null) { List <int> list = playerRef.mormalSkillList; foreach (var item in list) { AbilityInstance abilityInstance = new AbilityInstance(item, 1, player, null); defaultAbilityList.Add(abilityInstance); } defaultAbilityCount = defaultAbilityList.Count; curDefaultAbilityIndex = 0; if (playerRef.roundSkill != 0) { roundAbility = new AbilityInstance(playerRef.roundSkill, 1, player, null); } } }
public void Initialize(PlayerConfig playerConfig) { _playerConfig = playerConfig; EventManager.OnPlayerDied += OnPlayerDied; EventManager.OnPlayerHit += OnPlayerHit; _gamePanel.CreateLifesPanel(_playerConfig.HealthPoint); }
private void Start() { _playerConfig = PlayerConfig.GetConfig(_playerNum); _rend.color = _playerConfig.PlayerColor; _playerConfig.PlayerHealth.OnHpChanged += OnHpChanged; _playerConfig.PlayerHealth.OnDeath += OnDeath; }
public void ActivatePunishment() { if (base.CanActivate() == false) { return; } IsThrowing = true; Program.FakeCheat.DisableCSGOESCMenu = true; Task.Run(() => { Thread.Sleep(75); // wait 75ms // Look down SendInput.MouseMove(0, 10000); Program.GameConsole.SendCommand("-forward; -back; -moveleft; -moveright; unbind W; unbind A; unbind S; unbind D"); Thread.Sleep(2000); // unbind for 2 seconds :D PlayerConfig.ResetConfig(); IsThrowing = false; Thread.Sleep(4000); Program.FakeCheat.DisableCSGOESCMenu = false; }); base.AfterActivate(true, this.GetType().Name + "(" + TypeOfNade + ")"); }
public static void LoadTable() { try { configuration = new Dictionary <ulong, PlayerConfig>(); using (MySqlDataReader mySqlDataReader = MySqlHelper.ExecuteReader(Connector.ConnectionString, "SELECT * FROM `players_config`")) { while (mySqlDataReader.Read()) { PlayerConfig player_config = new PlayerConfig() { PlayerID = mySqlDataReader.GetUInt64("PlayerID"), Config = mySqlDataReader.GetInt32("Config"), Blood = mySqlDataReader.GetInt32("Blood"), Visibility = mySqlDataReader.GetInt32("Visibility"), Mao = mySqlDataReader.GetInt32("Mao"), Audio1 = mySqlDataReader.GetInt32("Audio1"), Audio2 = mySqlDataReader.GetInt32("Audio2"), AudioEnable = mySqlDataReader.GetInt32("AudioEnable"), MouseSensitivity = mySqlDataReader.GetInt32("MouseSensitivity"), Vision = mySqlDataReader.GetInt32("Vision"), }; configuration.Add(player_config.PlayerID, player_config); } } Core.Logger.Info("[PLayersConfigTable] Loaded {0} clients configurations", configuration.Count); } catch (Exception ex) { Core.Logger.Error("[Error] {0}", (object)ex); } }
//Each person has their own PlayerConfig, remains through game private void Start() { DontDestroyOnLoad(transform.gameObject); singleton = this; }
private void btnAddPlayer_Click(object sender, System.EventArgs e) { PlayerConfig[] config = new PlayerConfig[Settings.Current.Players.Length + 1]; Array.Copy(Settings.Current.Players, config, Settings.Current.Players.Length); config[Settings.Current.Players.Length] = new PlayerConfig(); Settings.Current.Players = config; cmbPlayerName.Items.Add(config[config.Length - 1].Name); cmbPlayerName.SelectedIndex = config.Length - 1; }