public static void SetOutlineStatus(Transform actorTarget, LuminousOutline.Status status) { if (!SystemConfig.IsShaderEffectOn) { return; } if (!SystemConfig.IsOutlineStatusOn) { return; } if (actorTarget == null) { return; } Renderer[] componentsInChildren = actorTarget.GetComponentsInChildren <Renderer>(); for (int i = 0; i < componentsInChildren.Length; i++) { Renderer renderer = componentsInChildren[i]; Material shareMaterial = Utils.GetShareMaterial(renderer); if (shareMaterial != null && shareMaterial.get_shader() != null) { Shader shader = shareMaterial.get_shader(); for (int j = 0; j < ShaderEffectUtils.OutlineShaders.Length; j++) { if (shader.get_name().Equals(ShaderEffectUtils.OutlineShaders[j])) { LuminousOutline luminousOutline = renderer.get_gameObject().AddMissingComponent <LuminousOutline>(); luminousOutline.SetStatus(ref shareMaterial, status); break; } } } } }
public void SetStatus(ref Material mat, LuminousOutline.Status status) { this.m_myTransform = base.get_transform(); this.m_material = mat; this.m_status = status; if (status == LuminousOutline.Status.Normal) { base.set_enabled(false); } else { base.set_enabled(true); } this.SetOutlineColor(); }