コード例 #1
0
            public async Task <bool> IsA(string typeName)
            {
                if (!IsValid())
                {
                    return(false);
                }

                for (UEClass super = await GetClass(); super.IsValid(); super = (await super.GetSuper()).Cast <UEClass>())
                {
                    if (await super.GetName() == typeName || await super.GetNameCpp() == typeName)
                    {
                        return(true);
                    }
                }

                return(false);
            }
コード例 #2
0
            // ToDo: Try to add Cache here to be faster
            public async Task <bool> IsA <T>() where T : UEObject, new()
            {
                if (!IsValid())
                {
                    return(false);
                }

                int cmpTypeId = new T().TypeId;

                for (UEClass super = await GetClass(); super.IsValid(); super = (await super.GetSuper()).Cast <UEClass>())
                {
                    if (super.Object.Name.Index == cmpTypeId)
                    {
                        return(true);
                    }
                }
                return(false);
            }