private BattleText CreateObjects(Combatant combatant)
{
BattleText bt = null;
GameObject txtObj = new GameObject();
Transform trans = TransformHelper.GetChild(this.posChild, combatant.prefabInstance.transform);
txtObj.transform.position = trans.position;
if(DataHolder.BattleSystemData().mountTexts)
{
txtObj.transform.parent = trans;
}
if(GUISystemType.ORK.Equals(DataHolder.GameSettings().guiSystemType))
bt = txtObj.AddComponent<BattleText>();
else
bt = (BattleTextGUI)txtObj.AddComponent<BattleTextGUI>();
if(this.spawnPrefab)
{
GameObject pref = this.GetPrefab();
if(pref != null)
{
trans = TransformHelper.GetChild(this.prefabChild, combatant.prefabInstance.transform);
pref.transform.position = trans.position+trans.TransformDirection(this.prefabOffset);
pref.transform.rotation = trans.rotation;
if(DataHolder.BattleSystemData().mountTexts)
{
pref.transform.parent = trans;
}
if(this.prefabTime > 0)
{
DestroyAfterTime comp = pref.AddComponent<DestroyAfterTime>();
comp.time = this.prefabTime;
}
}
}
if(this.playAudio)
{
AudioSource s = combatant.GetAudioSource();
if(s != null)
{
s.PlayOneShot(this.GetAudioClip());
}
}
return bt;
}