Example #1
0
    public void DownWindow(int z_index)
    {
        window_select w_temp = m_windows_stack[z_index];

        for (int i = z_index; i < m_len - 1; i++)
        {
            m_windows_stack[i]           = m_windows_stack[i + 1];
            m_windows_stack[i].m_z_index = i;
            m_windows_stack[i].SetZIndex();
        }
        m_windows_stack[m_len - 1]           = w_temp;
        m_windows_stack[m_len - 1].m_z_index = m_len - 1;
        m_windows_stack[m_len - 1].SetZIndex();
    }
Example #2
0
    public void PopWindow(int z_index)
    {
        window_select w_temp = m_windows_stack[z_index];

        for (int i = z_index; i > 0; i--)
        {
            m_windows_stack[i]           = m_windows_stack[i - 1];
            m_windows_stack[i].m_z_index = i;
            m_windows_stack[i].SetZIndex();
        }
        m_windows_stack[0]           = w_temp;
        m_windows_stack[0].m_z_index = 0;
        m_windows_stack[0].SetZIndex();
    }
 // Update is called once per fram0.1
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.K) && m_canswitch)
     {
         Collider2D[] hitColliders = Physics2D.OverlapBoxAll(this.transform.position, new Vector2(0.1f, 0.1f), 0);
         foreach (Collider2D hitc in hitColliders)
         {
             if (cur_window.GetComponent <window1_startgame>())
             {
                 if (this.transform.position.x < -1020)
                 {
                     break;
                 }
             }
             if (cur_window.GetComponent <chatbox_control>())
             {
                 if (this.transform.position.x > 283)
                 {
                     break;
                 }
                 if (this.transform.position.y > -400 && this.transform.position.y < -95)
                 {
                     break;
                 }
             }
             window_select window = hitc.GetComponentInParent <window_select>();
             if (window && window.m_z_index != 0)
             {
                 window_stack stack = window_stack.GetInstance();
                 stack.PopWindow(window.m_z_index);
                 stack.SetWindowCollider(0);
                 if (window.GetComponent <chatbox_control>())
                 {
                     window.GetComponent <chatbox_control>().GiveList(this.GetComponent <avatar_get>().CalList() > 4 ? 3: this.GetComponent <avatar_get>().CalList() - 1);
                 }
                 if (window.GetComponent <window_enemy>())
                 {
                     if (this.GetComponent <avatar_get>().m_gets[2] == true)
                     {
                         window.GetComponent <window_enemy>().delete_block();
                     }
                 }
                 if (window.GetComponent <gitpush>())
                 {
                     m_canswitch = false;
                     if (window.GetComponent <gitpush>().m_appear)
                     {
                         StartCoroutine(window.GetComponent <gitpush>().ControlMove());
                     }
                     else if (window.GetComponent <gitpush>().m_rappear)
                     {
                         StartCoroutine(window.GetComponent <gitpush>().ControlRMove());
                     }
                 }
                 if (window.GetComponent <windows1>())
                 {
                     if (this.GetComponent <avatar_get>().m_canpush)
                     {
                         window_stack.Reload();
                         Application.LoadLevel("Main");
                     }
                     if (this.GetComponent <avatar_get>().m_gets[3] == false)
                     {
                         avatar_move am = this.GetComponent <avatar_move>();
                         am.transform.position = new Vector3(am.m_x, am.m_pos1, am.transform.position.z);
                         am.m_start_control    = false;
                     }
                 }
                 if (cur_window.GetComponent <gitpush>())
                 {
                     m_canswitch = true;
                     stack.DownWindow(cur_window.m_z_index);
                     cur_window.GetComponent <gitpush>().Hidden();
                 }
                 if (cur_window.GetComponent <chatbox_control>())
                 {
                     cur_window.GetComponent <chatbox_control>().StopAll();
                 }
                 cur_window = window;
                 GameObject.FindWithTag("Player").GetComponent <avatar_move>().m_fall = true;
                 break;
             }
         }
     }
 }