public void OnEnable() { GameObject tmpTrail = Instantiate(trail); UnityTool.Attach(gameObject, tmpTrail, Vector3.zero); if (IEnemy.enemys.Count > 0) { target = BarrageUtil.RandomFecthFromList <IEnemy>(IEnemy.enemys).gameObject; } }
public void SetWeapon(IWeapon Weapon) { if (m_Weapon != null) { m_Weapon.Release(); } m_Weapon = Weapon; m_Weapon.SetOwner(this); UnityTool.Attach(m_GameObject, m_Weapon.GetGameObject(), Vector3.zero); }
/// <summary> /// 播放特效 /// </summary> /// <param name="EffectName"></param> public void PlayEffect(string EffectName) { // 取得特效 IAssetFactory Factory = GameFactory.GetAssetFactory(); GameObject EffectObj = Factory.LoadEffect(EffectName); if (EffectObj == null) { return; } //附加到游戏物体上 UnityTool.Attach(m_GameObject, EffectObj, Vector3.zero); }