public NumericValue(string referenceString_) { var fields = new List <string>(referenceString_.Split('|')); EReferenceType referenceType = Serializer.ReadEnum <EReferenceType>(fields[0]); switch (referenceType) { case EReferenceType.Value: reference = new ReferenceValue(fields); break; case EReferenceType.UnitGauge: reference = new ReferenceUnitGauge(fields); break; case EReferenceType.UnitStat: reference = new ReferenceUnitStat(fields); break; case EReferenceType.RandomRange: reference = new ReferenceRandomRange(fields); break; case EReferenceType.Modifier: reference = new ReferenceModifier(fields); break; case EReferenceType.Input: reference = new ReferenceInput(fields); break; } }
/// <summary> /// 获取BundleName /// </summary> /// <param name="assetUrl">资源路径</param> /// <param name="referenceType">引用类型</param> /// <returns>BundleName</returns> public string GetBundleName(string assetUrl, EReferenceType referenceType) { BuildItem buildItem = GetBuildItem(assetUrl); if (buildItem == null) { return(null); } string name; switch (buildItem.bundleType) { case EBundleType.All: name = $"{buildItem.assetPath.Substring(0, buildItem.assetPath.LastIndexOf('/'))}{Builder.BUNDLE_SUFFIX}".ToLowerInvariant(); break; case EBundleType.Directory: name = $"{assetUrl.Substring(0, assetUrl.LastIndexOf('/'))}{Builder.BUNDLE_SUFFIX}".ToLowerInvariant(); break; case EBundleType.File: name = $"{assetUrl}{Builder.BUNDLE_SUFFIX}".ToLowerInvariant(); break; default: throw new Exception($"无法获取{assetUrl}的BundleName"); } buildItem.Count += 1; return(name); }
/// <summary> /// Constructor /// </summary> /// <param name="type">Reference array type</param> /// <param name="offset">Array offset</param> /// <param name="isGlobal">Is array global</param> /// <param name="indexVariable">Array index variable</param> /// <param name="size">Array size</param> /// <param name="elementType">Array element type</param> /// <param name="isIndexGlobalVariable">Is array index global variable</param> public GTA3ScriptReferenceArray(EReferenceType type, ushort offset, bool isGlobal, ushort indexVariable, byte size, byte elementType, bool isIndexGlobalVariable) { Type = type; Offset = offset; IsGlobal = isGlobal; IndexVariable = indexVariable; Size = size; ElementType = elementType; IsIndexGlobalVariable = isIndexGlobalVariable; }
/// <summary> /// Constructor /// </summary> /// <param name="type">Type</param> /// <param name="value">Value</param> public Reference(EReferenceType type, string value) { Type = type; Value = value; }
/// <summary> /// Constructor /// </summary> /// <param name="type">Type</param> /// <param name="value">Value</param> public Reference(EReferenceType type, string value) { Type = type; Value = value; }
/// <summary> /// Constructor /// </summary> /// <param name="type">Reference value type</param> /// <param name="offset">Offset</param> /// <param name="isGlobal">Is global</param> public GTA3ScriptReferenceValue(EReferenceType type, ushort offset, bool isGlobal) { Type = type; Offset = offset; IsGlobal = isGlobal; }