En este momento estás viendo Unity El nombre ‘PrefabUtility’ no existe en el contexto actual

 – Unity

Unity El nombre ‘PrefabUtility’ no existe en el contexto actual – Unity

Unity El nombre ‘PrefabUtility’ no existe en el contexto actual

– UnityAssets3Free

bienvenido , soy Camilo y hoy os traigo
nueva pregunta curiosa

Estoy tratando de construir un juego de Unity y sigo recibiendo el error:

Assetscharaterseelection.cs(34,9): error CS0103: el nombre ‘PrefabUtility’ no existe en el contexto actual

El problema es que importé UnityEditor, no estoy seguro de lo que está pasando

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.SceneManagement;

public class charaterselection : MonoBehaviour

    public SpriteRenderer sr;
    public List<Sprite> skins = new List<Sprite>();
    private int selecectedSkin;
    public GameObject player;

    public void Next()
    
        selecectedSkin=selecectedSkin+1;
        if (selecectedSkin== skins.Count)
        
            selecectedSkin=0;
        
        sr.sprite= skins[selecectedSkin];
    

    public void back()
    
        selecectedSkin = selecectedSkin - 1;
        if (selecectedSkin < 0)
        
            selecectedSkin = skins.Count - 1;
        
        sr.sprite = skins[selecectedSkin];
    

    public void play()
    
        PrefabUtility.SaveAsPrefabAsset(player, "Assets/Players/FROGY.prefab");
        SceneManager.LoadScene(1);
    

1 respuesta 1

Gracias chicos por la ayuda, literalmente acabo de crear un archivo llamado «Editor» y funcionó.

nota: si aun no se resuelve tu pregunta por favor dejar un comentario y pronto lo podremos de nuevo , muchas gracias

eso es todo,hasta la proxima

Deja una respuesta