public static AlphaData CreateAlphaData(AlphaRef colorRef, MonoBehaviour mb) { AlphaData ad = new AlphaData(); ad.alphaRef = colorRef; ad.originAlpha = ad.alphaRef.get(); ad.targetAlpha = ad.originAlpha; ad.mb = mb; ad.cor = mb.StartCoroutine(ctrlAlpha(ad)); return(ad); }
public async Task <IActionResult> Index(string id) { if (!string.IsNullOrWhiteSpace(id)) { var any = await repo.GetByIdAsync(AlphaRef.Reverse(id)); if (any != null) { return(RedirectPermanent(any.Url)); } } return(Redirect("/")); }
public static AlphaRef SpineMeshAlpha(MeshRenderer renderer) { AlphaRef r; var mpb = new MaterialPropertyBlock(); mpb.SetColor("_Color", renderer.material.GetColor("_Color")); renderer.SetPropertyBlock(mpb); r = new AlphaRef((c) => { var col = mpb.GetColor("_Color"); col.a = c; mpb.SetColor("_Color", col); renderer.SetPropertyBlock(mpb); }, () => mpb.GetColor("_Color").a); return(r); }