Search Results for

    Show / Hide Table of Contents

    Class HatRespawn

    This class manages the behavior of the hat in the game, including its respawn logic. The hat can be picked up, dropped, and respawned after a certain amount of time.

    Inheritance
    object
    HatRespawn
    Namespace: Game
    Assembly: cs.temp.dll.dll
    Syntax
    public class HatRespawn : MonoBehaviour

    Fields

    canBePickedUp

    A flag to check if the hat can be picked up.

    Declaration
    public static bool canBePickedUp
    Field Value
    Type Description
    bool

    initialScale

    The initial scale of the hat.

    Declaration
    public Vector2 initialScale
    Field Value
    Type Description
    Vector2

    initialSubhatPosition

    The initial position of the subhat (if applicable).

    Declaration
    public Vector2 initialSubhatPosition
    Field Value
    Type Description
    Vector2

    respawnTime

    The amount of time (in seconds) before the hat respawns after being inactive.

    Declaration
    public const float respawnTime = 10
    Field Value
    Type Description
    float

    Methods

    Interact()

    Updates the last interaction time when a player interacts with the hat.

    Declaration
    public void Interact()

    OnHatDropped()

    Marks the hat as dropped and resets the timer.

    Declaration
    public void OnHatDropped()
    In This Article
    Back to top Example Unity documentation footer