private void born_next_enemy() { var _reserve_data = reserve_pop_list[0]; PopObjectType _type = _reserve_data.type; if (false == prefab_data_dic.ContainsKey(_type)) { return; } GameObject _prefab = null; prefab_data_dic.TryGetValue(_type, out _prefab); GameObject _pop_text = GameObject.Instantiate( _prefab, transform.position, transform.rotation); // TODO Prefabの出現時のステータス設定。どこかに分離したい _pop_text.transform.SetParent(parent.transform, false); Vector2 pop_pos = new Vector2( UnityEngine.Random.Range(play_area_pos_x_min + 10, play_area_pos_x_max), UnityEngine.Random.Range(play_area_pos_y_min + 10, play_area_pos_y_max)); _pop_text.transform.localPosition = pop_pos; _pop_text.transform.localRotation = Quaternion.Euler(0, 0, UnityEngine.Random.Range(0, 360)); reserve_pop_list.Remove(_reserve_data); EnemyUnitBase _unit_base = _pop_text.GetComponent <EnemyUnitBase>(); if (null == _unit_base) { Debug.Util.LogError("EnemyUniteBase is null"); } Text _text = _pop_text.GetComponent <Text>(); _text.text = _reserve_data.word; _unit_base.Init(_text.text.ToString()); BoxCollider2D collider = _pop_text.GetComponent <BoxCollider2D>(); collider.size = new Vector2(_reserve_data.word.ToString().Length * 25, 60); UnitManagerSystem.Instance.SetPopEnemyNotification(_unit_base); }
public InitEnemyData(PopObjectType _type, GameObject _prefab) { prefabData = _prefab; type = _type; }
public void SetPopEnemyData(float _pop_interval, PopObjectType _pop_type, string[] _quest) { reserve_pop_list.Add(new ReserveData(_pop_interval, _pop_type, _quest[0])); reserve_pop_list.Add(new ReserveData(_pop_interval, _pop_type, _quest[1])); UpdateStart(); }
public ReserveData(float _interval, PopObjectType _type, string _word) { type = _type; next_interval_time = _interval; word = _word; }