Created
November 17, 2024 15:03
-
-
Save vbayeva/53209bdf967db22e97882fc3d147a90d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AniamtionController : MonoBehaviour | |
| { | |
| [SerializeField] private PlayerControllerHolder playerControllerHolder; | |
| private void Start() | |
| { | |
| if (playerControllerHolder == null) | |
| return; | |
| playerControllerHolder.PlayerController.PlayAnimation(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PlayerControllerAssigner : MonoBehaviour | |
| { | |
| [SerializeField] private PlayerController playerController; | |
| [SerializeField] private PlayerControllerHolder playerControllerHolder; | |
| private void Start() | |
| { | |
| if (playerControllerHolder != null) | |
| { | |
| playerControllerHolder.PlayerController = playerController; | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [CreateAssetMenu(fileName = "PlayerControllerHolder", menuName = "Scriptable Objects/PlayerControllerHolder")] | |
| public class PlayerControllerHolder : ScriptableObject | |
| { | |
| public PlayerController PlayerController; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment