loom
New Member
Posts: 6
|
Post by loom on Feb 1, 2022 19:36:12 GMT
How to hide image component with gameObject which has ScrollRect Component Effect Similar official components ScrollView,It has child gameobject name "Viewport",So I can disable image component with gameObject which has ScrollRect Component
|
|
|
Post by echo17 on Feb 1, 2022 20:03:59 GMT
I'm not sure what you are asking specifically, but to enable or disable a component, you can toggle its "enabled" field. Note that this is not EnhancedScroller specific, so you can find solutions for how to manage Unity UI components through Google or Unity Help Forums. Here is a Google search that gives some code solutions: link. General code: public void ToggleImage(GameObject myGameObject, bool show) { var myImage = myGameObject.GetComponent<Image>(); myImage.enabled = show; }
Here's a link to the Unity Answers forum: link
|
|
loom
New Member
Posts: 6
|
Post by loom on Feb 3, 2022 9:22:26 GMT
I'm not sure what you are asking specifically, but to enable or disable a component, you can toggle its "enabled" field. Note that this is not EnhancedScroller specific, so you can find solutions for how to manage Unity UI components through Google or Unity Help Forums. Here is a Google search that gives some code solutions: link. General code: public void ToggleImage(GameObject myGameObject, bool show) { var myImage = myGameObject.GetComponent<Image>(); myImage.enabled = show; }
Here's a link to the Unity Answers forum: linkI mean if the image component hidden by the scroll gameobject can cause Mask component invalidation. I don't need the background graph color of the scroll component, how should I operate ... Refer to the sub gameobject name "Viewport" under ScrollView under the official component
|
|
|
Post by echo17 on Feb 3, 2022 11:59:40 GMT
If you are asking how to use an image as a mask on the ScrollRect, but make that image invisible, then you will just need to uncheck the "Show Mask Graphic" field on the Mask component in the inspector. You can find more information on the Mask component here: link
|
|
loom
New Member
Posts: 6
|
Post by loom on Feb 3, 2022 13:59:12 GMT
If you are asking how to use an image as a mask on the ScrollRect, but make that image invisible, then you will just need to uncheck the "Show Mask Graphic" field on the Mask component in the inspector. <button disabled="" class="c-attachment-insert--linked o-btn--sm">Attachment Deleted</button> You can find more information on the Mask component here: linkI am all gratitude!!!
|
|
|
Post by z79422957 on Jul 11, 2023 16:02:28 GMT
Solved my difficulties,It need image and mask to be used together, thank you very much!!!!
|
|