Exemple #1
0
    public DataCorridorParam(MasterCorridorParam _master, MasterCorridorEventParam _corridor_event)
    {
        stage_id = _master.stage_id;
        index    = _master.index;

        master         = _master;
        corridor_event = _corridor_event;
    }
Exemple #2
0
        public override void OnEnter()
        {
            base.OnEnter();
            charaControl.m_eStatus = CharaControl.STATUS.MOVE;

            MasterCorridorEventParam corridor_event = null;

            if (charaControl.target_corridor.master != null)
            {
                corridor_event = DataManagerGame.Instance.masterCorridorEvent.list.Find(p => p.corridor_event_id == charaControl.target_corridor.master.corridor_event_id);
            }
            else
            {
                corridor_event = DataManagerGame.Instance.masterCorridorEvent.list.Find(p => p.corridor_event_id == charaControl.target_corridor.corridor_event.corridor_event_id);
            }

            if (corridor_event.label == "BOSS")
            {
                // ボスは一時停止
                Fsm.Event("end");
            }
            else if (corridor_event.corridor_event_id == 2)
            {
                // ゴールも停止
                Fsm.Event("end");
            }
            else if (0 < move_num.Value)
            {
                if (charaControl.target_corridor.IsSingle())
                {
                    // 明日はここから
                    if (charaControl.target_corridor.master != null)
                    {
                        target_corridor_index.Value = charaControl.target_corridor.master.next_index;
                    }
                    else
                    {
                        target_corridor_index.Value = charaControl.target_corridor.next_index;
                    }

                    //Debug.Log(move_num.Value + ":" + target_corridor_index.Value);
                    Fsm.Event("move");
                }
                else
                {
                    Fsm.Event("select");
                }
            }
            else
            {
                Fsm.Event("end");
            }
        }
Exemple #3
0
        private int GetKeyItemId(int _iNextIndex)
        {
            int iRet = 0;
            MasterCorridorEventParam e = DataManagerGame.Instance.masterCorridorEvent.list.Find(p =>
                                                                                                p.corridor_event_id == charaControl.target_corridor.master.corridor_event_id);

            if (_iNextIndex != charaControl.target_corridor.master.next_index)
            {
                iRet = e.key_item_id;
            }
            return(iRet);
        }
Exemple #4
0
 public void Create(List <MasterCorridorParam> _masterList)
 {
     list.Clear();
     foreach (MasterCorridorParam master in _masterList)
     {
         MasterCorridorEventParam event_param = DataManagerGame.Instance.masterCorridorEvent.list.Find(p => p.corridor_event_id == master.corridor_event_id);
         //Debug.Log(master.corridor_event_id);
         //Debug.Log(event_param);
         DataCorridorParam param = new DataCorridorParam(master, event_param);
         list.Add(param);
     }
 }
Exemple #5
0
    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);
    }