Esempio n. 1
0
    public Buff(BuffVO vo, IBuffProperty property)
    {
        VO           = vo;
        BuffProperty = property;

        // Cache
        m_SkillProxy    = GameFacade.Instance.RetrieveProxy(ProxyName.CfgSkillSystemProxy) as CfgSkillSystemProxy;
        m_GameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;

        Leyoutech.Utility.DebugUtility.LogWarning("Buff", string.Format("创建一个Buff ---> 归属entity = {0} , Buff ID = {1}", BuffProperty.EntityId(), VO.ID));

        SkillBuff configVO = m_SkillProxy.GetBuff((int)VO.ID);

        if (configVO.ByteBuffer != null)
        {
            BuffEffect = BuffEffectBase.GetBuffEffectByType((BuffEffectType)configVO.BuffEffectId, this);
            Transform        selfTf      = BuffProperty.GetRootTransform();
            SpacecraftEntity otherEntity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(VO.Link_id) as SpacecraftEntity;
            Transform        otherTf     = null;
            if (otherEntity != null && !otherEntity.IsDead())
            {
                otherTf = otherEntity.GetRootTransform();
            }

            BuffEffect.Init(selfTf, otherTf);
        }
        else
        {
            BuffEffect = new BuffEffectBase(this);
        }
    }
Esempio n. 2
0
 public void Init(BuffVO _buffVO)
 {
     Hashtable tParams = new Hashtable() ;
     if (_buffVO.BuffParams != "")
     {
         try
         {
             tParams = Newtonsoft.Json.JsonConvert.DeserializeObject<Hashtable>(_buffVO.BuffParams);
         }
         catch (System.Exception e)
         {
             Debug.LogError(e.ToString());
             return;
         }
     }
     ConcreteInit(tParams);
 }