public static Vector2 ConvertPoint(Vector2 point, WindowBase from, WindowBase to, bool withoutCamera = false)
        {
            var p = WindowSystem.ConvertPoint(new Vector3(point.x, point.y, 0f), from, to, withoutCamera);

            return(new Vector2(p.x, p.y));
        }
 public void LateUpdate(WindowBase window)
 {
     this.backButtonBehaviour.LateUpdate(window);
 }
 public HistoryItem(WindowBase window)
 {
     this.state  = window.GetState();
     this.window = window;
 }
        internal static bool InvokeMethodWithParameters(out MethodInfo methodInfo, WindowBase window, string methodName, params object[] inputParameters)
        {
            var instance = WindowSystem.instance;

            const string comma = ",";
            var          key   = new StringBuilder();

            foreach (var input in inputParameters)
            {
                key.Append(input == null ?  null : input.GetType().Name);
                key.Append(comma);
            }

            key.Append(methodName);
            key.Append(comma);
            key.Append(window.GetType().Name);

            var keyStr = key.ToString();

            if (instance.methodsCache.TryGetValue(keyStr, out methodInfo) == false)
            {
                instance.methodsCache.Clear();

                var methods = window.GetType().GetMethods(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public);
                foreach (var method in methods)
                {
                    if (method.Name == methodName)
                    {
                        var count      = 0;
                        var parameters = method.GetParameters();

                        if (inputParameters.Length != parameters.Length)
                        {
                            continue;
                        }

                        for (int i = 0; i < parameters.Length; ++i)
                        {
                            var parameter = parameters[i];
                            var par       = inputParameters[i];

                            var equal = par == null || par.GetType() == parameter.ParameterType || par.GetType().IsSubclassOf(parameter.ParameterType);
                            if (equal == true)
                            {
                                ++count;
                            }
                        }

                        if (count == parameters.Length)
                        {
                            // Invoke and break
                            methodInfo = method;

                            instance.methodsCache.Add(keyStr, methodInfo);

                            return(true);
                        }
                    }
                }
            }
            else
            {
                return(true);
            }

            return(false);
        }
 public static void CallFunction(WindowBase instance)
 {
     WindowSystem.instance.functions.Call(instance);
 }
        private bool DestroyWindowCheckOnClean_INTERNAL(WindowBase window, List <WindowBase> exceptList, WindowBase exceptItem)
        {
            if (window != null)
            {
                if (window.preferences.IsDontDestroyClean() == true)
                {
                    return(false);
                }

                if ((exceptItem == null || window != exceptItem) &&
                    (exceptList == null || exceptList.Contains(window) == false))
                {
                    return(true);
                }

                return(false);
            }

            return(true);
        }
 public static void RegisterFunctionCallback(WindowBase instance, UnityAction <int> onFunctionEnds)
 {
     WindowSystem.instance.functions.Register(instance, onFunctionEnds);
 }
 public WindowRoutes(WindowBase window, int index)
 {
     this.window = window;
     this.index  = index;
 }
示例#9
0
 public void ApplyEveryInstance(UnityEngine.Camera camera = null, UnityEngine.Canvas canvas = null, WindowBase window = null)
 {
     if (camera != null)
     {
         this.camera.ApplyEveryInstance(camera);
     }
     if (canvas != null)
     {
         this.canvas.ApplyEveryInstance(canvas, window);
     }
 }
示例#10
0
 internal virtual void Setup(WindowBase window)
 {
     this.window = window;
 }
示例#11
0
 internal void Init(WindowBase source, float depth, float zDepth, int raycastPriority, int orderInLayer)
 {
     this.source = source;
     this.Init(depth, zDepth, raycastPriority, orderInLayer);
 }