コード例 #1
0
ファイル: CAttack.cs プロジェクト: Corff/AgeOfFighters
 // Start is called before the first frame update
 void Start()
 {
     soundAccess         = GameObject.FindWithTag("GameController").GetComponent <SFXController>();
     anim                = GetComponent <Animator>();
     specialAC           = GetComponent <SpecialAttackControl>();
     timer               = Instantiate(timer, new Vector2(100, 100), Quaternion.identity).GetComponent <TimeControl>();
     timer.countDown     = true;
     moveQueue           = new Queue <int>(9);
     lightAttackDamage   = damageArray[0];
     heavyAttackDamage   = damageArray[1];
     rangedAttackDamage  = damageArray[2];
     specialAttackDamage = damageArray[3];
 }
コード例 #2
0
ファイル: Health.cs プロジェクト: LiamDyson/TSE-Project
 void Start()
 {
     accessSP = gameObject.GetComponent <SpecialAttackControl>();
     if (gameObject.tag == "Player")
     {
         healthSlider = GameObject.FindWithTag("PlayerHealth").GetComponent <Slider>();
     }
     else if (gameObject.tag == "Enemy")
     {
         healthSlider = GameObject.FindWithTag("EnemyHealth").GetComponent <Slider>();
     }
     healthSlider.value = health;
     blocking           = GetComponent <Blocking>();
 }
コード例 #3
0
ファイル: Health.cs プロジェクト: Corff/AgeOfFighters
 void Start()
 {
     accessCC = GameObject.FindWithTag("GameController").GetComponent <ComboCounter>();
     accessSP = gameObject.GetComponent <SpecialAttackControl>();
     if (gameObject.tag == "Player")
     {
         healthSlider = GameObject.FindWithTag("PlayerHealth").GetComponent <Slider>();
         fill         = GameObject.FindWithTag("PlayerHealthBar").GetComponent <Image>();
     }
     else if (gameObject.tag == "Enemy")
     {
         healthSlider = GameObject.FindWithTag("EnemyHealth").GetComponent <Slider>();
         fill         = GameObject.FindWithTag("EnemyHealthBar").GetComponent <Image>();
     }
     healthSlider.value = health;
     fill.color         = gradient.Evaluate(healthSlider.normalizedValue); //Changes the health bar colour based on the character's HP
     blocking           = GetComponent <Blocking>();
 }