コード例 #1
0
ファイル: ControllerHelper.cs プロジェクト: zuojiashun/src
    public void InitSetting()
    {
        Client.IGameOption option = Client.ClientGlobal.Instance().gameOption;
        if (option == null)
        {
            return;
        }


        for (int i = (int)AutoRecoverGrid.MedicalType.Hp; i < (int)AutoRecoverGrid.MedicalType.Max; ++i)
        {
            AutoRecoverGrid.MedicalType mtype = (AutoRecoverGrid.MedicalType)i;

            bool select = option.GetInt("MedicalSetting", mtype.ToString(), 1) == 1;

            float value = option.GetInt("MedicalSetting", mtype.ToString() + "value", 50) * 0.01f;

            uint itemid = (uint)option.GetInt("MedicalSetting", mtype.ToString() + "itemid", 0);

            if (!m_dicMedical.ContainsKey(mtype))
            {
                m_dicMedical.Add(mtype, new UseMedicalInfo());
            }

            m_dicMedical[mtype].select       = select;
            m_dicMedical[mtype].Type         = mtype;
            m_dicMedical[mtype].triggerValue = value;
            m_dicMedical[mtype].itemid       = itemid;
        }
    }
コード例 #2
0
    public void Initialize()
    {
        m_maxRideNum = 0;
        m_using_ride = 0;
        m_lstRides   = new List <RideData>();
        Client.IGameOption option = Client.ClientGlobal.Instance().gameOption;
        if (option == null)
        {
            return;
        }
        m_feedItemId = (uint)option.GetInt("MedicalSetting", "RideFeedId", 0);
        if (m_feedItemId != 0)
        {
            m_feedReletion = GameTableManager.Instance.GetGlobalConfig <uint>("FeedItemRide", m_feedItemId.ToString());
        }


        string strRide_Feed_Interval = GameTableManager.Instance.GetGlobalConfig <string>("Ride_Feed_Interval");

        if (!string.IsNullOrEmpty(strRide_Feed_Interval))
        {
            float.TryParse(strRide_Feed_Interval, out m_fRide_Feed_Interval);
        }
        RegisterEvent(true);
    }
コード例 #3
0
    public void Init(GameObject go)
    {
        m_arrowObj = go;
        Client.IGameOption option = Client.ClientGlobal.Instance().gameOption;
        if (option != null && m_nStandTime == 0)
        {
            m_nStandTime = option.GetInt("UI", "TaskRoleStandTime", 3);
        }

        if (option != null)
        {
            m_nignoreLevel = option.GetInt("UI", "TaskTipIgnoreLevel", 30);
            if (m_nignoreLevel <= MainPlayerHelper.GetPlayerLevel())
            {
                ResetArrow();
                return;
            }
        }



        RegisterEvent(true);

        ResetArrow();
        if (CheckCondition())
        {
            SetTime();
        }
    }
コード例 #4
0
 public void SetFeedConfig(uint feedid)
 {
     m_feedItemId = feedid;
     Client.IGameOption option = Client.ClientGlobal.Instance().gameOption;
     if (option == null)
     {
         return;
     }
     option.WriteInt("MedicalSetting", "RideFeedId", (int)m_feedItemId);
     m_feedReletion = GameTableManager.Instance.GetGlobalConfig <uint>("FeedItemRide", m_feedItemId.ToString());
 }