Example #1
0
 public void EndAbnormalCondition(PEAbnormalType type)
 {
     if (null != m_AbnormalList[(int)type])
     {
         m_AbnormalList[(int)type].EndCondition();
     }
 }
Example #2
0
        void AddAbnormal(PEAbnormalType type, AbnormalData data)
        {
            PEAbnormal_N abnormalCondition = new PEAbnormal_N();

            abnormalCondition.Init(type, this, Entity, OnStartAbnormal, OnEndAbnormal);
            m_AbnormalList[(int)type] = abnormalCondition;
        }
Example #3
0
 public void StartAbnormalCondition(PEAbnormalType type)
 {
     if (null != m_AbnormalList[(int)type])
     {
         m_AbnormalList[(int)type].StartCondition();
     }
 }
 public void Init(PEAbnormalType abnormalType, AbnormalConditionCmpt ctrlCmpt, PeEntity entity, Action <PEAbnormalType> startEvtFunc, Action <PEAbnormalType> endEvtFunc)
 {
     m_AbnormalCmpt = ctrlCmpt;
     m_Entity       = entity;
     evtStart      += startEvtFunc;
     evtEnd        += endEvtFunc;
     InitData(abnormalType);
 }
Example #5
0
        void NetSendEndMsg(PEAbnormalType type)
        {
            if (!PeGameMgr.IsMulti || !m_Net.IsController)
            {
                return;
            }

            PlayerNetwork.SyncAbnormalConditionEnd(Entity.Id, (int)type);
        }
    public static AbnormalData GetData(PEAbnormalType type)
    {
        if (g_DataDic.ContainsKey(type))
        {
            return(g_DataDic[type]);
        }

        Debug.LogError("Can't find abnormaltype:" + type.ToString());
        return(null);
    }
Example #7
0
        void OnEndAbnormal(PEAbnormalType type)
        {
            if (null != evtEnd)
            {
                evtEnd(type);
            }

            //SendMsg
            NetSendEndMsg(type);
        }
Example #8
0
        void OnStartAbnormal(PEAbnormalType type)
        {
            if (null != evtStart)
            {
                evtStart(type);
            }

            //SendMsg
            NetSendStartMsg(type);
        }
 public void OnHitAbnormal(PEAbnormalType type)
 {
     for (int i = 0; i < hitAbnormals.Length; ++i)
     {
         if (hitAbnormals[i] == (int)type)
         {
             hitAbnormal = true;
             break;
         }
     }
 }
Example #10
0
 void OnEndAbnormal(PEAbnormalType type)
 {
     if (null != UIMainMidCtrl.Instance)
     {
         AbnormalData data = AbnormalData.GetData(type);
         if (null != data && data.iconName != "0")
         {
             UIMainMidCtrl.Instance.DeleteBuffShow(data.iconName);
         }
     }
 }
Example #11
0
 void OnStartAbnormal(PEAbnormalType type)
 {
     if (null != UIMainMidCtrl.Instance)
     {
         AbnormalData data = AbnormalData.GetData(type);
         if (null != data && data.iconName != "0")
         {
             UIMainMidCtrl.Instance.AddBuffShow(data.iconName, data.description);
         }
     }
 }
Example #12
0
 public void NetEndState(PEAbnormalType type)
 {
     if (null == m_AbnormalList)
     {
         Debug.LogError("AbnormalConditionCmpt has not been inited.");
         return;
     }
     if (null != m_AbnormalList[(int)type])
     {
         m_AbnormalList[(int)type].EndCondition();
     }
 }
Example #13
0
 public void NetApplyState(PEAbnormalType type, byte[] data)
 {
     if (null == m_AbnormalList)
     {
         Debug.LogError("AbnormalConditionCmpt has not been inited.");
         return;
     }
     if (null != m_AbnormalList[(int)type])
     {
         m_AbnormalList[(int)type].Deserialize(data);
     }
 }
Example #14
0
        void NetSendStartMsg(PEAbnormalType type)
        {
            if (!PeGameMgr.IsMulti || !m_Net.IsController)
            {
                return;
            }

            if (null == m_AbnormalList[(int)type])
            {
                return;
            }

            PlayerNetwork.SyncAbnormalConditionStart(Entity.Id, (int)type, m_AbnormalList[(int)type].Serialize());
        }
 static PEAbnormalType[] GetAbnormalType(SqliteDataReader reader, string fieldName)
 {
     int[] intArray = PETools.Db.GetIntArray(reader, fieldName);
     if (null == intArray || intArray.Length == 0)
     {
         return(null);
     }
     PEAbnormalType[] ret = new PEAbnormalType[intArray.Length];
     for (int i = 0; i < ret.Length; ++i)
     {
         ret[i] = (PEAbnormalType)intArray[i];
     }
     return(ret);
 }
    void InitData(PEAbnormalType abnormalType)
    {
        m_Data = AbnormalData.GetData(abnormalType);
        if (null == m_Data)
        {
            Debug.LogError("Can't find AbnormalData ID:" + abnormalType.ToString());
            return;
        }

        InitTriggers();
        InitHits();
        InitEffects();
        InitRemoveTriggers();
        InitRemoveHits();
        InitRemoveEffects();
    }
Example #17
0
    void RemoveNpcAbnormal(PEAbnormalType type)
    {
        AbnormalData data = AbnormalData.GetData(type);

        //lz-2016.08.26 异常状态是0的图标不显示
        if (null == data || data.iconName == "0")
        {
            return;
        }
        CSUI_BuffItem item = mAbnormalList.Find(i => i._icon == data.iconName);

        if (item == null)
        {
            return;
        }
        Destroy(item.gameObject);
        mAbnormalList.Remove(item);
        mReposition = true;
    }
Example #18
0
    void AddNpcAbnormal(PEAbnormalType type)
    {
        AbnormalData data = AbnormalData.GetData(type);

        //lz-2016.08.26 异常状态是0的图标不显示
        if (null == data || data.iconName == "0")
        {
            return;
        }
        CSUI_BuffItem item = Instantiate(mAbnormalPrefab) as CSUI_BuffItem;

        if (!item.gameObject.activeSelf)
        {
            item.gameObject.SetActive(true);
        }
        item.transform.parent = mAbnormalGrid.transform;
        CSUtils.ResetLoacalTransform(item.transform);
        item.SetInfo(data.iconName, data.description);
        mAbnormalList.Add(item);
        mReposition = true;
    }
Example #19
0
 public bool CheckAbnormalCondition(PEAbnormalType type)
 {
     return(null != m_AbnormalList[(int)type] && m_AbnormalList[(int)type].hasEffect);
 }