SHARE
    TWEET
    evelynshilosky

    StorageInteractable - Part 6.2.1.1

    Apr 8th, 2025
    439
    0
    Never
    Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
    C# 0.91 KB | None | 0 0
    1. using UnityEngine;
    2. public class StorageInteractable : InteractableObject
    3. {
    4. public Transform storageHolder;
    5. private void Awake()
    6. {
    7. item = GetComponent<Item>();
    8. if (item == null)
    9. {
    10. Debug.LogError("StorageInteractable requires an Item component on the same GameObject.");
    11. enabled = false;
    12. }
    13. }
    14. private void Start()
    15. {
    16. if (item != null && storageHolder != null)
    17. {
    18. StorageSystem.Instance.InitializeStorage(item);
    19. StorageSystem.Instance.RegisterStorage(item, storageHolder);
    20. }
    21. }
    22. public override void Interact(PlayerMovement playerMovement, bool isRightClick)
    23. {
    24. if (isRightClick)
    25. {
    26. UIManager.Instance.ShowInventoryPrompt(item);
    27. }
    28. else
    29. {
    30. base.Interact(playerMovement, isRightClick);
    31. }
    32. }
    33. }
    Advertisement
    Add Comment
    Please, Sign In to add comment
    Public Pastes
    We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
    Not a member of Pastebin yet?
    Sign Up, it unlocks many cool features!

    AltStyle によって変換されたページ (->オリジナル) /