Exemple #1
0
            public void SetMaskActive(bool enable)
            {
                maskWasActive = maskActive;
                maskActive    = enable;
                if (maskWasActive != maskActive)
                {
                    body.statsDirty = true;
                    var modelLocator = body.modelLocator;
                    if (modelLocator)
                    {
                        var modelTransform = modelLocator.modelTransform;
                        if (modelTransform)
                        {
                            var model = modelTransform.GetComponent <CharacterModel>();
                            if (model)
                            {
                                CharacterModelMaterialOverrides.SetOverrideActive(model, "FragileMask", maskActive);
                            }
                        }
                    }

                    if (NetworkServer.active)
                    {
                        new SyncMaskSetActive(gameObject.GetComponent <NetworkIdentity>().netId, enable).Send(NetworkDestination.Clients);
                    }
                }
            }
Exemple #2
0
 private void CharacterModel_UpdateMaterials(On.RoR2.CharacterModel.orig_UpdateMaterials orig, CharacterModel self)
 {
     CharacterModelMaterialOverrides.SetOverrideActive(self, "DasherDiscActive", self.visibility >= VisibilityLevel.Visible && self.body && self.body.HasBuff(buffDef));
     orig(self);
 }