public virtual void Adjust_HUD(Znak target) { Vector3 master_scale = gameObject.transform.parent.position; Vector3 ref_point = new Vector3(master_scale.x + modx, master_scale.y * 2 + mody); int mod = 0; if (target.Hand_id > 0) { mod = target.Hand_id - 1 + target.Pos_y; } if (select) { gameObject.transform.position = ref_point + new Vector3(target.Pos_x * CTRL.get_linka(target.master, posy).nota_lenght, (mod + target.Pos_y) * Hand_Ctrl.vyska_linek, 0); for (int i = 0; i < toggle_able.GetLength(0); i++) { toggle_able[i].SetActive(target.is_nota()); } for (int i = 0; i < auth_able.GetLength(0); i++) { auth_able[i].SetActive(auth); } } else { posy = target.Pos_y; if (last == null) { last = CTRL.get_linka(target.master, posy); } float posx = target.Pos_x; if (target.Delka == 4) { posx = posx + 1.5f; } else { posx++; } if (CTRL.get_linka(target.master, posy).full) { posy++; last.hud = false; last = CTRL.get_linka(target.master, posy, true); posx = 0; } gameObject.transform.position = ref_point + new Vector3(posx * CTRL.get_linka(target.master, posy).nota_lenght, (mod + posy) * Hand_Ctrl.vyska_linek, 0); } }
private void Change(Znak target = null) { if (target == null) { target = hands[selected_hand].vybrany; } Znak made; if (target.is_nota()) { made = target.gameObject.AddComponent <Pomlka>(); } else { made = target.gameObject.AddComponent <Nota>(); } made.Load(target); Destroy(target); }