Search Unity

Mam problem z błędem CS0116 w tym skrypcie

Discussion in 'Scripting' started by EPGS, Jul 13, 2021.

?

Co jest źle?

This poll will close on Nov 27, 2048 at 9:32 AM.
  1. złe klamerki

    0 vote(s)
    0.0%
  2. inne

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. EPGS

    EPGS

    Joined:
    Jul 8, 2021
    Posts:
    6
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.SceneManagement;

    public class menu : MonoBehaviour
    {
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {

    }
    }
    void OnGUI()
    {
    if (GUI.Button(new Rect(10, 70, 50, 30), "Btncredits"))
    {
    Application.LoadLevel(1);
    }
    }
     
  2. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
  3. RadRedPanda

    RadRedPanda

    Joined:
    May 9, 2018
    Posts:
    1,648
    metody i zmienne muszą być zadeklarowane i zdefiniowane w strukturze lub klasie

    OnGUI został umieszczony poza klasą

    Używałem tłumacza Google