You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
634 B
25 lines
634 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
public class AddDialoguePlay : MonoBehaviour
|
|
{
|
|
private void Awake()
|
|
{
|
|
AddDialoguePlayScripts(gameObject);
|
|
}
|
|
|
|
/// <summary>
|
|
/// ΪËùÓÐTextÌí¼ÓDialoguePlay½Å±¾
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
void AddDialoguePlayScripts(GameObject obj) {
|
|
if (obj.GetComponent<Text>()) {
|
|
obj.AddComponent<DialoguePlay>();
|
|
}
|
|
for (int i=0;i<obj.transform.childCount;i++) {
|
|
AddDialoguePlayScripts(obj.transform.GetChild(i).gameObject);
|
|
}
|
|
}
|
|
}
|