experiments with fresnel and shadergraph
[WindSway-HDRP.git] / Library / PackageCache / com.unity.render-pipelines.high-definition@4.10.0-preview / Runtime / Core / Utilities / DelegateUtility.cs
blobb2565dcde1af2d35a1284e42306f4e38dd92f794
1 using System;
3 namespace UnityEngine.Experimental.Rendering
5 public static class DelegateUtility
7 public static Delegate Cast(Delegate source, Type type)
9 if (source == null)
10 return null;
11 Delegate[] delegates = source.GetInvocationList();
12 if (delegates.Length == 1)
13 return Delegate.CreateDelegate(type,
14 delegates[0].Target, delegates[0].Method);
15 Delegate[] delegatesDest = new Delegate[delegates.Length];
16 for (int nDelegate = 0; nDelegate < delegates.Length; nDelegate++)
17 delegatesDest[nDelegate] = Delegate.CreateDelegate(type,
18 delegates[nDelegate].Target, delegates[nDelegate].Method);
19 return Delegate.Combine(delegatesDest);