Ejemplo n.º 1
0
        // ---------------------------------------------
        // Private
        // ---------------------------------------------
        private void TestHitCollision(Vector3 position, CharacterEntity target, bool indicatorOnly)
        {
            if (this.HitIndicator != null)
            {
                this.gameManager.SpawnHitIndicator(this.HitIndicator, position);
            }

            if (indicatorOnly)
            {
                return;
            }

            if (this.comboChain[this.comboStage].SFXHit != null)
            {
                this.GetComponent<AudioSource>().PlayOneShot(this.comboChain[this.comboStage].SFXHit);
            }

            this.ResolveCombat(target.gameObject, target);
            this.allowHit = false;
        }
Ejemplo n.º 2
0
        protected virtual void ResolveCombat(GameObject target, CharacterEntity targetData)
        {
            if (this.hitTest.Contains(target))
            {
                return;
            }

            this.hitTest.Add(target);
            target.GetComponent<StageEntity>().TakeDamage(this.comboChain[this.comboStage].Damage);

            // Combo knockback from force
            if (this.comboChain[this.comboStage].Force > 0)
            {
                Vector3 direction = (target.transform.position - this.transform.position).normalized;
                direction.y = 0;
                target.transform.Translate(direction * this.comboChain[this.comboStage].Force);
            }
        }
Ejemplo n.º 3
0
 // -------------------------------------------------------------------
 // Private
 // -------------------------------------------------------------------
 private void DrawHealthBar(CharacterEntity target, int progressWidth)
 {
     float percent = target.Health / target.MaxHealth;
     var width = (int)(progressWidth * percent);
 
     GUI.DrawTexture(new Rect(this.Border, 0, progressWidth - (this.Border * 2), ProgressHeight), this.EmptyTexture, ScaleMode.StretchToFill);
     if (percent > 0)
     {
         GUI.DrawTexture(new Rect(this.Border, 0, width - (this.Border * 2), ProgressHeight), this.FullTexture, ScaleMode.StretchToFill); 
     }
 
     GUI.DrawTexture(new Rect(0, 0, this.LeftTexture.width, ProgressHeight), this.LeftTexture);
     GUI.DrawTexture(new Rect(progressWidth - this.RightTexture.width, 0, this.RightTexture.width, ProgressHeight), this.RightTexture);
 }
Ejemplo n.º 4
0
 // -------------------------------------------------------------------
 // Protected
 // -------------------------------------------------------------------
 protected override void ResolveCombat(GameObject target, CharacterEntity targetData)
 {
     base.ResolveCombat(target, targetData);
 
     this.CurrentTarget = target;
     this.comboDidHit = true;
 
     if (targetData.IsDead && targetData as Enemy != null)
     {
         this.Score += ((Enemy)targetData).ScoreReward;
     }
 }
Ejemplo n.º 5
0
 public void Start()
 {
     this.host = this.Parent.GetComponent<CharacterEntity>();
 }
Ejemplo n.º 6
0
        protected override void ResolveCombat(GameObject target, CharacterEntity targetData)
        {
            base.ResolveCombat(target, targetData);

            this.comboDidHit = true;
        }