protected sealed override void CreateBaseComponent()
 {
     base.CreateBaseComponent();
     //应该在构造器参数中添加武器集合信息
     _fireControlComponent  = new FireControlComponentBase(this, level);
     _healthShieldComponent = new HealthShieldComponentBase(level, this);
     _shipEventComponent    = new ShipEventComponentBase();
     AddColliderFunction();
 }
        public override void Dispose()
        {
            _physicalBase.OnColliderEnter -= Collider;
            _aiComponent?.Dispose();
            _aiComponent = null;

            _fireControlComponent.Dispose();
            _fireControlComponent = null;

            _healthShieldComponent = null;

            _shipEventComponent = null;

            base.Dispose();
        }
Exemple #3
0
        public FireControlComponentBase(IShipComponentBaseContainer container, FireControlComponentBase clone)
        {
            this.container     = container;
            this.skills        = new List <ISkillContainer>();
            skillcd            = new List <long>();
            this.skillInitList = new List <UserData>();
            this.level         = clone.level;

            foreach (var skillContainer in clone.skills)
            {
                if (skillContainer.Clone() is ISkillContainer weaponBase)
                {
                    this.skills.Add(weaponBase);
                    //Log.Trace("Clone: type:" + weaponBase.GetActorType() + " cd" + weaponBase.GetSkillCd());
                    this.skillcd.Add(0);
                }
            }
            lastframe = DateTime.Now.Ticks;
        }