Esempio n. 1
0
    /// <summary>
    /// 创建投掷物.
    /// </summary>
    public static ErrorCode createProjectiles(BattleUnit user, uint skillResID, uint projResID, Vector3 targetPosition)
    {
        ProjectileSettingsTableItem projSettings = DataManager.ProjectileSettingsTable[projResID] as ProjectileSettingsTableItem;

        for (uint i = 0; i < ProjectileSettingsTableItem.ProjectileCount; ++i)
        {
            ProjectileItem item = projSettings.items[i];

            if (item.bulletResID == uint.MaxValue)
            {
                break;
            }

            BulletTableItem bulletRes = DataManager.BulletTable[item.bulletResID] as BulletTableItem;

            // 枪口特效.
            if (item.bindpointEffect != uint.MaxValue)
            {
                SkillClientBehaviour.AddEffect2Object(user, item.bindpointEffect, item.initBindpoint);
            }

            ProjectileCreateParam param = new ProjectileCreateParam()
            {
                User                 = user,
                StartPosition        = user.GetBonePositionByName(item.initBindpoint),
                TargetPosition       = targetPosition,
                DistributionType     = item.distributionType,
                DistributionArgument = item.distributionArgument,
                BulletRes            = bulletRes,
                SkillResID           = skillResID
            };

            createProjectiles(param);
        }

        return(ErrorCode.Succeeded);
    }