예제 #1
0
        public override void OnTriggerEnter2D(Collider2D col)
        {
//			triggered = !triggered;

//			if (!isTrapOn) {
//				return;
//			}


            SoundManager.Instance.PlayAudioClip("MapEffects/" + audioClipName);

            BattleAgentController ba = col.GetComponent <BattleAgentController> ();

            if (ba is BattlePlayerController)
            {
                ba.InitFightTextDirectionTowards(transform.position);
            }

            if (lifeLoseCoroutine != null)
            {
                StopCoroutine(lifeLoseCoroutine);
            }

            lifeLoseCoroutine = LoseLifeContinous(ba);

            StartCoroutine(lifeLoseCoroutine);
        }
예제 #2
0
        void OnTriggerEnter2D(Collider2D other)
        {
            if (other.GetComponent <Launcher> () != null)
            {
                return;
            }

            Debug.Log("子弹碰到物体");

            StopCoroutine(bulletMoveCoroutine);

            bc2d.enabled = false;

            BattleAgentController ba = other.GetComponent <BattleAgentController> ();

            if (ba != null)
            {
                ba.InitFightTextDirectionTowards(this.transform.position);
                ba.propertyCalculator.InstantPropertyChange(ba, PropertyType.Health, -hurt, false);
                Debug.Log("子弹命中");
            }

            bulletAnimator.SetBool("Play", true);

            StartCoroutine("ColletBulletAfterExplosion");
        }
        private IEnumerator ExcuteAgentPropertyChange(BattleAgentController self)
        {
            float timer = 0f;

            while (timer < duration)
            {
                self.InitFightTextDirectionTowards(self.transform.position);

                self.propertyCalculator.InstantPropertyChange(self, propertyType, skillSourceValue, false);

                propertyChange += skillSourceValue;

                timer += 1f;

                yield return(new WaitForSeconds(1.0f));
            }

            self.propertyCalculator.RemoveAttachedSkill <ConsumablesSkill> (this);
//			self = null;
            Destroy(this.gameObject);
        }