Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - scapegoat57

Pages: [1]
1
The way I get around instantiating prefabs with anchors is by having an inactive instance of the prefab in the scene and calling Instantiate with that. The only draw back is that the copy is inactive, so you have to add SetActive(true) after your Instantiate call.

2
I see what you're saying, isEnabled is not a property I want to change. What I need is a button that can be disabled without its collider being disabled so it can still work with UIDragScrollView. So I got rid of the isEnabled = true in UIButton::OnEnable and replaced the isEnabled=false in OnDisable to UpdateColor(false,false). This works great since it allows me to disable and re enable the button at run-time in the inspector. The only hurdle left to jump over is tweening the color to the disabled color if the script is disabled. Awake is called even if the script is disabled. Putting UpdateColor(enabled, true) in there causes the desired effect. Thanks for your help.

3
I have a scene with just the simple button control prefab. When the scene is running and I disable the UIButton script the button does not tween to the disabled color. It also does not set its color to the disabled color when the UIButton script is disabled before running the scene. Adding isEnabled=true/false to UIButton::OnEnable/OnDisable fixed the toggling error but I have not found a way to get the button's color disabled on start up.

Pages: [1]