Question by
yukisoulme · Sep 14, 2020 at 10:19 AM ·
scripting problemwarning
Getting Warning CS0618 'APIUpdaterRuntimeServices.AddComponent(GameObject, string, string)' is obsolete
I get this warning notification,
Severity Code Description Line File Suppression State
Warning CS0618 'APIUpdaterRuntimeServices.AddComponent(GameObject, string, string)' is obsolete: 'AddComponent(string) has been deprecated. Use GameObject.AddComponent<T>() / GameObject.AddComponent(Type) instead.
API Updater could not automatically update the original call to AddComponent(string name), because it was unable to resolve the type specified in parameter 'name'.
Instead, this call has been replaced with a call to APIUpdaterRuntimeServices.AddComponent() so you can try to test your game in the editor.
In order to be able to build the game, replace this call (APIUpdaterRuntimeServices.AddComponent()) with a call to GameObject.AddComponent<T>() / GameObject.AddComponent(Type).' 63 E:\UNITY Projects\aaa\Assets\crRPGSystem\CustomCharacterKit\Scripts\MBSCustomCharacter.cs Active
and this is the class where the warning comes,
void Finalize(Transform GO)
{
foreach(string s in components_to_add)
UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(GO.gameObject, @"Assets\crRPGSystem\CustomCharacterKit\Scripts\MBSCustomCharacter.cs (63,4)", s);
Animator A = GO.GetComponent<Animator>();
if (null != A && mecanim_controller)
A.runtimeAnimatorController = mecanim_controller;
GO.position = transform.position;
GO.rotation = transform.rotation;
if (destroy_after_load)
Destroy(gameObject);
}
can somebody help me fix this?
Comment