public void AddSkinMeshesToAgentEntity(
     UIntPtr agentVisualsId,
     ref SkinGenerationParams skinParams,
     ref BodyProperties bodyProperties,
     bool useFaceCache)
 {
     ScriptingInterfaceOfIMBAgentVisuals.call_AddSkinMeshesToAgentEntityDelegate(agentVisualsId, ref skinParams, ref bodyProperties, useFaceCache);
 }
Beispiel #2
0
        internal static void DisableInvulnerability(Agent agent)
        {
            if (agent.IsHuman && agent.Age < 18f)
            {
                float age   = agent.Age;
                float scale = agent.AgentScale;
                agent.Age = 18f;
                //AccessTools.PropertySetter(typeof(Agent), nameof(Agent.Age)).Invoke(agent, new object[] { 18f });

                SkinGenerationParams skinParams = GenerateSkinGenParams(agent);
                agent.AgentVisuals.AddSkinMeshes(skinParams, agent.BodyPropertiesValue, true, agent.Character != null && agent.Character.FaceMeshCache);
                AccessTools.Method(typeof(Agent), "SetInitialAgentScale").Invoke(agent, new object[] { scale });
                //AccessTools.PropertySetter(typeof(Agent), nameof(Agent.Age)).Invoke(agent, new object[] { age });
                agent.Age = age;
            }
        }