예제 #1
0
 // Use this for initialization
 void Start()
 {
     textLifes.text = TEXT_LIFES + lifes;
     StartCoroutine(HeartSpawning());
     enemiesManager = FindObjectOfType <EnemiesManager>();
     infoPlayer     = FindObjectOfType <InfoPlayer>();
 }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        StartCoroutine(WaitToChangeScene());
        InfoPlayer infoPlayer = FindObjectOfType <InfoPlayer>();

        textNbrDie.text = "Nombre de mort " + infoPlayer.GetPlayerDieCount();
    }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        StartCoroutine(ChangeScene());
        InfoPlayer infoPlayer = FindObjectOfType <InfoPlayer>();

        textNbrDie.text = "Nbr deaths : " + infoPlayer.GetPlayerDieCount();
    }
예제 #4
0
 private void Awake()
 {
     if (Instance != null)
     {
         Debug.Log("Multiple instances of InfoPlayer");
     }
     Instance = this;
 }
예제 #5
0
    // Use this for initialization
    void Start()
    {
        infoPlayer  = GameObject.FindObjectOfType <InfoPlayer>();
        gameManager = FindObjectOfType <GameManager>();

        if (!gameManager.IsMenuScene() && !gameManager.IsDeadScreenScene())
        {
            scoreText = GameObject.FindGameObjectWithTag("ScoreText").GetComponent <Text>();
        }
    }
예제 #6
0
파일: Panel.cs 프로젝트: wiilinkpds/Wotrn
        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;
        }
예제 #7
0
        /// <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 }));
        }
예제 #8
0
    // 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;
    }
예제 #9
0
 // Use this for initialization
 void Start()
 {
     textLifes.text = TEXT_LIFES + lifes;
     infoPlayer     = FindObjectOfType <InfoPlayer>();
 }
예제 #10
0
 static void SavePlayerAttribute(InfoPlayer p_attribute, int p_value)
 {
     string __key = InfoName.PLAYER.ToString() + p_attribute.ToString();
     PlayerPrefs.SetInt(__key, p_value);
 }
예제 #11
0
 static int LoadPlayerAttribute(InfoPlayer p_attribute)
 {
     string __key = InfoName.PLAYER.ToString() + p_attribute.ToString();
     return PlayerPrefs.GetInt(__key);
 }