コード例 #1
0
    public void SetProperty_Custom(int propertyID, PropertyCustomValue v)
    {
        int           index = 0;
        PropertyValue prop  = GetPropertyByID(propertyID, ref index);

        if (prop != null && (prop.m_type == (int)PropertySetValueType.enBitArray ||
                             prop.m_type == (int)PropertySetValueType.enBuffer)
            )
        {
            prop.m_customObject = v;
            OnPropertyChanged(prop, index);
        }
    }
コード例 #2
0
ファイル: Player.cs プロジェクト: moto2002/snowbattle
    public override void OnInitProps()
    {
        base.OnInitProps();
        CurrentTableInfo = GameTable.HeroInfoTableAsset.Lookup(IDInTable);
        if (CurrentTableInfo == null)
        {
            return;
        }
        if (0 == Props.GetProperty_Int32(ENProperty.vocationid))
        {
            Props.SetProperty_Int32(ENProperty.vocationid, 1);
        }
        //显示玩家名称
        AddPlayerName();

        HP              = CurrentTableInfo.FHPMax;
        MaxHP           = CurrentTableInfo.FHPMax;
        MoveSpeed       = CurrentTableInfo.MoveSpeed;
        MovebackSpeed   = CurrentTableInfo.MovebackSpeed;
        AnimationSpeed  = CurrentTableInfo.AnimationSpeed;
        AttackAnimSpeed = 1;
        Props.SetProperty_Int32(ENProperty.islive, 1);
        Props.SetProperty_Float(ENProperty.phyattack, (int)CurrentTableInfo.FPhyAttack);
        Props.SetProperty_Float(ENProperty.phydefend, (int)CurrentTableInfo.FPhyDefend);
        Props.SetProperty_Float(ENProperty.magattack, (int)CurrentTableInfo.FMagAttack);
        Props.SetProperty_Float(ENProperty.magdefend, (int)CurrentTableInfo.FMagDefend);
        Props.SetProperty_Float(ENProperty.avoid, (int)CurrentTableInfo.FAvoid);
        Props.SetProperty_Float(ENProperty.hit, (int)CurrentTableInfo.HitRate);
        Props.SetProperty_Float(ENProperty.crit, (int)CurrentTableInfo.CritRate);
        Props.SetProperty_Float(ENProperty.critParam, (int)CurrentTableInfo.CritParam);
        Props.SetProperty_Float(ENProperty.stamina, (float)CurrentTableInfo.StaminaMax);
        Props.SetProperty_Float(ENProperty.maxStamina, (float)CurrentTableInfo.StaminaMax);
        Props.SetProperty_Float(ENProperty.FResist, (float)CurrentTableInfo.FResist);
        Props.SetProperty_Float(ENProperty.AnitInterfere, (float)CurrentTableInfo.AnitInterfereRate);
        Props.SetProperty_Float(ENProperty.AnitInterrupt, (float)CurrentTableInfo.AnitInterruptRate);
        Props.SetProperty_Float(ENProperty.AnitRepel, (float)CurrentTableInfo.AnitRepelRate);
        Props.SetProperty_Float(ENProperty.AnitLauncher, (float)CurrentTableInfo.AnitLauncherRate);
        Props.SetProperty_Float(ENProperty.WoundParam, CurrentTableInfo.WoundParam);
        Props.SetProperty_Int32(ENProperty.WeaponID, CurrentTableInfo.WeaponId);
        Props.SetProperty_Float(ENProperty.ModelScale, CurrentTableInfo.ModelScale);

        CSItem card = CardBag.Singleton.GetCardByGuid(GUID);

        if (card == null)
        {
            if (Type == ActorType.enFollow)
            {
                card = Team.Singleton.Comrade;
            }
        }
        if (card != null)
        {
            MaxHP = card.GetHp();
            HP    = MaxHP;
            Level = card.Level;
            Props.SetProperty_Float(ENProperty.phyattack, card.GetPhyAttack());
            Props.SetProperty_Float(ENProperty.magattack, card.GetMagAttack());
            Props.SetProperty_Float(ENProperty.phydefend, card.GetPhyDefend());
            Props.SetProperty_Float(ENProperty.magdefend, card.GetMagDefend());

            PropertyCustomValue value = Props.GetProperty_Custom(ENProperty.SkillIDList);
            if (value == null)
            {
                Debug.LogWarning("ENProperty.SkillIDList is null");
                return;
            }
            PropertyValueIntListView skillIDList = value as PropertyValueIntListView;
            if (skillIDList == null)
            {
                Debug.LogWarning("ENProperty.SkillIDList cast fail");
                return;
            }
            for (int i = 0; i < card.SkillItemInfoList.Length; ++i)
            {
                skillIDList.m_list[i] = card.SkillItemInfoList[i].m_skillID;
            }
            Props.SetProperty_Custom(ENProperty.SkillIDList, skillIDList);
        }
    }