Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by 555ea · Jan 05, 2015 at 01:45 PM · editorlist4.6delegate

How can i use 4.6 delegate lists in my scripts ?

alt text

We have such function lists in new 4.6 components like Button, Toggle and etc.

How can i use this in my own scripts ? I want like to have my script, then

public Unity4.6.DelegateList list;

And then access it from editor, droping objects, selecting methods and passing arguments.

screenshot_88.jpg (13.3 kB)
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image gjf · Jan 05, 2015 at 12:46 PM 0
Share

EDIT:

add the component (Button, etc.) to your canvas panel, etc.) then drop the object containing the script component you wish to access functions from (where it says 'None') then select them from the pull-down.

make sure the functions are public too...

avatar image 555ea · Jan 05, 2015 at 02:31 PM 0
Share

yeap, but i don't want a button, i want like

BearDiedScript and make some things on BeadDied() and these thing need to be droped down in such lists, like in Button

avatar image gjf · Jan 05, 2015 at 02:58 PM 0
Share

you mentioned UI elements and weren't that clear on what you really wanted...

if it's just a delegate that you want then just use a delegate! ...and remember to call it from somewhere.

depends on what you're really trying to do...

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by 555ea · Jan 05, 2015 at 02:46 PM

Well, the best solution yet is :

Drop a Button component, make sure it is interactable.

Drop the wanted functions in the Editor on that button.

From any function make a Button Simulation (simulating click actually) by

 PointerEventData pointer = new PointerEventData (EventSystemInstance.Instance());
 ExecuteEvents.Execute (gameObject, pointer, ExecuteEvents.pointerClickHandler);







Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

How to create object>function>parameter call from my script ? 0 Answers

Help with array/lists manipulation in Editor script 1 Answer

Unity editor inspector delegate / function pointer? 2 Answers

Editor: How to do PropertyField for List elements? 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges