// Use this for initialization void Start() { textLifes.text = TEXT_LIFES + lifes; StartCoroutine(HeartSpawning()); enemiesManager = FindObjectOfType <EnemiesManager>(); infoPlayer = FindObjectOfType <InfoPlayer>(); }
// Use this for initialization void Start() { StartCoroutine(WaitToChangeScene()); InfoPlayer infoPlayer = FindObjectOfType <InfoPlayer>(); textNbrDie.text = "Nombre de mort " + infoPlayer.GetPlayerDieCount(); }
// Use this for initialization void Start() { StartCoroutine(ChangeScene()); InfoPlayer infoPlayer = FindObjectOfType <InfoPlayer>(); textNbrDie.text = "Nbr deaths : " + infoPlayer.GetPlayerDieCount(); }
private void Awake() { if (Instance != null) { Debug.Log("Multiple instances of InfoPlayer"); } Instance = this; }
// Use this for initialization void Start() { infoPlayer = GameObject.FindObjectOfType <InfoPlayer>(); gameManager = FindObjectOfType <GameManager>(); if (!gameManager.IsMenuScene() && !gameManager.IsDeadScreenScene()) { scoreText = GameObject.FindGameObjectWithTag("ScoreText").GetComponent <Text>(); } }
public Panel(Screen parent, Vector2 position, Texture2D texture, Player player) : base(parent, position, texture) { infoPlayerWindow = new InfoPlayer(parent, new Vector2(MainGame.ScreenX - 200, 5), TexturesManager.Window, player); spellListWindow = new SpellList(parent, new Vector2(MainGame.ScreenX - 500, 5), TexturesManager.Window, player); infoPlayerButton = new Button(position, TexturesManager.InfoButton); spellListButton = new Button(position + new Vector2(0, TexturesManager.SpellButton.Height), TexturesManager.SpellButton); infoPlayerButton.MouseClick += OnInfoPlayerMouseClick; spellListButton.MouseClick += OnSpellListMouseClick; }
/// <summary> /// Обрабатывает JsonResult потому, что требуется указать причину ошибки, а также добавить и созранить InfoPlayer в БД /// </summary> /// <param name="nickname"></param> /// <returns></returns> public async Task <JsonResult> RegisterAsync(string nickname) { if (await context.Players.AnyAsync(x => x.Nickname == nickname)) { return(new JsonResult(new { Success = "nickname exists" })); } var player = new InfoPlayer { Login = Guid.NewGuid().ToString().Replace("-", ""), Nickname = nickname, Wins = 0 }; await context.Players.AddAsync(player); await context.SaveChangesAsync(); return(new JsonResult(new { Success = "ok", Login = player.Login })); }
// Use this for initialization void Start() { gameManager = FindObjectOfType <GameManager>(); if (gameManager == null) { Debug.LogError("A GameManger is missing"); } rigid = GetComponent <Rigidbody2D>(); if (rigid == null) { Debug.LogError("A Rigidbody 2D is missing"); } animatorController = GetComponent <Animator>(); if (animatorController == null) { Debug.LogError("A Animatore is missing"); } healthBarController = GetComponent <HealthBarController>(); if (healthBarController == null) { Debug.LogError("A health bar is missing"); } healthBarController.SetMaxHealth(health); keyController = GetComponent <KeyController>(); if (keyController == null) { Debug.LogError("A key controller is missing"); } playerSoundsManager = GetComponent <PlayerSoundsManager>(); infoPlayer = GameObject.FindObjectOfType <InfoPlayer>(); //the player position is set to the startLevel point rigid.position = GameObject.FindGameObjectWithTag("StartLevel").transform.position; }
// Use this for initialization void Start() { textLifes.text = TEXT_LIFES + lifes; infoPlayer = FindObjectOfType <InfoPlayer>(); }
static void SavePlayerAttribute(InfoPlayer p_attribute, int p_value) { string __key = InfoName.PLAYER.ToString() + p_attribute.ToString(); PlayerPrefs.SetInt(__key, p_value); }
static int LoadPlayerAttribute(InfoPlayer p_attribute) { string __key = InfoName.PLAYER.ToString() + p_attribute.ToString(); return PlayerPrefs.GetInt(__key); }