Exemplo n.º 1
0
        private static void PostProcess(ModComponent modComponent)
        {
            modComponent.gameObject.layer = vp_Layer.Gear;

            GearItem gearItem = modComponent.GetComponent <GearItem>();

            gearItem.m_SkinnedMeshRenderers = ModUtils.NotNull(gearItem.m_SkinnedMeshRenderers);

            GameObject   template     = Resources.Load <GameObject>("GEAR_CoffeeCup");
            MeshRenderer meshRenderer = template.GetComponentInChildren <MeshRenderer>();

            foreach (var eachMeshRenderer in gearItem.m_MeshRenderers)
            {
                foreach (var eachMaterial in eachMeshRenderer.materials)
                {
                    if (eachMaterial.shader.name == "Standard")
                    {
                        Debug.Log("Updating shader of " + modComponent.name);
                        eachMaterial.shader         = meshRenderer.material.shader;
                        eachMaterial.shaderKeywords = meshRenderer.material.shaderKeywords;
                    }
                }
            }

            ModUtils.RegisterConsoleGearName(modComponent.GetEffectiveConsoleName(), modComponent.name);

            if (modComponent.Radial != Radial.None)
            {
                RadialConfigurator.RegisterGear(modComponent.Radial, modComponent.name);
            }

            UnityEngine.Object.DontDestroyOnLoad(modComponent.gameObject);
        }
Exemplo n.º 2
0
        public MappedItem RegisterInConsole(string displayName)
        {
            ModUtils.RegisterConsoleGearName(displayName, gameObject.name);

            return(this);
        }