Esempio n. 1
0
        public void Register(TypeReference dataType, MethodReference methodReference)
        {
            if (funcs.ContainsKey(dataType))
            {
                logger.Warning(
                    $"Registering a {FunctionTypeLog} for {dataType.FullName} when one already exists\n" +
                    $"  old:{funcs[dataType].FullName}\n" +
                    $"  new:{methodReference.FullName}",
                    methodReference.Resolve());
            }

            // we need to import type when we Initialize Writers so import here in case it is used anywhere else
            TypeReference imported = module.ImportReference(dataType);

            funcs[imported] = methodReference;
        }
Esempio n. 2
0
        public void Register(TypeReference dataType, MethodReference methodReference)
        {
            if (funcs.ContainsKey(dataType))
            {
                logger.Warning(
                    $"Registering a {FunctionTypeLog} for {dataType.FullName} when one already exists\n" +
                    $"  old:{funcs[dataType].FullName}\n" +
                    $"  new:{methodReference.FullName}",
                    methodReference.Resolve());
            }

            Log($"Register {FunctionTypeLog} for {dataType.FullName}, method:{methodReference.FullName}");


            // we need to import type when we Initialize Writers so import here in case it is used anywhere else
            var imported = module.ImportReference(dataType);

            funcs[imported] = methodReference;

            // mark type as generated,
            //MarkAsGenerated(dataType); <---  broken in unity2021
        }