Element that can be used for screen rendering.

상속: Behaviour
예제 #1
0
        void Start()
        {
            timerText = GameObject.Find("Play Timer").GetComponent<Text>();
            canvas = this.GetComponent<Canvas>();

            canvas.enabled = true;
        }
예제 #2
0
파일: UITooltip.cs 프로젝트: gloowa/mstest
 protected override void OnEnable()
 {
     base.OnEnable ();
     current = this;
     canvas = GetComponentInParent<Canvas> ();
     base.Close ();
 }
        public CreateAccountCanvasController(IoCResolver resolver, Canvas canvasView)
            : base(resolver, canvasView)
        {
            // resolve
            resolver.Resolve(out _messager);
            resolver.Resolve(out _user);

            ResolveElement(out _usernameInputField, "username_input_field");
            ResolveElement(out _passwordInputField, "password_input_field");
            ResolveElement(out _passwordConfirmationInputField, "password_confirmation_input_field");
            ResolveElement(out _confirmButton, "confirm_button");
            ResolveElement(out _backButton, "back_button");

            // initialize
            ShowCanvas = false;

            _usernameInputField.text = "";
            _passwordInputField.text = "";

            // subscribe
            _onCreateAccountSelected = _messager.Subscribe<CreateAccountSelectedMessage>(message =>
            {
                ShowCanvas = true;
                _currentAccountCreationSession = message;

                _usernameInputField.text = "";
                _passwordInputField.text = "";

                _confirmButton.onClick.RemoveAllListeners();
                _backButton.onClick.RemoveAllListeners();

                _confirmButton.onClick.AddListener(RegisterAccount);
                _backButton.onClick.AddListener(() => message.OnCancelled());
            });
        }
		public void OnHover(RectTransform uiElement) {
			
			this.uiElement = uiElement;

			if (this.tempHud != null) this.tempHud.enabled = false;

			if (this.animationRoot != null) this.animationRoot.SetInState();

			var canvas = uiElement.root.GetComponentsInChildren<Canvas>()[0];
			uiElement.root.GetComponentInChildren<Canvas>();
			this.uiElementCanvas = canvas;

			this.ApplyPosition();

			if (this.animationRoot != null) this.animationRoot.SetResetState();

			if (this.layoutRoot != null) {

				this.CheckPivot(uiElement.rect.size, canvas.transform as RectTransform);

			} else {
				
				var anchor = this.root.anchoredPosition3D;
				anchor.z = 0f;
				this.root.anchoredPosition3D = anchor + Vector3.up * uiElement.rect.size.y * 0.5f;

			}

		}
예제 #5
0
        internal void init()
        {
            var cardCanvas = GameObject.Find(Constants.cardCanvas);
            canvas = GameObject.Find("Canvas").gameObject.GetComponent<Canvas>();
            //set up fake card model
            var hoverCardModel = new CardModel()
            {
                playerId = -1,
            };

            //init the hover card that's hidden most of the time
            cardService.CreateCard(hoverCardModel, cardCanvas.transform, new Vector3(10000,10000, 0));
            var hoverCardGO = hoverCardModel.gameObject;

            hoverCardGO.name = hoverName;
            hoverCardGO.tag = "HoverCard";

            //disable all colliders so you can't hover the hover
            foreach (var collider in hoverCardGO.GetComponentsInChildren<BoxCollider>())
            {
                collider.enabled = false;
            }
            foreach (var collider in hoverCardGO.GetComponentsInChildren<MeshCollider>())
            {
                collider.enabled = false;
            }

            hoverCardView = hoverCardGO.AddComponent<CardView>();
            hoverCardView.card = hoverCardModel;

            hoverCardGO.SetActive(false);
        }
		public override void OnEnter()
		{
			GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (go != null)
			{
				_rt = go.GetComponent<RectTransform>();
			}
			
			GameObject goCanvas = canvas.Value;
			if (goCanvas != null)
			{
				_canvas = goCanvas.GetComponent<Canvas>();
			}

			if (_canvas==null && go!=null)
			{
				var _ui = go.GetComponent<UnityEngine.UI.Graphic>();
				if (_ui!=null)
				{
					_canvas = _ui.canvas;
				}
			}
			
			DoAction();
			
			if (!everyFrame)
			{
				Finish();
			}		
		}
예제 #7
0
        private void InitializeMainComponents()
        {
            canvas = Instantiate(Resources.Load<Canvas>("Prefabs/Play/Canvas"));
            mainCamera = Instantiate(Resources.Load<Camera>("Prefabs/Play/MainCamera"));

            Canvas = canvas;
        }
예제 #8
0
        private void Start()
        {
            gridRect = GetComponentInParent<RectTransform>();
            gridCanvas = GetComponentInParent<Canvas>();
            gridLayout = GetComponentInParent<GridLayoutGroup>();

            gridRect.pivot = new Vector2(0, 0);
            gridRect.position = new Vector3(terrainMesh.transform.position.x, 6.0f, terrainMesh.transform.position.z);
            gridRect.anchorMin = new Vector2(terrainMesh.transform.position.x, terrainMesh.transform.position.z);
            gridRect.anchorMax = new Vector2(terrainMesh.terrainData.size.x, terrainMesh.terrainData.size.z);

            gridLayout.CalculateLayoutInputHorizontal();

            Debug.Log(string.Format("Origin: {0}, Size: {1}, Cell size: {2}\n", gridRect.position.ToString(), gridRect.rect.size.ToString(), gridLayout.cellSize));

            buttonTemplate = GetComponentInChildren<Button>();
            for (int y = 0; y < gridRect.rect.y; y++)
            {
                for (int x = 0; x < gridRect.rect.x; x++)
                {
                    Vector3 pos = new Vector3(x, 0, y); // * spacing;
                    Button b = (Button)Instantiate(buttonTemplate, pos, Quaternion.identity);
                    //b.gameObject.AddComponent<LayoutElement>();

                    //b.name = "Button " + x.ToString() + "," + y.ToString();
                    //b.GetComponentInChildren<Text>().text = b.name;
                    gridLayout.SetLayoutHorizontal();
                }
            }
        }
예제 #9
0
 public void Awake()
 {
     GameManager.Instance.CursorEnabled = false;
     this.canvas = GetComponent<Canvas>();
     this.eventSystem = FindObjectOfType<EventSystem>();
     this.wasCancelPressed = false;
 }
		public static Vector2 ScreenPoint(Camera mainCamera, Vector3 worldPosition, RectTransform parent, Canvas canvas)
		{
			var screenPosition = mainCamera.WorldToScreenPoint(worldPosition);
			var localPosition = Vector2.zero;
			RectTransformUtility.ScreenPointToLocalPointInRectangle(parent, screenPosition, canvas.worldCamera, out localPosition);
			return localPosition;
		}
        public MainMenuCanvasController(IoCResolver resolver, Canvas canvasView)
            : base(resolver, canvasView)
        {
            // resolve
            resolver.Resolve(out _messager);
            resolver.Resolve(out _user);

            ResolveElement(out _welcomeText, "welcome_text");
            ResolveElement(out _hostGameButton, "host_game_button");
            ResolveElement(out _joinGameButton, "join_game_button");
            ResolveElement(out _exitGameButton, "exit_game_button");

            // initialize
            ShowCanvas = false;

            _hostGameButton.onClick.AddListener(() =>
            {
                _messager.Publish(new HostGameClickedMessage());
            });

            _exitGameButton.onClick.AddListener(() =>
            {
                _messager.Publish(new ExitMessage());
            });

            // subscribe
            _onMainMenuSelected = _messager.Subscribe<MainMenuSelectedMessage>(message =>
            {
                ShowCanvas = true;
                _welcomeText.text = String.Format(LanguageStrings.MainMenuWelcome, _user.Username);
            });
        }
예제 #12
0
        void Start()
        {
            timerBar = GameObject.Find("Card Selection Timer").transform;
            canvas = this.GetComponent<Canvas>();

            canvas.enabled = false;
        }
예제 #13
0
 void Start()
 {
     quitMenu = quitMenu.GetComponent<Canvas>();
     quitMenu.enabled = false;
     startText = startText.GetComponent<Button>();
     exitText = exitText.GetComponent<Button>();
 }
예제 #14
0
    void Update() {
        if (followObject != null) {
            if (!Application.isPlaying || canvas == null) {
                canvas = GetComponentInParent<Canvas>();
                if (canvas == null) {
                    Debug.LogError("This object should be placed under a canvas", this);
                }
            }

            if (!Application.isPlaying || cameraReference == null) {
                cameraReference = worldCamera.Lookup<Camera>(this);
            }
            UpdateFollowObject();

            bool visible = IsPossiblyVisible();
            var energyBarBase = GetComponent<EnergyBarBase>();

            energyBarBase.opacity = visible ? 1 : 0;

            if (cameraReference != null && canvas != null) {
                if (canvas.renderMode == RenderMode.WorldSpace) {
                    energyBarBase.transform.rotation =
                        Quaternion.LookRotation(energyBarBase.transform.position - cameraReference.transform.position);
                } else {
                    energyBarBase.transform.rotation = Quaternion.identity;
                }
            }
        } else {
			FastPoolManager.GetPool(this.gameObject,false).FastDestroy(this.gameObject);
		}
    }
예제 #15
0
 /// <summary>
 /// 
 /// <para>
 /// Deregister the given Graphic from a Canvas.
 /// </para>
 /// 
 /// </summary>
 /// <param name="c">Canvas.</param><param name="graphic">Graphic to deregister.</param>
 public static void UnregisterGraphicForCanvas(Canvas c, Graphic graphic)
 {
   IndexedSet<Graphic> indexedSet;
   if ((Object) c == (Object) null || !GraphicRegistry.instance.m_Graphics.TryGetValue(c, out indexedSet))
     return;
   indexedSet.Remove(graphic);
 }
예제 #16
0
		public void OnValidate() {

			if (Application.isPlaying == true) return;

			this.canvas = this.GetComponent<Canvas>();
			this.canvasScaler = this.GetComponent<CanvasScaler>();
			
		}
예제 #17
0
        void Awake()
        {
            m_Canvas = GetComponent<Canvas>();
            if (m_Canvas.worldCamera == null || m_Canvas.renderMode == RenderMode.ScreenSpaceOverlay) return;

            m_Raycaster = GetComponent<GraphicRaycaster>();
            SetCameraRaycaster();
        }
 public Rect GetCanvasRect(RectTransform t, Canvas c)
 {
   t.GetWorldCorners(this.m_WorldCorners);
   Transform component = c.GetComponent<Transform>();
   for (int index = 0; index < 4; ++index)
     this.m_CanvasCorners[index] = component.InverseTransformPoint(this.m_WorldCorners[index]);
   return new Rect(this.m_CanvasCorners[0].x, this.m_CanvasCorners[0].y, this.m_CanvasCorners[2].x - this.m_CanvasCorners[0].x, this.m_CanvasCorners[2].y - this.m_CanvasCorners[0].y);
 }
예제 #19
0
 /// <summary>
 /// <para>Deregister the given Graphic from a Canvas.</para>
 /// </summary>
 /// <param name="c">Canvas.</param>
 /// <param name="graphic">Graphic to deregister.</param>
 public static void UnregisterGraphicForCanvas(Canvas c, Graphic graphic)
 {
     IndexedSet<Graphic> set;
     if ((c != null) && instance.m_Graphics.TryGetValue(c, out set))
     {
         set.Remove(graphic);
     }
 }
예제 #20
0
 private void Awake()
 {
     m_rectTransform = GetComponent<RectTransform>();
     SiblingGraphics.SetActive(true);
     m_parentCanvas = GetComponentInParent<Canvas>();
     m_itemsControl = GetComponentInParent<ItemsControl>();
     AwakeOverride();
 }
예제 #21
0
        private void FindCanvas()
        {
            if (!canvas)
                canvas = FindObjectOfType<Canvas>();

            if (!canvas)
                throw new InvalidOperationException("You need a canvas in your scene, or add code to create one here.");
        }
예제 #22
0
        protected override void Start()
        {
            base.Start();

            _parentCanvas = GetComponentInParent<Canvas>();
            if ( _parentCanvas != null )
                _parentCanvasRectTransform = _parentCanvas.transform as RectTransform;
        }
        void Awake()
        {
            _win = this.GetComponent<Canvas>();
            _label = this.GetComponentInChildren<Text>();
            _win.enabled = false;

            _yes = GameObject.Find("Yes").GetComponent<Button>();
        }
예제 #24
0
 /// <summary>
 /// <para>Return a list of Graphics that are registered on the Canvas.</para>
 /// </summary>
 /// <param name="canvas">Input canvas.</param>
 /// <returns>
 /// <para>Graphics on the input canvas.</para>
 /// </returns>
 public static IList<Graphic> GetGraphicsForCanvas(Canvas canvas)
 {
     IndexedSet<Graphic> set;
     if (instance.m_Graphics.TryGetValue(canvas, out set))
     {
         return set;
     }
     return s_EmptyList;
 }
예제 #25
0
        /// <summary>
        /// Gets the instances / pipeline connections needed for the concrete implementation
        /// </summary>
        protected override void Start()
        {
            Canvas = transform.GetOrAddComponent<Canvas>();
            Canvas.overrideSorting = true;
            GraphicRaycaster = transform.GetOrAddComponent<GraphicRaycaster>();
            CanvasGroup = transform.GetOrAddComponent<CanvasGroup>();

            base.Start();
        }
 public void Start() {
     // we need the root canvas
     Transform t = transform;
     while (canvas == null && t != null || !canvas.isRootCanvas) {
         canvas = t.GetComponent<Canvas>();
         t = t.parent;
     }
     canvasRT = canvas.GetComponent<RectTransform>();
 }
예제 #27
0
		public void AddCanvas(Canvas canvas)
		{
			if (canvases == null)
			{
				canvases = new List<Canvas>();
			}
			canvases.Add(canvas);
			Refresh();
		}
 public ComboHitSequenceController(UnityObjectPool hitZonePool, UnityObjectPool bonusBubblePool, UnityObjectPool hitFeedbackBubblePool, GameObject boss, Canvas canvas, float baseHitZoneZPosition)
 {
     this.hitZonePool = hitZonePool;
     this.bonusBubblePool = bonusBubblePool;
     this.hitFeedbackBubblePool = hitFeedbackBubblePool;
     this.boss = boss;
     this.canvas = canvas;
     this.baseHitZoneZPosition = baseHitZoneZPosition;
 }
예제 #29
0
        public void Awake()
        {
            // Get canvas reference
            m_canvas = GetComponentInChildren<Canvas>();
            m_canvas.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);

            // Create player icons
            m_playerImages      = new List<Text>(playersTransfroms.Count);
            m_playerBaseImages  = new List<Text>(playerBasesTranforms.Count);

            for (int i = 0; i < m_playerImages.Capacity; ++i)
            {
                Text playerIcon     = Instantiate(playerImage);
                Text playerBaseIcon = Instantiate(baseImage);

                // Set parent as canvas
                playerIcon.transform.SetParent(m_canvas.transform, false);
                playerBaseIcon.transform.SetParent(m_canvas.transform, false);

                // Set scale
                playerIcon.transform.localScale =
                    new Vector3(playerIconScale, playerIconScale, playerIconScale);
                playerBaseIcon.transform.localScale =
                    new Vector3(playerBaseIconScale, playerBaseIconScale, playerBaseIconScale);

                switch (i)
                {
                        // Player 1
                    case 0:
                        playerIcon.color        = player1Colour;
                        playerBaseIcon.color    = player1Colour;
                        break;

                        // Player 2
                    case 1:
                        playerIcon.color        = player2Colour;
                        playerBaseIcon.color    = player2Colour;
                        break;

                        // Player 3
                    case 2:
                        playerIcon.color        = player3Colour;
                        playerBaseIcon.color    = player3Colour;
                        break;

                        // Player 4
                    case 3:
                        playerIcon.color        = player4Colour;
                        playerBaseIcon.color    = player4Colour;
                        break;
                }

                m_playerImages.Add(playerIcon);
                m_playerBaseImages.Add(playerBaseIcon);
            }
        }
예제 #30
0
파일: UICursor.cs 프로젝트: gloowa/mstest
 private void Start()
 {
     rectTransform = GetComponent<RectTransform>();
     image = GetComponent<Image>();
     canvas = GetComponentInParent<Canvas> ();
     canvasGroup = GetComponent<CanvasGroup> ();
     canvasGroup.alpha = 0f;
     canvasGroup.blocksRaycasts = false;
     canvasGroup.interactable = false;
 }
    static int get_additionalShaderChannels(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            UnityEngine.AdditionalCanvasShaderChannels ret = obj.additionalShaderChannels;
            LuaDLL.lua_pushinteger(L, (int)ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index additionalShaderChannels on a nil value"));
        }
    }
    static int set_renderMode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas     obj  = (UnityEngine.Canvas)o;
            UnityEngine.RenderMode arg0 = (UnityEngine.RenderMode)LuaDLL.luaL_checknumber(L, 2);
            obj.renderMode = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index renderMode on a nil value"));
        }
    }
    static int get_sortingLayerName(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            string             ret = obj.sortingLayerName;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index sortingLayerName on a nil value"));
        }
    }
    static int set_referencePixelsPerUnit(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            float arg0             = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.referencePixelsPerUnit = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index referencePixelsPerUnit on a nil value"));
        }
    }
    static int set_worldCamera(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj  = (UnityEngine.Canvas)o;
            UnityEngine.Camera arg0 = (UnityEngine.Camera)ToLua.CheckObject(L, 2, typeof(UnityEngine.Camera));
            obj.worldCamera = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index worldCamera on a nil value"));
        }
    }
    static int get_normalizedSortingGridSize(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            float ret = obj.normalizedSortingGridSize;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index normalizedSortingGridSize on a nil value"));
        }
    }
예제 #37
0
    static int get_sortingLayerID(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            int ret = obj.sortingLayerID;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index sortingLayerID on a nil value" : e.Message));
        }
    }
    static int set_sortingLayerID(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.sortingLayerID = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index sortingLayerID on a nil value"));
        }
    }
    static int set_normalizedSortingGridSize(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            float arg0             = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.normalizedSortingGridSize = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index normalizedSortingGridSize on a nil value"));
        }
    }
    static int get_targetDisplay(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            int ret = obj.targetDisplay;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index targetDisplay on a nil value"));
        }
    }
예제 #41
0
    static int get_UICanvas(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            PanelManager       obj = (PanelManager)o;
            UnityEngine.Canvas ret = obj.UICanvas;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index UICanvas on a nil value" : e.Message));
        }
    }
예제 #42
0
    static int set_planeDistance(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            float arg0             = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.planeDistance = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index planeDistance on a nil value" : e.Message));
        }
    }
    static int get_referencePixelsPerUnit(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            float ret = obj.referencePixelsPerUnit;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index referencePixelsPerUnit on a nil value"));
        }
    }
    static int get_isRootCanvas(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            bool ret = obj.isRootCanvas;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index isRootCanvas on a nil value"));
        }
    }
예제 #45
0
    static int set_sortingGridNormalizedSize(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.sortingGridNormalizedSize = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index sortingGridNormalizedSize on a nil value" : e.Message));
        }
    }
예제 #46
0
    static int get_canvas(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.UI.Graphic obj = (UnityEngine.UI.Graphic)o;
            UnityEngine.Canvas     ret = obj.canvas;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index canvas on a nil value"));
        }
    }
    static int get_cachedSortingLayerValue(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            int ret = obj.cachedSortingLayerValue;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index cachedSortingLayerValue on a nil value"));
        }
    }
    static int set_overrideSorting(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.overrideSorting = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index overrideSorting on a nil value"));
        }
    }
    static int get_worldCamera(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            UnityEngine.Camera ret = obj.worldCamera;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index worldCamera on a nil value"));
        }
    }
예제 #50
0
    static int set_pixelPerfect(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.pixelPerfect = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index pixelPerfect on a nil value" : e.Message));
        }
    }
예제 #51
0
    static int set_targetDisplay(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.targetDisplay = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index targetDisplay on a nil value" : e.Message));
        }
    }
    static int get_pixelRect(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            UnityEngine.Rect   ret = obj.pixelRect;
            ToLua.PushValue(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index pixelRect on a nil value"));
        }
    }
 static int PixelAdjustPoint(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         UnityEngine.Vector2   arg0 = ToLua.ToVector2(L, 1);
         UnityEngine.Transform arg1 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Transform));
         UnityEngine.Canvas    arg2 = (UnityEngine.Canvas)ToLua.CheckUnityObject(L, 3, typeof(UnityEngine.Canvas));
         UnityEngine.Vector2   o    = UnityEngine.RectTransformUtility.PixelAdjustPoint(arg0, arg1, arg2);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int get_planeDistance(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            float ret = obj.planeDistance;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index planeDistance on a nil value"));
        }
    }
    static int set_additionalShaderChannels(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            UnityEngine.AdditionalCanvasShaderChannels arg0 = (UnityEngine.AdditionalCanvasShaderChannels)LuaDLL.luaL_checknumber(L, 2);
            obj.additionalShaderChannels = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index additionalShaderChannels on a nil value"));
        }
    }
예제 #56
0
    static int set_renderMode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas     obj  = (UnityEngine.Canvas)o;
            UnityEngine.RenderMode arg0 = (UnityEngine.RenderMode)ToLua.CheckObject(L, 2, typeof(UnityEngine.RenderMode));
            obj.renderMode = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index renderMode on a nil value" : e.Message));
        }
    }
예제 #57
0
    static int get_scaleFactor(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            float ret = obj.scaleFactor;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index scaleFactor on a nil value" : e.Message));
        }
    }
    static int get_renderMode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas     obj = (UnityEngine.Canvas)o;
            UnityEngine.RenderMode ret = obj.renderMode;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index renderMode on a nil value"));
        }
    }
    static int set_sortingLayerName(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj  = (UnityEngine.Canvas)o;
            string             arg0 = ToLua.CheckString(L, 2);
            obj.sortingLayerName = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index sortingLayerName on a nil value"));
        }
    }
예제 #60
0
    static int get_overrideSorting(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Canvas obj = (UnityEngine.Canvas)o;
            bool ret = obj.overrideSorting;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index overrideSorting on a nil value" : e.Message));
        }
    }