Exemple #1
0
 private void InitializeUI()
 {
     _healthBarUI = GuiManager.CreateHealthBarUI();
     _healthBarUI.HealthBarSlider.maxValue = Data.Health;
     _healthBarUI.HealthBarSlider.value    = Data.Health;
     _healthBarUI.CanvasGroup.alpha        = 0;
 }
Exemple #2
0
 public void SetReferences(Animator a, DamagePopup d, HealthBarUI h, StatusEffectOverlays o, Transform UITransform, GameObject abilityTarget)
 {
     animator          = a;
     damagePopup       = d;
     healthBarUI       = h;
     overlays          = o;
     uiTransform       = UITransform;
     tempAbilityTarget = abilityTarget;
 }
Exemple #3
0
 public BarData(HealthBarUI proxy, RectTransform bar, Text text, int maxValue, int startingValue)
 {
     Proxy          = proxy;
     Bar            = bar;
     Text           = text;
     MaxValue       = maxValue;
     DisplayedValue = CurrentValue = startingValue;
     UpdateValue(startingValue);
 }
 private void Start()
 {
     this._healthBarUI = this.GetComponent <HealthBarUI>();
     CharId            = photonView.viewID;
     // Find the user name from profile handler class
     if (photonView.isMine)
     {
         UserName = GameObjectFinder.FindProfileHandler().UserName;
     }
 }
    private void Start()
    {
        Cam         = Camera.main.transform;
        Avatar      = GetComponentInChildren <FakerutoController>();
        health      = maxHealth;
        healthBar   = FindObjectOfType <HealthBarUI>();
        currentItem = GetComponentInChildren <Item>();

        disabler = GetComponent <Disabler>();
        disabler.OnDisableEvent += OnMovementDisabled;
        disabler.OnEnableEvent  += OnMovementEnabled;
    }
Exemple #6
0
 private void SetUpSingleton()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(instance.gameObject);
     }
     else
     {
         Destroy(instance.gameObject);
     }
 }
 public override void OnInspectorGUI()
 {
     if (GUILayout.Button("Set References"))
     {
         BattleActorBase      actor             = target as BattleActorBase;
         Animator             animator          = actor.GetComponent <Animator>();
         DamagePopup          damagePopup       = actor.transform.Find("DamagePopup").GetComponent <DamagePopup>();
         HealthBarUI          healthBarUI       = actor.transform.Find("HealthBarUI").GetComponent <HealthBarUI>();
         StatusEffectOverlays overlays          = actor.transform.Find("StatusEffectOverlays").GetComponent <StatusEffectOverlays>();
         Transform            uit               = actor.transform.Find("UITransform");
         GameObject           tempAbilityTarget = actor.transform.Find("TempAbilityTarget").gameObject;
         actor.SetReferences(animator, damagePopup, healthBarUI, overlays, uit, tempAbilityTarget);
     }
     base.OnInspectorGUI();
 }
Exemple #8
0
    private void Awake()
    {
        player = FindObjectOfType <PlayerController>();
        player.deathHandler = this;

        playerHealthBar = player.GetComponentInChildren <HealthBarUI>();

        equipmentManager            = GetComponent <EquipmentManager>();
        equipmentManager.targetMesh = player.GetComponentInChildren <SkinnedMeshRenderer>();

        InjectInterfaceIntoInteractibles();
        InjectEnemyDependencies();

        GetComponent <SettingsUI>().uiHandler  = this;
        GetComponent <PauseMenuUI>().uiHandler = this;
    }
Exemple #9
0
    public static HealthBarUI CreateHealthBarUI()
    {
        HealthBarUI newUI = Instantiate(Instance.HealthBarUIPrefab, Instance.HealthBarParent);

        return(newUI);
    }
Exemple #10
0
 void Start()
 {
     healthBar = transform.Find("HealthBar")?.GetComponent <HealthBarUI>();
 }
    // Use this for initialization
    void Start()
    {
        healtBar  = GameObject.FindGameObjectWithTag("HealthBarUI").GetComponent <HealthBarUI>();
        sheildBar = GameObject.FindGameObjectWithTag("SheildBarUI").GetComponent <SheildBarUI>();

        curShopState        = ShopState.StatsMenu;
        curIconOpen         = IconType.NONE;
        curSubIconOpen      = SubIconType.NONE;
        subIconsHidden      = true;
        subAbilityDisplayed = false;
        finalCost           = 0;
        flashMaxCount       = 5;
        flashCount          = 0;

        myRect = GetComponent <RectTransform>();

        p1 = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>();

        fullAlpha = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
        noAlpha   = new Vector4(1.0f, 1.0f, 1.0f, 0.0f);

        statsButton     = TopBarUI.transform.GetChild(0).GetComponent <Button>();
        shopButton      = TopBarUI.transform.GetChild(1).GetComponent <Button>();
        upgradesButton  = TopBarUI.transform.GetChild(2).GetComponent <Button>();
        abilitiesButton = TopBarUI.transform.GetChild(3).GetComponent <Button>();

        playerMonetText = playerMoneyUI.GetComponent <Text>();
        buyButton       = buyButtonUI.GetComponent <Image>();

        linkerBar     = infoUI.transform.GetChild(1).GetChild(0).GetComponent <Image>();
        firstSubIcon  = infoUI.transform.GetChild(1).GetChild(1).GetComponent <Image>();
        secondSubIcon = infoUI.transform.GetChild(1).GetChild(2).GetComponent <Image>();

        iconDisplay     = infoUI.transform.GetChild(2).GetComponent <Image>();
        titleInfotext   = infoUI.transform.GetChild(3).GetComponent <Text>();
        titleLvlText    = infoUI.transform.GetChild(4).GetComponent <Text>();
        subTitleText    = infoUI.transform.GetChild(5).GetComponent <Text>();
        subTitleLvlText = infoUI.transform.GetChild(6).GetComponent <Text>();
        descTitleText   = infoUI.transform.GetChild(7).GetComponent <Text>();
        descText        = infoUI.transform.GetChild(8).GetComponent <Text>();
        currencySymbol  = infoUI.transform.GetChild(9).GetComponent <Image>();
        costText        = infoUI.transform.GetChild(10).GetComponent <Text>();
        statsCurText    = infoUI.transform.GetChild(11).GetComponent <Text>();
        statsNextText   = infoUI.transform.GetChild(12).GetComponent <Text>();
        costText.text   = "0";

        titleInfotext.color   = textColor;
        titleLvlText.color    = textColor;
        subTitleText.color    = textColor;
        subTitleLvlText.color = textColor;
        descTitleText.color   = textColor;
        descText.color        = textColor;
        costText.color        = textColor;
        playerMonetText.color = textColor;

        controlsOn = true;

        if (!turnedOn)
        {
            myRect.localPosition = new Vector3(0.0f, minHeight, 0.0f);
        }
    }
Exemple #12
0
 // Start is called before the first frame update
 void Awake()
 {
     instance = this;
 }
 private void OnTextureClick()
 {
     HealthBarUI.changeTex(GetComponent <Image>().sprite);
 }