Esempio n. 1
0
        protected override void Awake()
        {
            base.Awake();

            ClickBegin = new BaseGameEvent();
            ClickEnd   = new BaseGameEvent();
        }
Esempio n. 2
0
 protected override void Awake()
 {
     m_Manager = this;
     manager   = this;
     weaponHit = new BaseGameEvent();
     initCombo();
 }
Esempio n. 3
0
        public bool AddBullet(BaseGameEvent theEvent)
        {
            BulletFiredEvent bulletFired = (BulletFiredEvent)theEvent;

            bullets.Add(bulletFired.Bullet);

            return(true);
        }
Esempio n. 4
0
        protected void Awake()
        {
            base.Awake();

            isDead = new BaseGameEvent();
            isHit  = new GaugeEvent();
            isHeal = new GaugeEvent();
        }
Esempio n. 5
0
        void Awake()
        {
            m_Manager = this;

            onPlay     = new BaseGameEvent();
            onMenu     = new BaseGameEvent();
            onGameOver = new BaseGameEvent();
        }
Esempio n. 6
0
        private void RemoveEntity(BaseGameEvent theEvent)
        {
            ActorRemovedEvent removalEvent = theEvent as ActorRemovedEvent;
            GameEntity entity = removalEvent.DeadEntity;

            if(entity is MovingEntity)
                movingEntityMap.Remove(entity.actorID);
        }
Esempio n. 7
0
        private void AddEntity(BaseGameEvent theEvent)
        {
            ActorCreatedEvent creationEvent = theEvent as ActorCreatedEvent;
            GameEntity entity = creationEvent.NewEntity;

            if(entity is MovingEntity)
                movingEntityMap.Add(entity.actorID, entity as MovingEntity);
        }
Esempio n. 8
0
        private void RemoveEntity(BaseGameEvent theEvent)
        {
            ActorRemovedEvent removalEvent = theEvent as ActorRemovedEvent;
            GameEntity        entity       = removalEvent.DeadEntity;

            if (entity is MovingEntity)
            {
                movingEntityMap.Remove(entity.actorID);
            }
        }
Esempio n. 9
0
        private void AddEntity(BaseGameEvent theEvent)
        {
            ActorCreatedEvent creationEvent = theEvent as ActorCreatedEvent;
            GameEntity        entity        = creationEvent.NewEntity;

            if (entity is MovingEntity)
            {
                movingEntityMap.Add(entity.actorID, entity as MovingEntity);
            }
        }
Esempio n. 10
0
        private void RenewRegion(BaseGameEvent theEvent)
        {
            if (synchronising)
            {
                synchronising = false;

                foreach (Region region in (theEvent as SendingRegionListEvent).CurrentRegionList)
                {
                    AddRegion(region);
                }
            }
        }
Esempio n. 11
0
        public bool AnalyzeCollision(BaseGameEvent theEvent)
        {
            BulletHitMechEvent bulletHit = (BulletHitMechEvent)theEvent;

            if (bulletHit.Mech.mechId == mechId)
            {
                currHp -= bulletHit.Bullet.Damage;
                if (!IsAlive)
                {
                    ScrapWarsEventManager.GetManager().SendEvent(new MechDiedEvent(this));
                }
            }

            return(false);
        }
        public bool MakeSound(BaseGameEvent theEvent)
        {
            SoundEffectInstance sound = null;

            switch (theEvent.EventType)
            {
            case "BulletHitMech":
                sound        = SoundRepo.basicBulletHit.CreateInstance( );
                sound.Volume = 0.01f * (float)Math.Pow(2, ((BulletHitMechEvent)theEvent).Bullet.BulletScale);
                break;

            default:
                sound        = SoundRepo.basicBulletHit.CreateInstance();
                sound.Volume = 0.0f;
                break;
            }

            sound.Play();

            return(false);
        }
Esempio n. 13
0
 public void SendCurrentRegions(BaseGameEvent theEvent)
 {
     SendingRegionListEvent sendingRegionsEvent = new SendingRegionListEvent(new Optional <object>(this),
                                                                             0,
                                                                             regionMap.Values.ToList());
 }
Esempio n. 14
0
        private void AddRegion(BaseGameEvent theEvent)
        {
            Region newRegion = (theEvent as RegionCreatedEvent).Data.newRegion;

            AddRegion(newRegion);
        }
Esempio n. 15
0
 protected virtual void Awake()
 {
     gameEvent = (BaseGameEvent <T>)target;
 }