Search Feedback

0
votes

Change name of one class in the hole project when you rename it

Scripting

-

-

You have one script, called PlayerManager.cs, and you use that class as component in other gameobjects.
You decide to change its name. To EnemyManager.cs, so the first problem is that you have to edit the script and change manually the name of the class, and then change every occurrence of PlayerManager in the hole project.

In eclipse for example all these is done automatically when you rename the class.

Also if you move this script to another folder, from unity editor project view, then an error of file PlayerManager.cs not found arises and should not because you have moved the file ( inside the editor of unity))
Create an script for example PlayerManager.cs, use PlayeManager class in other gameobjects.
Change the name of the script to whatver PlayerStatisctics.cs for example. You would have to rename manually file by file all the sites were PlayerManager is used.

Then organize the project, and create a folder PlayerScripts, move PlayerCharacter.cs to that folder ( in the project unity editor view). Then an error PkayerCharacter.cs is not found arises...unity

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(11030)

2D

(290)

Ads

(63)

AI & Navigation

(83)

Analytics

(130)

Animation

(413)

Asset Store

(370)

Asset Store Publisher

(21)

Assets

(557)

Audio

(185)

Cloud Build

(154)

Collaborate

(70)

Docs & Tutorials

(251)

Editor

(2579)

Everyplay

(17)

Game Performance Reporting

(22)

General

(1003)

Graphics

(903)

GUI

(447)

Input

(173)

Licensing

(93)

Networking

(192)

Physics

(392)

Platforms

(448)

Profiling & Optimization

(84)

Runtime

(188)

Scripting

(1154)

Terrain

(177)

WebGL

(145)