示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        player_current_health = player_max_health;

        player_sprite = GetComponent <SpriteRenderer>();
        SFX_MAN       = FindObjectOfType <SFX_manager>();
        Music_man     = FindObjectOfType <Music_manager>();
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        anim          = GetComponent <Animator>();
        player_sprite = GetComponent <SpriteRenderer>();
        player_rigid  = GetComponent <Rigidbody2D>();
        SFX_MAN       = FindObjectOfType <SFX_manager>();
        bag           = FindObjectOfType <bag_manager>();

        player_inventory = FindObjectOfType <Inventory>();

        //for moving between levels
        if (!playerExists)
        {
            playerExists = true;
            DontDestroyOnLoad(transform.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }