/// <summary> 检测第一次打开基地,添加基地所有的引导</summary>
 private void CheckFirstOpenColony()
 {
     TutorialData.AddActiveTutorialID(TutorialData.ColonyID8, false);
     TutorialData.AddActiveTutorialID(TutorialData.ColonyID7, false);
     TutorialData.AddActiveTutorialID(TutorialData.ColonyID6, false);
     TutorialData.AddActiveTutorialID(TutorialData.ColonyID5, false);
     TutorialData.AddActiveTutorialID(TutorialData.ColonyID4, false);
     TutorialData.AddActiveTutorialID(TutorialData.ColonyID3, false);
     TutorialData.AddActiveTutorialID(TutorialData.ColonyID2, false);
     TutorialData.AddActiveTutorialID(TutorialData.ColonyID1, false);
     TutorialData.AddActiveTutorialID(TutorialData.ColonyID0);
 }
    public override bool Operate()
    {
        if (!base.Operate())
        {
            return(false);
        }

        //Debug.Log(this + "operated");

        if (!TutorialData.AddActiveTutorialID(TutorialData.PlantSolarId))
        {
            GameUI.Instance.mPowerPlantSolar.OpenWnd(GetComponent <CSPowerPlantObject>());
        }

        return(true);
    }
    public void OpenWnd(CSRepairObject repMachine)
    {
        Show();
        mRepairMachine = repMachine;
        mMachinePos    = repMachine.GetComponentInParent <PeEntity>().transform.position;

        if (null != PeCreature.Instance && null != PeCreature.Instance.mainPlayer)
        {
            m_PlayerPackageCmpt = PeCreature.Instance.mainPlayer.GetCmpt <PlayerPackageCmpt>();
        }

        if (Pathea.PeGameMgr.IsMulti)
        {
            _net = MapObjNetwork.GetNet(mRepairMachine.m_Entity.ID);
            if (_net != null)
            {
                Net.RequestItemList();
            }
            else
            {
                Debug.LogError("net id is error id = " + mRepairMachine.m_Entity.ID);
            }
            return;
        }
        if (mRepairMachine != null && mRepairMachine.m_Repair != null)
        {
            if (this.mRepairMachine.m_Repair.IsRepairingM)
            {
                if (this.mRepairMachine.m_Repair.onRepairedTimeUp == null)
                {
                    this.mRepairMachine.m_Repair.onRepairedTimeUp = this.RepairComplate;
                }
                if (!mRepairMachine.m_Repair.IsRunning)
                {
                    this.mRepairMachine.m_Repair.CounterToRunning();
                }
            }
            UpdateItem(mRepairMachine.m_Repair.m_Item);
        }
        else
        {
            //lz-2016.08.18 修理机里的东西为空的时候需要更新UI状态
            this.UpdateBtnState();
        }

        TutorialData.AddActiveTutorialID(8);
    }
    public override bool Operate()
    {
        if (!base.Operate())
        {
            return(false);
        }

        if (!TutorialData.AddActiveTutorialID(TutorialData.RepairMachineId))
        {
            CSRepairObject repm = GetComponent <CSRepairObject>();
            if (null != repm && !GameUI.Instance.mRepair.isShow)
            {
                GameUI.Instance.mRepair.OpenWnd(repm);
            }
        }

        return(true);
    }
Exemple #5
0
        /// <summary> 乘客上载具 </summary>
        /// <param name="seatIndex"> 座位序号, -1 表示驾驶舱, 非负值表示普通座位序号 </param>
        public void GetOn(PeEntity entity, int seatIndex)
        {
            VCPBaseSeat seat = null;

            // 驾驶舱
            if (seatIndex < 0)
            {
                seat = _cockpit;

                ChangeOwner(entity);                      // 设置归属者(攻击判定相关)
                ResetHost(entity.Id);                     // 重置主控端

                // 玩家坐上驾驶舱
                if (isPlayerHost)
                {
                    _playerDriving = this;

                    UIDrivingCtrl.Instance.Show(
                        () => maxHp, () => hp, () => maxEnergy, () => energy,
                        () => { var v = rigidbody.velocity; return(Mathf.Sqrt(v.x * v.x + v.z * v.z) * 3.6f); },
                        () => _jetExhausts.Length > 0 ? _jetRestValue : 0);

                    seat.getOffCallback += () =>
                    {
                        _playerDriving = null;
                        UIDrivingCtrl.Instance.Hide();
                        UIDrivingCtrl.Instance.SetWweaponGroupTogglesVisible(false, this);
                        UISightingTelescope.Instance.Show(UISightingTelescope.SightingType.Null);
                    };

                    // 教程
                    TutorialData.AddActiveTutorialID(TutorialData.GetOnVehicle);
                }

                // 驾驶员离开驾驶舱
                seat.getOffCallback += () =>
                {
                    _inputState = OnDriverGetOff(_inputState);

                    _aimEntity    = null;
                    _lockedTarget = null;
                    _timeToLock   = -1f;
                    _isAttackMode = false;
                    DisableAllWeaponControl();

                    //终止撞击伤害技能
                    ActivateImpactDamage(false);
                };

                //单机模式玩家上车直接释放撞击伤害技能
                if (!GameConfig.IsMultiMode || IsController())
                {
                    ActivateImpactDamage(true);
                }
            }
            // 普通座位
            else
            {
                seat = _sideSeats[seatIndex];
            }

            _passengerCount += 1;

            seat.GetOn(entity.GetCmpt <PassengerCmpt>());

            // 当所有乘客都下车, 车的归属恢复默认
            seat.getOffCallback += () =>
            {
                _passengerCount -= 1;
                if (_passengerCount == 0)
                {
                    ChangeOwner(null);
                }
            };
        }