javascript - Unity3D报警告"Implicit downcast"?
怪我咯
怪我咯 2017-04-11 11:39:31
0
0
378

在做unity的入门练习

LevelScript.js

#pragma strict var experience : int; function Level() : int { return experience / 750; }

LevelScriptEditor.js

#pragma strict @CustomEditor (LevelScript) class LevelScriptEditor extends Editor { function OnInspectorGUI() { var myLevelScript : LevelScript = target; myLevelScript.experience = EditorGUILayout.IntField("Experience", myLevelScript.experience); EditorGUILayout.LabelField("Level", myLevelScript.Level().ToString()); } }

(视频用的是c#,不过我比较熟悉javscript,就用了javascript的格式)

虽然最后程序成功了,但是unity报了警告有点在意。有人知道是什么意思么?

Assets/Editor/LevelScriptEditor.js(8,42): BCW0028: WARNING: Implicit downcast from 'UnityEngine.Object' to 'LevelScript'.

怪我咯
怪我咯

走同样的路,发现不同的人生

全員に返信 (0)
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!