小编사랑수*_*랑수학的帖子

脚本不继承可以管理脚本的本机类

大家。我是初学者统一用户。当我学习团结。我的 C# 脚本文件没有插入预制件。并返回错误消息:脚本没有继承可以管理脚本的本机类。

这是我的 C# 脚本代码。

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class unPlayerMovement
{
    private Transform tr;

    public float moveSpeed = 30.0f;
    public float rotSpeed = 150.0f;
    // Start is called before the first frame update
    void Start()
    {
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible = false;



tr = GetComponent<Transform>();


    }

    // Update is called once per frame
    void Update()
    {
        float h = Input.GetAxis("Mouse X");
        float v = Input.GetAxis("Vertical");

        Move();
    }
    void Move(float h, float v)
    {
        tr.Rotate(0, v …
Run Code Online (Sandbox Code Playgroud)

unity-game-engine

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

unity-game-engine ×1