private void ReceiveDamage(int power) { HitPoint -= power; if (HitPoint < 0) { HitPoint = 0; } DamageTextEffect.Create(gameObject, power); gauge.Refresh(); StageSceneGlobalVariables.Instance.PlayerParty.Combo += 1; int combo = StageSceneGlobalVariables.Instance.PlayerParty.Combo; if (combo >= 2) { ComboText.Create(gameObject, combo); } if (HitPoint == 0) { gameObject.AddComponent <EnemyDeadEraseEffect>(); StageSceneGlobalVariables.Instance.Score += DeadScore; //スコア加算 } }
void Start() { playerPos = GameObject.Find("Player").GetComponent <Transform> (); damageText = GameObject.Find("Main Camera").GetComponent <DamageTextEffect> (); sword = transform.GetChild(1); originalSpeed = moveSpeed; originalHealth = GetComponent <EnemyHealth>().getHealth; }
void Start() { checkenemy = GameObject.Find("RaycastPlayer").GetComponent <CheckEnemy> (); fetchinput = GameObject.Find("Main Camera").GetComponent <FetchInput> (); col = GameObject.Find("Collider").GetComponent <BoxCollider2D> (); swordphysics = GameObject.Find("Sword").GetComponent <SwordPhysics> (); damageText = GameObject.Find("Main Camera").GetComponent <DamageTextEffect>(); player = GameObject.Find("Player").GetComponent <Transform> (); }
/// <summary> /// The unit receives damage. Final damage amount done to the unit is decided by the Unit's ReceiveDamageAction method. /// The unit will get stunned if interruptableByNormalAttack is set to true. /// </summary> public void ReceiveDamage(int damage, Unit attacker, bool nonInterruptive = false) { if (!isInvincible && !isDead) { int realDamage = ReceiveDamageAction(damage, attacker); HP -= realDamage; if (HP <= 0) { Kill(); } else if (!nonInterruptive && interruptableByNormalAttack) { Interrupt(); } DamageTextEffect text = GameObject.Instantiate(damageTextPrefab).GetComponent <DamageTextEffect>(); text.SetPosition(transform.position + Vector3.up * 1); text.SetText(realDamage.ToString()); } }
void Start() { damageText = Camera.main.GetComponent <DamageTextEffect> (); upgrade = Camera.main.GetComponent <UpgradeController> (); gameOver = Camera.main.GetComponent <GameOver> (); }
private void ReceiveDamage(int power) { StageSceneGlobalVariables.Instance.PlayerParty.ReceiveDamage(power); DamageTextEffect.Create(gameObject, power); }
void Start() { damageText = Camera.main.GetComponent <DamageTextEffect> (); mission = Camera.main.GetComponent <MissionController> (); healthSlider = GetComponent <EnemyHealthUI> (); }