void Awake() { EffectFactory.init(prefabs); MessageBroker.Default.Receive <EnemySpawnStart>().Subscribe(_ => { initialized = true; }); }
public static void miss(Vector3 world_position) { var damage_label = EffectFactory.create(EffectType.DamageLabel); GameObject go = damage_label.game_object; go.transform.SetParent(center_panel.transform); RectTransform rect_transform = damage_label.game_object.GetComponent <RectTransform>(); rect_transform.position = RectTransformUtility.WorldToScreenPoint(main_camera, world_position); rect_transform.position = new Vector3( rect_transform.position.x, rect_transform.position.y + damege_label_pos_y_offset, rect_transform.position.z ); DamageLabel label = go.GetComponent <DamageLabel>(); label.setMiss(); go.SetActive(true); }