public void unity_center(emit_dataset em) //表示する { if (flame) { switch (em.id) { case 0: obj_x[em.id, em.obj] = disp_x / -2f; obj_y[em.id, em.obj] = disp_y / 2f; break; case 1: obj_x[em.id, em.obj] = disp_x / 2f; obj_y[em.id, em.obj] = disp_y / 2f; break; case 2: obj_x[em.id, em.obj] = disp_x / -2f; obj_y[em.id, em.obj] = disp_y / -2f; break; case 3: obj_x[em.id, em.obj] = disp_x / 2f; obj_y[em.id, em.obj] = disp_y / -2f; break; } } else { obj_x[em.id, em.obj] = 0f; obj_y[em.id, em.obj] = 0f; } }
public void socket_hide(SocketIOEvent e) //隠す { JSONObject obj = e.data; int socket_group = (int)obj.GetField("Group").n; if (socket_group == Group) { int socket_number = (int)obj.GetField("Number").n; int socket_obj = (int)obj.GetField("Obj").n; float socket_num1 = obj.GetField("Num1").n; float socket_num2 = obj.GetField("Num2").n; int socket_sw = (int)obj.GetField("Emitsw").n; emit_dataset nowdata = new emit_dataset("hide", socket_number, socket_obj, socket_num1, socket_num2); if (socket_sw == 1) { emitdataset.Add(nowdata); } else { int remdata = checkArrayclass(nowdata, emitdataset); if (remdata >= 0) { emitdataset.RemoveAt(remdata); } } } }
public void unity_warp(emit_dataset em) //画面の中央に移動する { obj_x[em.id, em.obj] = em.num1; obj_y[em.id, em.obj] = em.num2; if (obj_disp[em.id, em.obj] == -1) { obj_disp[em.id, em.obj] = 1; } }
public void unity_angle(emit_dataset em) //角度をn度にする { obj_r[em.id, em.obj] = em.num1; obj_d[em.id, em.obj] = em.num1; if (obj_disp[em.id, em.obj] == -1) { obj_disp[em.id, em.obj] = 1; } }
public void unity_rotate(emit_dataset em) //n度回す { obj_r[em.id, em.obj] += em.num1; obj_d[em.id, em.obj] += em.num1; if (obj_disp[em.id, em.obj] == -1) { obj_disp[em.id, em.obj] = 1; } }
public void unity_movexy(emit_dataset em) //x座標をnずつ動かす { obj_x[em.id, em.obj] += em.num1; obj_y[em.id, em.obj] += em.num2; if (obj_disp[em.id, em.obj] == -1) { obj_disp[em.id, em.obj] = 1; } //send_pos(socket_num, socket_obj, obj_x[socket_num, socket_obj], obj_y[socket_num, socket_obj]); }
public void unity_move(emit_dataset em) { obj_x[em.id, em.obj] += em.num1 * Mathf.Cos(obj_d[em.id, em.obj] * Mathf.Deg2Rad); obj_y[em.id, em.obj] += em.num1 * Mathf.Sin(obj_d[em.id, em.obj] * Mathf.Deg2Rad); if (obj_disp[em.id, em.obj] == -1) { obj_disp[em.id, em.obj] = 1; } //send_pos(socket_num, socket_obj, obj_x[socket_num, socket_obj], obj_y[socket_num, socket_obj]); }
int checkArrayclass(emit_dataset em, List <emit_dataset> li) { emit_dataset _em; for (int i = 0; i < li.Count; i++) { _em = li[i]; if (em.Equals(_em)) { return(i); } } return(-1); }
public override bool Equals(object obj) { // Accountクラスに型変換 emit_dataset other = obj as emit_dataset; if (other == null) { // objがemit_datasetクラスでない場合、またはnullの場合は等しくないとする return(false); } else { // objがAccountクラスの場合、かつ全ての値が等しいときTrueを返す bool ret = this.emit == other.emit && this.obj == other.obj && this.num1 == other.num1 && this.id == other.id; return(ret); } }
public void unity_hide(emit_dataset em) //隠す { obj_disp[em.id, em.obj] = (int)em.num1; }