File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Assets/JCSUnity/Scripts/UI Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ public static JCS_Canvas GuessCanvas(Transform trans = null)
133133 public void AddComponentToResizeCanvas ( Component com )
134134 {
135135 Transform newParent = ( mResizeUI != null ) ? mResizeUI . transform : this . mCanvas . transform ;
136+
136137 if ( newParent == null )
137138 JCS_Debug . LogError ( "Attach resize canvas exception: " + com ) ;
138139 else
@@ -165,13 +166,21 @@ public void Hide(bool mute = false)
165166 JCS_SoundPlayer . PlayByAttachment ( mActiveSound , JCS_SoundMethod . PLAY_SOUND ) ;
166167 }
167168
169+ /// <summary>
170+ /// Return true if the canvas is currently visible.
171+ /// </summary>
172+ public bool IsShown ( )
173+ {
174+ return mCanvas . enabled ;
175+ }
176+
168177 /// <summary>
169178 /// Toggle the canvas' visibility.
170179 /// </summary>
171180 /// <param name="mute"> True to mute the sound. </param>
172181 public void ToggleVisibility ( bool mute = false )
173182 {
174- if ( mCanvas . enabled )
183+ if ( IsShown ( ) )
175184 Hide ( mute ) ;
176185 else
177186 Show ( mute ) ;
You can’t perform that action at this time.
0 commit comments