Пример #1
0
 protected override void SetPrivates()
 {
     base.SetPrivates();
     PauseMenu           = Instantiator.NewPauseMenu();
     OnRootPreviousScene = Constants.SwipeScene;
     _gridBhv            = GetComponent <GridBhv>();
     _map          = MapsData.EasyMaps[Random.Range(0, MapsData.EasyMaps.Count)];
     _healthBar    = GameObject.Find("HealthBar")?.GetComponent <ResourceBarBhv>();
     _xpBar        = GameObject.Find("XpBar")?.GetComponent <ResourceBarBhv>();
     _fightTitle   = GameObject.Find("FightTitle")?.GetComponent <TMPro.TextMeshPro>();
     _orbHp        = GameObject.Find("Hp")?.GetComponent <OrbBhv>();
     _orbPa        = GameObject.Find("Pa")?.GetComponent <OrbBhv>();
     _orbPm        = GameObject.Find("Pm")?.GetComponent <OrbBhv>();
     _hidePosition = new Vector3(-10.0f, 10.0f, 0.0f);
 }
Пример #2
0
 private void GetPrivates()
 {
     _instantiator = GameObject.Find(Constants.GoSceneBhvName).GetComponent <SceneBhv>().Instantiator;
     if (IsPlayer)
     {
         _orbHp = GameObject.Find("Hp")?.GetComponent <OrbBhv>();
     }
     else
     {
         _healthBar = GameObject.Find("HealthBar")?.GetComponent <ResourceBarBhv>();
     }
     _xpBar = GameObject.Find("XpBar")?.GetComponent <ResourceBarBhv>();
     _level = GameObject.Find("LevelText")?.GetComponent <TMPro.TextMeshPro>();
     _xp    = GameObject.Find("Xp")?.GetComponent <TMPro.TextMeshPro>();
     _gold  = GameObject.Find("Gold")?.GetComponent <TMPro.TextMeshPro>();
     _ressourcePopPosition = new Vector2(0.0f, -2.6f);
 }
Пример #3
0
    private void FirstDisplayJourneyAndCharacterStats()
    {
        _characterSkinContainer = GameObject.Find("CharacterSkinContainer");
        _characterName          = GameObject.Find("CharacterName").GetComponent <TMPro.TextMeshPro>();
        _orbLife         = GameObject.Find("Hp").GetComponent <OrbBhv>();
        _level           = GameObject.Find("LevelText").GetComponent <TMPro.TextMeshPro>();
        _xp              = GameObject.Find("Xp").GetComponent <TMPro.TextMeshPro>();
        _gold            = GameObject.Find("Gold").GetComponent <TMPro.TextMeshPro>();
        _matchPercentage = GameObject.Find("MatchPercentage").GetComponent <TMPro.TextMeshPro>();

        _hoursCircle  = GameObject.Find("HoursCircle");
        _biomePicture = GameObject.Find("BiomePicture").GetComponent <SpriteRenderer>();
        _amPm         = GameObject.Find("AmPm").GetComponent <TMPro.TextMeshPro>();
        _day          = GameObject.Find("Day").GetComponent <TMPro.TextMeshPro>();
        _dayNight     = GameObject.Find("DayNight").GetComponent <SpriteRenderer>();
        _biomeSteps   = GameObject.Find("BiomeSteps").GetComponent <TMPro.TextMeshPro>();

        Instantiator.LoadCharacterSkin(_playerCharacter, _characterSkinContainer);
        _characterName.text = _playerCharacter.Name;
        _orbLife.UpdateContent(_playerCharacter.Hp, _playerCharacter.HpMax, Instantiator, TextType.Hp);
        UpdateDisplayJourneyAndCharacterStats();
    }
Пример #4
0
    public void SetPrivates()
    {
        _fightSceneBhv = GameObject.Find(Constants.GoSceneBhvName).GetComponent <FightSceneBhv>();
        _gridBhv       = GameObject.Find(Constants.GoSceneBhvName).GetComponent <GridBhv>();
        OpponentBhvs   = new List <CharacterBhv>();
        if (Character.IsPlayer)
        {
            int nbOpponents = PlayerPrefs.GetInt(Constants.PpNbOpponents);
            for (int i = 0; i < nbOpponents; ++i)
            {
                OpponentBhvs.Add(GameObject.Find(Constants.GoOpponentName + i).GetComponent <CharacterBhv>());
            }
        }
        else
        {
            OpponentBhvs.Add(GameObject.Find(Constants.GoPlayerName).GetComponent <CharacterBhv>());
            Ai = gameObject.AddComponent <AiBhv>();
            Ai.SetPrivates();
        }

        Instantiator  = _fightSceneBhv.Instantiator;
        SkinContainer = transform.Find("SkinContainer").GetComponent <SkinContainerBhv>();
        for (int i = 0; i < Character.Skills.Count; ++i)
        {
            if (Character.Skills[i] != null)
            {
                Character.Skills[i].Init(this, OpponentBhvs, _gridBhv, i);
            }
        }
        if (Character.IsPlayer)
        {
            _orbPa = GameObject.Find("Pa")?.GetComponent <OrbBhv>();
            _orbPm = GameObject.Find("Pm")?.GetComponent <OrbBhv>();
        }
        Pa = Character.PaMax;
        Pm = Character.PmMax;
    }