コード例 #1
0
 void RemoveMapMark()
 {
     // 移除地图显示
     PeMap.CarrierMark mark = new PeMap.CarrierMark();
     mark.carrierController = this;
     PeMap.LabelMgr.Instance.Remove(mark);
 }
コード例 #2
0
        // 初始化其他内容
        protected override void InitOtherThings()
        {
            gameObject.AddComponent <ImpactAtkTriggrer>();

            // 创建 UI
            if (!_attackUICanvas)
            {
                _attackUICanvas = Instantiate(PEVCConfig.instance.canvasObject);
            }

            // 物品操作
            gameObject.AddComponent <ItemScript_Carrier>();
            gameObject.AddComponent <DragItemMousePickCarrier>();

            // 初始化部件引用
            LoadPart(ref _cockpit);
            LoadParts(ref _sideSeats);
            LoadParts(ref _jetExhausts);
            LoadParts(ref _lights);

            // 激活灯光部件
            foreach (var light in _lights)
            {
                light.enabled = true;
            }

            // 激活喷射器组件
            float maxForce = PEVCConfig.instance.maxJetAccelerate * rigidbody.mass;

            foreach (var jet in _jetExhausts)
            {
                jet.Init(this, maxForce / _jetExhausts.Length, _jetExhausts.Length);
                jet.enabled = true;
            }

            // 删除椅子上的人模型
            _cockpit.DestroyHumanModel();
            foreach (var seat in _sideSeats)
            {
                seat.DestroyHumanModel();
            }

            // 添加地图显示
            PeMap.CarrierMark mark = new PeMap.CarrierMark();
            mark.carrierController = this;
            PeMap.LabelMgr.Instance.Add(mark);
        }