void OnCollisionEnter2D(Collision2D other) { Text other_text = other.gameObject.GetComponent <Text>(); if (null == other_text) { return; } Text this_text = this.gameObject.GetComponent <Text>(); TextJudgeResult result = ScoreManager.Instance.ContainsTextPair(this_text.text, other_text.text); if (result.isMatch()) { UnitManagerSystem.Instance.DeadEnemy(this.gameObject); } if (result.isFirst()) { SceneTransition.Instance.Sound.PlaySe(0); MissionNoticeInfo _notice_info = new MissionNoticeInfo( MissionNoticeType.BreakEnemy, new MissionNoticeEnemyBreak(status.name), this_text.text + " " + other_text.text ); UnitManagerSystem.Instance.EnemyBreakNotice.OnNext(_notice_info); } }
private void set_break_enemy(MissionNoticeInfo _info) { if (_info.NoticeType == MissionNoticeType.BreakEnemy) { Debug.Util.Log("Get " + _info.Name + " By Shopping"); if (shopping_result_dic.ContainsKey(_info.Name)) { shopping_result_dic[_info.Name]++; } else { shopping_result_dic.Add(_info.Name, 1); } } }
private void pop_reward(MissionNoticeInfo _info) { GameObject _prefab = null; // TODO Random取得をメソッド化して可用性を高めること(+1をtけないと全種類出せない…) int object_type = UnityEngine.Random.Range((int)PopObjectType.ShoppingBag, (int)PopObjectType.ShoppingBag3 + 1); prefab_data_dic.TryGetValue((PopObjectType)object_type, out _prefab); GameObject shopping_bag = GameObject.Instantiate( _prefab, transform.position, transform.rotation); // TODO Prefabの出現時のステータス設定。どこかに分離したい shopping_bag.transform.SetParent(parent.transform, false); shopping_bag.transform.localPosition = new Vector2( UnityEngine.Random.Range(0, 400), -162); shopping_bag.transform.localRotation = Quaternion.Euler(0, 0, 0); }