public void SelectActor(int actor_index) { if (!IsShow) { return; } for (int i = 0; i < mActorGameObjects.Count; ++i) { Actor actor = mActorGameObjects [i]; if (actor != null) { actor.mVisibleCtrl.SetActorVisible(i == actor_index, VisiblePriority.EXCEPT); } } if (actor_index >= 0 && actor_index < mActorGameObjects.Count) { Actor selectObj = mActorGameObjects [actor_index]; if (selectObj != null)// 在切场景时,有可能选中的角色已经被销毁 { if (SelectActorScene.Instance != null) { SelectActorScene.Instance.PreviewObject = selectObj.GetModelParent(); } PreviewLight.SelectLight(1, mData[actor_index].rid); } } if (actor_index < mData.Count) { string name = System.Text.Encoding.UTF8.GetString(mData[actor_index].name); mPowerText.text = xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_93") + ActorHelper.GetDisplayBattlePower(mData[actor_index].battle_power); } }