Giter Site home page Giter Site logo

quantumcalzone / unitylayoutelementextended Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 3.0 76 KB

An extension of Unity's LayoutElement script that enables more flexible adaptation. With this you can now match another RecTransform's dimensions (width, height, or both) and now set maximum preferred values.

License: MIT License

C# 100.00%

unitylayoutelementextended's Introduction

Unity Layout Element Extended

An extension of Unity's LayoutElement script that enables more flexible adaptation. With this you can now match another RecTransform's dimensions (width, height, or both) and now set maximum preferred values.

Quick Example Video

Click to view a quick example video

How to use

Use the component LayoutElementExtended instead of LayoutElement

How to install

Via 2019.4 and later

  • In Unity, open Window/Package Manager
  • Select the + button at the top left
  • Select Add package from git URL...
  • Paste in https://github.com/QuantumCalzone/UnityLayoutElementExtended.git#upm
  • Click the Add button

Via 2019.3 and eariler

  • In your Unity Project, open up the manifest.json file located in your Packages folder
  • below "dependencies": { add the line "com.quantumcalzone.unitylayoutelementextended": "https://github.com/QuantumCalzone/UnityLayoutElementExtended.git#upm",

unitylayoutelementextended's People

Contributors

quantumcalzone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

unitylayoutelementextended's Issues

[Suggestion] More reference types

Hello! Want to suggest you some more customization in order to fit wider amount of usage scenarios.

It will be very useful to be able to use not only element's width or height as reference types but also min and preferred values of this element. It's more convenient to use with texts and images, elements which have their own layout sources.

Project won't build with package added by dependencies

If I'm installing package by adding it to the dependencies in manifest.json it works in editor but I can't build it to Android device. Getting a bunch of errors during build:

Console Errors
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(2,19): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(8,48): error CS0246: The type or namespace name 'LayoutElementEditor' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(6,6): error CS0246: The type or namespace name 'CanEditMultipleObjectsAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(6,6): error CS0246: The type or namespace name 'CanEditMultipleObjects' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(7,6): error CS0246: The type or namespace name 'CustomEditorAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(7,6): error CS0246: The type or namespace name 'CustomEditor' could not be found (are you missing a using directive or an assembly reference?)Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(68,48): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(22,30): error CS0115: 'LayoutElementExtendedEditor.OnInspectorGUI()': no suitable method found to override
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(51,33): error CS0115: 'LayoutElementExtendedEditor.OnEnable()': no suitable method found to override
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(10,17): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(11,17): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(13,17): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(14,17): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(15,17): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(16,17): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(17,17): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedValuePropertyDrawer.cs(7,61): error CS0246: The type or namespace name 'PropertyDrawer' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(18,17): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(19,17): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedEditor.cs(20,17): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedValuePropertyDrawer.cs(6,6): error CS0246: The type or namespace name 'CustomPropertyDrawerAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedValuePropertyDrawer.cs(6,6): error CS0246: The type or namespace name 'CustomPropertyDrawer' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedValuePropertyDrawer.cs(9,51): error CS0246: The type or namespace name 'SerializedProperty' could not be found (are you missing a using directive or an assembly reference?)
Assets\LayoutElementExtended\LayoutElementExtendedValuePropertyDrawer.cs(9,30): error CS0115: 'LayoutElementExtendedValuePropertyDrawer.OnGUI(Rect, SerializedProperty, GUIContent)': no suitable method found to override
Error building Player because scripts had compiler errors
Build completed with a result of 'Failed' in 13 seconds (13131 ms)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
UnityEditor.BuildPlayerWindow+BuildMethodException: 25 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002bb] in <8004fcc221b54f98ba547350ea71d812>:0 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <8004fcc221b54f98ba547350ea71d812>:0 
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

Then I've decided to pull whole example project and tried to build it on android so it runs perfectly. Then I've tried to remove all package dependencies in my original project, moved package from example project (it's inside Packages folder instead of Assets) and replaced all active scripts' path and project building properly now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.