Removed TOTU 103
This commit is contained in:
		
							
								
								
									
										41
									
								
								Assets/Common/Scripts/AnimationToggle.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								Assets/Common/Scripts/AnimationToggle.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | ||||
| // Copyright 2022-2024 Niantic. | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
|  | ||||
| public class AnimationToggle : MonoBehaviour | ||||
| { | ||||
|     public bool Open; | ||||
|     [SerializeField] | ||||
|     private Animator m_Animator; | ||||
|  | ||||
|     public void toggleStateFunction() | ||||
|     { | ||||
|         if (Open) | ||||
|         { | ||||
|             m_Animator.SetTrigger("Close"); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             m_Animator.SetTrigger("Open"); | ||||
|         } | ||||
|         Open = !Open; | ||||
|     } | ||||
|     public void CloseState() | ||||
|     { | ||||
|         if (Open) | ||||
|         { | ||||
|             m_Animator.SetTrigger("Close"); | ||||
|             Open = !Open; | ||||
|         } | ||||
|          | ||||
|     } | ||||
|     public void OpenState() | ||||
|     { | ||||
|         if (!Open) | ||||
|         { | ||||
|             m_Animator.SetTrigger("Open"); | ||||
|             Open = !Open; | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Ignacio Gómez Puga
					Ignacio Gómez Puga