public void Initialize(DataCorridorParam _data) { data_param = _data; if (data_param.master != null) { transform.localPosition = new Vector3(data_param.master.x, data_param.master.y, 0.0f); } else { transform.localPosition = new Vector3(data_param.x, data_param.y, 0.0f); } //Debug.Log(_data); //Debug.Log(_data.corridor_event); if (_data.corridor_event == null) { _data.corridor_event = DataManagerGame.Instance.masterCorridorEvent.list.Find(p => p.corridor_event_id == _data.corridor_event_id); } m_txtLabel.text = _data.corridor_label; //Debug.Log(_data.corridor_event.sprite_name); if (_data.corridor_event.sprite_name != "") { m_sprIcon.sprite = SpriteManager.Instance.Get(_data.corridor_event.sprite_name); m_sprIcon.color = new Color( _data.corridor_event.color_r / 255.0f, _data.corridor_event.color_g / 255.0f, _data.corridor_event.color_b / 255.0f); } else { m_sprIcon.enabled = false; } }
public override void OnEnter() { base.OnEnter(); DataCorridorParam current_corridor = simulator.dataCorridor.list.Find(p => p.index == current_index.Value); Fsm.Event(current_corridor.corridor_event.sub_type); }
public override void OnEnter() { base.OnEnter(); aging_timer = 0.0f; target_corridor_index.Value = 0; charaControl.m_btnGo.interactable = false; charaControl.m_btnGo.gameObject.SetActive(true); charaControl.m_btnGo.onClick.AddListener(OnDecide); arrow_list.Clear(); int[] target_arr = new int[3] { charaControl.target_corridor.master.next_index, charaControl.target_corridor.master.next_index2, charaControl.target_corridor.master.next_index3 }; for (int i = 0; i < target_arr.Length; i++) { if (target_arr[i] == 0) { continue; } DataCorridorParam next_corridor = DataManagerGame.Instance.dataCorridor.list.Find(p => p.index == target_arr[i]); ArrowTargetCorridor arrow = PrefabManager.Instance.MakeScript <ArrowTargetCorridor>(charaControl.m_prefArrowTargetCorridor, charaControl.m_goArrowRoot); arrow.Initialize(charaControl.target_corridor, next_corridor); arrow.SelectArrowIndex.AddListener(OnSelectArrowIndex); arrow_list.Add(arrow); } }
public override void OnEnter() { base.OnEnter(); DataCorridorParam target = DataManagerGame.Instance.dataCorridor.list.Find(p => p.index == target_corridor_index.Value); if (target.master != null) { target_position.Value = new Vector3( target.master.x, target.master.y + 0.85f, -1.0f); } else { target_position.Value = new Vector3( target.x, target.y + 0.85f, -1.0f); } Vector3 dir = target_position.Value - charaControl.gameObject.transform.localPosition; charaControl.m_animator.SetFloat("x", dir.x); charaControl.m_animator.SetFloat("y", dir.y); Finish(); }
public void SetCorridor(DataCorridorParam _data) { target_corridor = _data; if (target_corridor.master != null) { transform.localPosition = new Vector3(target_corridor.master.x, target_corridor.master.y + 0.85f, -1.0f); } else { transform.localPosition = new Vector3(target_corridor.x, target_corridor.y + 0.85f, -1.0f); } }
public void Initialize(DataCorridorParam _now, DataCorridorParam _next) { m_next = _next; Vector2 image_arrow_dir = new Vector2(0.0f, 1.0f); float offset = 2.5f; Vector2 dir = new Vector2(_next.master.x - _now.master.x, _next.master.y - _now.master.y); Vector3 axis = Vector3.Cross(new Vector3(image_arrow_dir.x, image_arrow_dir.y, 0.0f), new Vector3(dir.x, dir.y, 0.0f)); //Debug.Log(axis); //Debug.Log(Vector2.Angle(image_arrow_dir, dir) * (axis.z < 0 ? -1 : 1)); float angle = Vector2.Angle(image_arrow_dir, dir) * (axis.z < 0 ? -1 : 1); m_sprArrow.transform.rotation = Quaternion.AngleAxis(angle, new Vector3(0.0f, 0.0f, 1.0f)); transform.localPosition = dir.normalized * offset; m_bIsLock = false; MasterCorridorEventParam e = DataManagerGame.Instance.masterCorridorEvent.list.Find(p => p.corridor_event_id == _now.corridor_event.corridor_event_id); // 制約なし if (_now.master.next_index == _next.index) { m_bIsLock = false; } else if (e != null && e.corridor_type == MasterCorridorEvent.CORRIDOR_EVENT_TYPE.DOOR.ToString().ToLower()) { m_bIsLock = true; m_sprKey.sprite = SpriteManager.Instance.Get(e.sprite_name); } else { m_bIsLock = false; } m_sprKey.gameObject.SetActive(m_bIsLock); }
private IEnumerator move_wait() { simulator.move_delay += 1; if (200 < simulator.move_delay) { simulator.move_delay = 0; yield return(null); } DataCardParam select_card = simulator.dataCard.RandomSelectFromHand(); DataCorridorParam current_corridor = simulator.dataCorridor.list.Find(p => p.index == current_index.Value); card_play_count.Value += 1; mp.Value += select_card.power; if (30 < mp.Value) { mp.Value = 30; } for (int i = 0; i < select_card.power; i++) { current_index.Value = current_corridor.next_index; current_corridor = simulator.dataCorridor.list.Find(p => p.index == current_index.Value); if (current_corridor.corridor_event.corridor_event_id == 2) { // ここダサすぎる break; } } select_card.status = (int)DataCard.STATUS.REMOVE; corridor_type.Value = current_corridor.corridor_event.corridor_type; Fsm.Event(current_corridor.corridor_event.corridor_type); }