// Use this for initialization public void reset(mario.ChangeStateHandle handle, int type = 0, int x = 0, int y = 0) { m_type = type; m_handle = handle; this.gameObject.SetActive(true); if (m_type == 1) { m_t1.SetActive(true); m_x = (float)x / mario._instance.m_width + 0.5f; m_y = (float)y / mario._instance.m_height + 0.5f; m_range = 0.6f; m_tex.material.SetFloat("_range", m_range); m_tex.material.SetFloat("_x", m_x); m_tex.material.SetFloat("_y", m_y); m_tex.material.SetFloat("_ck", (float)mario._instance.m_width / mario._instance.m_height); this.GetComponent <UIPanel>().RebuildAllDrawCalls(); this.GetComponent <Animator> ().Play("mask_gui1"); } else { m_t1.SetActive(false); this.GetComponent <Animator> ().Play("mask_gui"); } }
public void reset(mario.ChangeStateHandle handle) { m_handle = handle; this.gameObject.SetActive(true); m_time = 0; m_type = 0; m_objs.Clear(); mario._instance.remove_child(m_panel); for (int j = 0; j < 4; ++j) { for (int i = 0; i < 8; ++i) { GameObject obj = (GameObject)Instantiate(m_sub); obj.transform.parent = m_panel.transform; obj.transform.localPosition = new Vector3(-560 + i * 160, -240 + j * 160, 0); obj.transform.localScale = new Vector3(0, 0, 0); obj.SetActive(true); m_objs.Add(obj); } } for (int i = 0; i < m_objs.Count; ++i) { float t = (i / 8 + i % 8) * 0.05f + 1.0f; utils.add_scale_anim(m_objs[i], 0.2f, new Vector3(1, 1, 1), t); } }
void middle() { m_handle(); m_handle = null; if (m_type == 1) { m_t1.SetActive(false); } }