Exemple #1
0
    public virtual void init(string name, List <int> param, int world, int x, int y, int xx, int yy)
    {
        m_name       = name;
        m_param      = param;
        m_collider   = this.GetComponent <mario_collider> ();
        m_animator   = this.GetComponent <Animator>();
        m_mario_anim = this.GetComponent <mario_anim>();
        if (m_mario_anim != null)
        {
            if (m_mario_anim.do_defualt())
            {
                if (m_animator != null)
                {
                    m_animator.enabled = false;
                }
            }
            else
            {
                m_mario_anim.enabled = false;
            }
        }
        m_pos.set(xx, yy);
        reset_bound();
        record_per();
        set_pos();
        m_world = world;
        m_init_pos.set(x, y);
        reset();

        if (x != -1)
        {
            if (x > 0)
            {
                int type = game_data._instance.m_arrays[m_world][y][x - 1].type;
                if (type != 0)
                {
                    s_t_unit t_unit = game_data._instance.get_t_unit(type);
                    if (t_unit.is_static == 1)
                    {
                        m_nleft = true;
                    }
                }
            }
            if (x < game_data._instance.m_map_data.maps[m_world].x_num - 1)
            {
                int type = game_data._instance.m_arrays[m_world][y][x + 1].type;
                if (type != 0)
                {
                    s_t_unit t_unit = game_data._instance.get_t_unit(type);
                    if (t_unit.is_static == 1)
                    {
                        m_nright = true;
                    }
                }
            }
        }
    }
Exemple #2
0
 public override void reset()
 {
     for (int i = 0; i < m_s.Count; ++i)
     {
         m_s[i].SetActive(false);
     }
     m_s [m_param [0]].SetActive(true);
     m_time = 100;
     m_p.set(m_pos.x * 2, m_pos.y * 2);
 }
Exemple #3
0
    public void reset(edit_cy ec)
    {
        m_grid.set(ec.p.x / utils.g_grid_size, ec.p.y / utils.g_grid_size);
        float a = 0.9f - ec.num * 0.015f;

        if (a < 0.5f)
        {
            a = 0.5f;
        }
        this.GetComponent <SpriteRenderer> ().color  = new Color(1, 1, 1, a);
        this.GetComponent <SpriteRenderer> ().sprite = ec.sp;
    }
Exemple #4
0
 void record_per()
 {
     m_per_pos.set(m_pos.x, m_pos.y);
     m_per_grid.set(m_grid.x, m_grid.y);
     m_per_is_on_floor      = m_is_on_floor;
     m_per_is_on_char       = m_is_on_char;
     m_per_bound.left       = m_bound.left;
     m_per_bound.right      = m_bound.right;
     m_per_bound.top        = m_bound.top;
     m_per_bound.bottom     = m_bound.bottom;
     m_per_bound.left_div   = m_bound.left_div;
     m_per_bound.right_div  = m_bound.right_div;
     m_per_bound.top_div    = m_bound.top_div;
     m_per_bound.bottom_div = m_bound.bottom_div;
 }