BarAnimation baranim; // 슬라이더 움직임 제어를 위한 변수 #endregion public void Init() { allies = GameObject.FindGameObjectsWithTag("Enemy"); enemies = GameObject.FindGameObjectsWithTag("Ally"); battle_manager = GameObject.FindGameObjectWithTag("BattleManager").GetComponent <BattleManager>(); battle_uimanager = battle_manager.GetComponent <BattleUIManager>(); Access_animator = GetComponent <Animator>(); AttackTypeSetting(); #region 슬라이더 UI 초기화 canvas = battle_uimanager.Sliderpool_Pop(this.gameObject); canvas.transform.GetChild(0).GetComponent <Text>().text = Access_charactername; hpslider = canvas.transform.GetChild(2).GetChild(2).GetComponent <Slider>(); hpslider2 = canvas.transform.GetChild(2).GetChild(1).GetComponent <Slider>(); attackslider = canvas.transform.GetChild(1).GetComponent <Slider>(); headupPos = transform.GetChild(0).gameObject; canvas.transform.position = headupPos.transform.position; baranim = GetComponent <BarAnimation>(); baranim.Init(hpslider, hpslider2, attackslider); #endregion Access_State = CharacterState.Idle; main_routine = Idle(); StartCoroutine(main_routine); StartCoroutine(update()); }
void UpdateBar() { if (!PowerBar.enabled) { return; } switch (barAnimation) { case BarAnimation.ToLeft: fillAmount -= (PowerBarSpeed * Time.fixedDeltaTime); break; case BarAnimation.ToRight: fillAmount += (PowerBarSpeed * Time.fixedDeltaTime) - (fillAmount * (PowerBarSpeed / 55)); break; } if (fillAmount >= .9f && barAnimation == BarAnimation.ToRight) { barAnimation = BarAnimation.ToLeft; } else if (fillAmount <= .1 && barAnimation == BarAnimation.ToLeft) { barAnimation = BarAnimation.ToRight; } PowerBar.GetComponent <Image>().fillAmount = fillAmount; }
private void ShowPowerBar() { barAnimation = BarAnimation.ToRight; fillAmount = 0; PowerBar.GetComponent <Image>().fillAmount = fillAmount; PowerBarBg.enabled = true; PowerBar.enabled = true; }
private void Awake() { fadePlane = GameObject.FindGameObjectWithTag("FadeScreen").GetComponent <Image>(); scorchMark = GameObject.FindGameObjectWithTag("ScorchMark").GetComponent <SpriteRenderer>(); resultsUI = GameObject.FindGameObjectWithTag("Results").GetComponent <DropDownMenu>(); endOfDayUI = GameObject.FindGameObjectWithTag("EndOfDay").GetComponent <DropDownMenu>(); endOfWeekUI = GameObject.FindGameObjectWithTag("EndOfWeek").GetComponent <DropDownMenu>(); rightButton = GameObject.FindGameObjectWithTag("RightArrow").GetComponent <SlideInUI>(); leftButton = GameObject.FindGameObjectWithTag("LeftArrow").GetComponent <SlideInUI>(); day = GameObject.FindGameObjectWithTag("DayManager").GetComponent <Day>(); BarAnimation[] statBars = FindObjectsOfType <BarAnimation>(); burnTimeBar = statBars[0]; turningPowerBar = statBars[1]; jetPack = FindObjectOfType <JetPack>(); jCamera = FindObjectOfType <JetpackCamera>(); fadePlane.gameObject.SetActive(true); selectedCatagories = new bool[3]; shop = GetComponent <Shop>(); fireButton = GameObject.FindGameObjectWithTag("FireButton").GetComponent <SlideInUI>(); flyHUD = GameObject.FindGameObjectWithTag("FlyHUD").GetComponent <SlideInUI>(); destinationUI = GameObject.FindGameObjectWithTag("DestinationUI").GetComponent <SlideInUI>(); destinationText = GameObject.FindGameObjectWithTag("DestinationUI").GetComponentInChildren <Text>(); destinationUIDown = GameObject.FindGameObjectWithTag("DestinationUI").GetComponent <DropDownMenu>(); Transform ComponentSelection = GameObject.FindGameObjectWithTag("ComponentSelection").transform; currentStats = GameObject.FindGameObjectWithTag("CurrentStats").GetComponent <DropDownMenu>(); componentsSelection = ComponentSelection.GetComponent <DropDownMenu>(); componentButtons = new RectTransform[3]; componentButtons[0] = ComponentSelection.GetChild(0).GetComponent <RectTransform>(); componentButtons[1] = ComponentSelection.GetChild(1).GetComponent <RectTransform>(); componentButtons[2] = ComponentSelection.GetChild(2).GetComponent <RectTransform>(); scorchMarkStartAlpha = scorchMark.color.a; }
BarAnimation baranim; // 슬라이더 움직임 제어를 위한 변수 #endregion public void Init() { skill = (Skill)GetComponent(Access_skillname); allies = GameObject.FindGameObjectsWithTag("Ally"); enemies = GameObject.FindGameObjectsWithTag("Enemy"); isdead_UI = GameObject.FindGameObjectWithTag("ScreenUI").transform.Find(Access_prefabname).Find("IsDead").gameObject; battle_manager = GameObject.FindGameObjectWithTag("BattleManager").GetComponent <BattleManager>(); battle_uimanager = battle_manager.GetComponent <BattleUIManager>(); Access_animator = GetComponent <Animator>(); AttackTypeSetting(); #region 슬라이더 UI 초기화 canvas = battle_uimanager.Sliderpool_Pop(this.gameObject); hpslider = canvas.transform.Find("HpBar").Find("HpSlider").GetComponent <Slider>(); hpslider2 = canvas.transform.Find("HpBar").Find("HpSlider2").GetComponent <Slider>(); attackslider = canvas.transform.Find("AtkSlider").GetComponent <Slider>(); headupPos = transform.GetChild(0).gameObject; canvas.transform.position = headupPos.transform.position; baranim = GetComponent <BarAnimation>(); baranim.Init(hpslider, hpslider2, attackslider); #endregion #region 스크린 UI 초기화 ((Skill)GetComponent(Access_skillname)).Init(); Transform screenUI = GameObject.FindGameObjectWithTag("ScreenUI").transform.Find(canvas.name); screenUI.gameObject.SetActive(true); screenUI.Find("FaceImage").GetComponent <Image>().overrideSprite = Resources.Load <Sprite>("Sprite/" + Access_faceimage.ToString()); screenUI.Find("SkillImage").GetComponent <Image>().overrideSprite = Resources.Load <Sprite>("Sprite/skillImage" + Access_skillimage.ToString()); #endregion #region 장비 능력치 적용 for (int i = 0; i < Access_equipments.Count; i++) { if (Access_equipment(i) != null) { Access_atkpower += Access_equipment(i).atkpower; Access_atkspeed += Access_equipment(i).atkspeed; Access_defpower += Access_equipment(i).defpower; } } #endregion canvas.transform.GetChild(0).GetComponent <Text>().text = "LV." + Access_level.ToString() + " " + Access_charactername; Access_State = CharacterState.Idle; main_routine = Idle(); StartCoroutine(main_routine); StartCoroutine(update()); }
void Start() { BarChart barChart = GetComponent <BarChart>(); BarAnimation barAnimation = GetComponent <BarAnimation>(); if (barChart != null) { barChart.DataSource.SlideValue("Player 1", "Value 1", Random.value * 20, 3f); barChart.DataSource.SlideValue("Player 2", "Value 1", Random.value * 20, 3f); //barAnimation.Animate(); //float _value = Random.value * 20; //float _time = 4.0f; //string _group = "Player 1"; //string _category = "Value 1"; //barChart.DataSource.SetValue(_group, _category, _value); //barChart.DataSource.SlideValue(_group, _category, _value, _time); } }