예제 #1
0
 public void SetData(int id, float time)
 {
     this.id        = id;
     this.startTime = time;
     this.table     = TableBuff.Get(id);
     this.name      = LT.Get(table.nameID);
 }
예제 #2
0
        private void OnTriggerEnter2D(Collider2D collision)
        {
            if (!GameUtil.isInBattle)
            {
                return;
            }

            if (!isInvincible && collision.tag == TagUtil.Virus)
            {
                var crashPoint = (collision.transform.GetUIPos() - mCrashPointRoot.GetUIPos()).normalized * 40;
                ShowCrashPoint(crashPoint);
                UnibusEvent.Unibus.Dispatch(EventAircraft.Get(EventAircraft.Action.Crash));
            }
            else if (collision.tag == TagUtil.Buff)
            {
                var buff = collision.gameObject.GetComponent <Buff>();
                ProxyManager.GetProxy <BuffProxy>().AddBuff(buff.buffID);
                if (TableBuff.Get(buff.buffID).type == 1)
                {
                    AudioManager.PlaySound("buff");
                }
                else
                {
                    AudioManager.PlaySound("debuff");
                }
                buff.ForceRecycle();
            }
        }
예제 #3
0
        public void Reset(int buffID, Vector2 position, Vector2 direction, float speed)
        {
            this.buffID = buffID;
            mDirection  = direction;
            mSpeed      = speed;
            var t = TableBuff.Get(buffID);

            icon.SetSprite(t.icon);
            mCD = t.effectDuration;
            rectTransform.anchoredPosition = position;
            isAlive = true;
            icon.DOKill();
            icon.SetAlpha(1);
        }