public static GameObject[] FindGameObjectsWithTag(Tag.TagType tagtype) { TagData data = tagList[(int)tagtype]; if (data != null) { if (data.gameobjectList != null) { return(data.gameobjectList); } data.gameobjectList = data.list.ToArray(); return(data.gameobjectList); } return(emptyGameObject); }
public static ListValue Parse(byte[] data, int index, out int length) { Tag.TagType itemType = (Tag.TagType)data[index]; int itemCount = BigEndianBitConverter.ToInt32(data, index + sizeof(byte)); List <TagValue> items = new List <TagValue>(itemCount); length = sizeof(byte) + sizeof(int); for (int i = 0; i < itemCount; i++) { items.Add(Parse(itemType, data, index + length, out int valueLength)); length += valueLength; } return(new ListValue(itemType, items.ToArray())); }
public static void CallTagGameObjectDeadFun(Tag.TagType tagtype, GameObject obj) { TagData data = tagList[(int)tagtype]; if (data != null) { Tag t; foreach (GameObject o in data.list) { t = o.GetComponent <Tag>(); if (t.theGameObjectDeadFun != null) { t.theGameObjectDeadFun(obj); } } } }
private Dictionary <ushort, Tag> ReadTagDictionary(Tag.TagType expectedTagType) { var result = new Dictionary <ushort, Tag>(); int length = this.reader.Read7BitEncodedInt(); for (int i = 0; i < length; ++i) { var position = this.reader.BaseStream.Position; var name = this.reader.ReadZeroTerminatedASCIIString(); var tagId = this.reader.ReadUInt16(); var tag = new Tag(tagId, name); if (tag.Type != expectedTagType) { throw new FormatException(String.Format("Unexpected tag type at {0}; was: {1}, expected: {2}", position, tag.Type, expectedTagType)); } result.Add(tagId, tag); } return(result); }
public static TagValue Parse(Tag.TagType valueType, byte[] data, int index, out int length) => valueType switch {
public static Tag GenerateTagHelper(string tagName, string tagValue, string tagDescription, Tag.TagType type, List <TagPerson> owners, List <TagPerson> subscribers) { return(new Tag(tagName, tagValue, tagDescription, type, null, false, owners, subscribers)); }
public ListValue(Tag.TagType itemType, TagValue[] value) : base() { ItemType = itemType; Value = value; }