private void ProcAjax_SaveSiteInfo() { int site_idx = HELPER.GetToInt32(HELPER.GetRequest("txtSiteIdx")); int category_idx = HELPER.GetToInt32(HELPER.GetRequest("ddlCategory")); string site_name = HELPER.GetString(HELPER.GetRequest("txtSiteName")); string site_url = HELPER.GetString(HELPER.GetRequest("txtSiteUrl")); string site_url_mobile = HELPER.GetString(HELPER.GetRequest("txtSiteUrlMobile")); int site_sort = HELPER.GetToInt32(HELPER.GetRequest("txtSiteSort")); string use_yn = HELPER.GetString(HELPER.GetRequest("ddlUseYN")); string result = ""; if (category_idx > 0) { if (site_idx <= 0) { result = (!(HELPER.GetRequest("txtSiteIdx") == "") ? "Abnormal SiteIdx" : HELPER.AddSiteInfo(category_idx, site_name, site_url, site_url_mobile, site_sort)); } else { result = HELPER.ModifySiteInfo(site_idx, category_idx, site_name, site_url, site_url_mobile, site_sort, use_yn); } } base.Response.Clear(); base.Response.Write(result); }
protected void Page_PreInit(object sender, EventArgs e) { string ajax_mode = HELPER.GetRequest("AJAX_MODE", "").Trim(); if (ajax_mode.Length != 0) { if (ajax_mode == "ADD_CATEGORY") { this.ProcAjax_AddCategory(); } else if (ajax_mode == "REMOVE_CATEGORY") { this.ProcAjax_RemoveCategory(); } else if (ajax_mode == "MOD_CATEGORY") { this.ProcAjax_ModCategory(); } else if (ajax_mode == "GET_SITE_INFO") { this.ProcAjax_GetSiteInfo(); } else if (ajax_mode == "SAVE_SITE_INFO") { this.ProcAjax_SaveSiteInfo(); } base.Response.End(); } }
public string GetMenuList() { HtmlGenericControl divMainCategory = new HtmlGenericControl("div"); divMainCategory.Attributes["class"] = "mainCategory"; int cnt = 0; foreach (DataRow drCategory in DS_MENU.Tables[0].Select(string.Format("USE_YN='Y' AND (PUBLIC_YN='{0}' OR '{0}'='')", PUBLIC_YN), "CATEGORY_SORT")) { int category_idx = HELPER.GetToInt32(drCategory["CATEGORY_IDX"]); string category_name = HELPER.GetString(drCategory["CATEGORY_NAME"]); string category_id = string.Format("cat_{0}", category_idx); HtmlGenericControl divSubCategory = new HtmlGenericControl("div"); divSubCategory.Attributes["class"] = "subCategory"; HtmlGenericControl spanSubCategoryTitle = new HtmlGenericControl("span"); spanSubCategoryTitle.Attributes["class"] = "title"; spanSubCategoryTitle.Attributes["onclick"] = string.Format("ToggleDisplayProp('{0}');", category_id); spanSubCategoryTitle.InnerText = category_name; HtmlGenericControl ulSiteList = new HtmlGenericControl("ul"); ulSiteList.Attributes["id"] = category_id; if (cnt == 0) { ulSiteList.Style["display"] = "block"; } foreach (DataRow drSite in DS_MENU.Tables[1].Select(string.Format("CATEGORY_IDX={0} AND USE_YN='Y'", category_idx.ToString()), "SITE_SORT")) { HtmlGenericControl liSiteTitle = new HtmlGenericControl("li"); int site_idx = HELPER.GetToInt32(drSite["SITE_IDX"]); string site_name = HELPER.GetString(drSite["SITE_NAME"]); string site_url = HELPER.GetString(drSite["SITE_URL"]); string site_url_mobile = HELPER.GetString(drSite["SITE_URL_MOBILE"]); string site_id = string.Format("site_{0}", site_idx); HtmlGenericControl spanSiteTitle = new HtmlGenericControl("span"); spanSiteTitle.Attributes["id"] = site_id; spanSiteTitle.Attributes["onclick"] = string.Format("MovePage('{0}', '{1}')", site_url_mobile, site_url); spanSiteTitle.Style["margin-right"] = "20px"; spanSiteTitle.InnerText = site_name; liSiteTitle.Controls.Add(spanSiteTitle); if (this.PUBLIC_YN == "") { HtmlGenericControl spanModify = new HtmlGenericControl("span"); spanModify.Style["cursor"] = "pointer"; spanModify.Style["margin-right"] = "20px"; spanModify.Attributes["onclick"] = string.Format("GetSiteInfo('{0}')", site_idx); spanModify.InnerText = "[수정]"; liSiteTitle.Controls.Add(spanModify); } ulSiteList.Controls.Add(liSiteTitle); } divSubCategory.Controls.Add(spanSubCategoryTitle); divSubCategory.Controls.Add(ulSiteList); divMainCategory.Controls.Add(divSubCategory); cnt++; } return(HELPER.GetControlRenderString(divMainCategory)); }
private void GetInput() { if (Distance > 0.1) { Debug.DrawLine(transform.position, transform.position - Vector3.up * CameraBottomDistance, Color.green); camBottom = Physics.Linecast(transform.position, transform.position - Vector3.up * CameraBottomDistance); } bool constrainMouseY = camBottom && transform.position.y - CameraPivot.transform.position.y <= 0f; if (Input.GetMouseButton(0) || Input.GetMouseButton(1)) { Screen.showCursor = false; mouseX += Input.GetAxis(MouseX) * MouseSpeed; if (constrainMouseY) { if (Input.GetAxis(MouseY) < 0f) { mouseY -= Input.GetAxis(MouseY) * MouseSpeed; } } else { mouseY -= Input.GetAxis(MouseY) * MouseSpeed; } } else { Screen.showCursor = true; } mouseY = HELPER.ClampAngle(mouseY, mouseYMin, mouseYMax); mouseXSmooth = Mathf.SmoothDamp(mouseXSmooth, mouseX, ref mouseXVel, MouseSmoothingFactor); mouseYSmooth = Mathf.SmoothDamp(mouseYSmooth, mouseY, ref mouseYVel, MouseSmoothingFactor); if (constrainMouseY) { mouseYMin = mouseY; } else { mouseYMin = -89.5f; } mouseYSmooth = HELPER.ClampAngle(mouseYSmooth, mouseYMin, mouseYMax); if (Input.GetMouseButton(1)) { RPGPlayerMotor.Instance.transform.rotation = Quaternion.Euler(RPGPlayerMotor.Instance.transform.eulerAngles.x, Camera.main.transform.eulerAngles.y, RPGPlayerMotor.Instance.transform.eulerAngles.z); } desiredDistance = desiredDistance - Input.GetAxis(MouseWheel) * MouseScroll; if (desiredDistance > DistanceMax) { desiredDistance = DistanceMax; } if (desiredDistance < SafeMinDistance) { desiredDistance = SafeMinDistance; } }
private void Move(float input_h) { if (Physics2D.gravity.x == 0) { rb2d.velocity = new Vector2(HELPER.getDir_Right(Physics2D.gravity).x *input_h *moveSpeed, rb2d.velocity.y); } else { rb2d.velocity = new Vector2(rb2d.velocity.x, HELPER.getDir_Right(Physics2D.gravity).y *input_h *moveSpeed); } }
private void ProcAjax_GetSiteInfo() { int site_idx = HELPER.GetToInt32(HELPER.GetRequest("SITE_IDX")); if (site_idx > 0) { DataRow[] dataRowArray = DS_MENU.Tables[1].Select(string.Format("SITE_IDX={0}", site_idx)); for (int i = 0; i < (int)dataRowArray.Length; i++) { DataRow drMenu = dataRowArray[i]; System.Web.Script.Serialization.JavaScriptSerializer objJs = new System.Web.Script.Serialization.JavaScriptSerializer(); System.Text.StringBuilder strBuilder = new System.Text.StringBuilder(); objJs.Serialize(new { category_idx = HELPER.GetToInt32(drMenu["CATEGORY_IDX"]), site_idx = HELPER.GetToInt32(drMenu["SITE_IDX"]), site_name = HELPER.GetString(drMenu["SITE_NAME"]), site_url = HELPER.GetString(drMenu["SITE_URL"]), site_url_mobile = HELPER.GetString(drMenu["SITE_URL_MOBILE"]), site_sort = HELPER.GetToInt32(drMenu["SITE_SORT"]) }, strBuilder); base.Response.Clear(); base.Response.ContentType = "application/json; charset=utf-8"; base.Response.Write(strBuilder.ToString()); } } }
public string GetDdlCategory() { DataTable dtCategory = DS_MENU.Tables[0].Clone(); foreach (DataRow dr in DS_MENU.Tables[0].Select(string.Format("USE_YN='Y' AND (PUBLIC_YN='{0}' OR '{0}'='')", PUBLIC_YN), "CATEGORY_SORT")) { dtCategory.ImportRow(dr); } HtmlSelect selectCategory = new HtmlSelect() { ID = "ddlCategory", DataValueField = "CATEGORY_IDX", DataTextField = "CATEGORY_NAME", DataSource = dtCategory }; selectCategory.DataBind(); return(HELPER.GetControlRenderString(selectCategory)); }
private void OnTriggerStay2D(Collider2D coll) { activated = true; if (!g_control.G_onChange) { float input_v = Input.GetAxisRaw("Vertical"); float input_h = Input.GetAxisRaw("Horizontal"); if (input_h == 1 && Input.GetKey(KeyCode.LeftShift)) { g_direction = HELPER.getDir_Right(Physics2D.gravity).normalized; g_mode = GetGmode(g_direction); if (g_mode != g_control.G_currentMode) { g_control.G_onChange = true; player.GetComponent <CharacterControl>().StartRotate(true, g_mode); } } else if (input_v == 1 && Input.GetKey(KeyCode.LeftShift)) { g_direction = -Physics2D.gravity.normalized; g_mode = GetGmode(g_direction); if (g_mode != g_control.G_currentMode) { g_control.G_onChange = true; player.GetComponent <CharacterControl>().StartRotate(false, g_mode); } } else if (input_h == -1 && Input.GetKey(KeyCode.LeftShift)) { g_direction = -HELPER.getDir_Right(Physics2D.gravity).normalized; g_mode = GetGmode(g_direction); if (g_mode != g_control.G_currentMode) { g_control.G_onChange = true; player.GetComponent <CharacterControl>().StartRotate(false, g_mode); } } } }
public override string ToString() { return(string.Format("{0} | {1} | {2} | {3} | ", CustomName, PlayerName, ChosenModule, HELPER.DifficultyToString(ChosenDifficulty))); }
private void OnDrawGizmos() { if (!enabled) { return; } if (GetComponent <MeshFilter>() != null || gameObject.collider != null) { CanDrawBounds = GetComponent <CharacterController>() == null; } else { CanDrawBounds = false; } CanDrawCamera = GetComponent <Camera>(); Color tmp = Gizmos.color; Matrix4x4 mat = Gizmos.matrix; switch (GizmoType) { case GizmoTypes.Anchor: Gizmos.color = Outline; Gizmos.DrawWireSphere(transform.position, GizmoSize); Gizmos.DrawRay(transform.position, transform.forward * GizmoSize * 2); Gizmos.color = Extra; Gizmos.DrawRay(transform.position, transform.up * GizmoSize * 2); Gizmos.DrawLine(transform.position - transform.forward * 0.1f * GizmoSize, transform.position - transform.forward * 0.1f * GizmoSize + transform.right * 0.4f * GizmoSize * 2); Gizmos.DrawLine(transform.position - transform.forward * 0.1f * GizmoSize, transform.position - transform.forward * 0.1f * GizmoSize - transform.right * 0.4f * GizmoSize * 2); Gizmos.color = GizmoLine; Gizmos.DrawRay(transform.position, transform.right * GizmoSize * 2); Gizmos.color = TextColor; Gizmos.DrawRay(transform.position, -transform.up * GizmoSize * 2); Gizmos.DrawRay(transform.position, -transform.right * GizmoSize * 2); Gizmos.DrawRay(transform.position, -transform.forward * GizmoSize * 2); if (DrawVolumetric) { Gizmos.color = Volumetric; Gizmos.DrawSphere(transform.position, Radius * GizmoSize); } break; case GizmoTypes.Arrows: HELPER.DrawArrow(transform.position, transform.forward * GizmoSize, Color.blue); HELPER.DrawArrow(transform.position, transform.up * GizmoSize, Color.green); HELPER.DrawArrow(transform.position, transform.right * GizmoSize, Color.red); break; case GizmoTypes.Box: Gizmos.color = GizmoLine; Gizmos.DrawWireCube(transform.position, Size * GizmoSize); if (DrawVolumetric) { Gizmos.color = Volumetric; Gizmos.DrawCube(transform.position, Size * GizmoSize); } break; case GizmoTypes.Circle: HELPER.DrawCircle(transform.position, Radius, Sections, CircleRotation, Angle, GizmoLine); break; case GizmoTypes.Direction: if (Direction != Vector3.zero) { HELPER.DrawArrow(transform.position, Direction, GizmoLine); } break; case GizmoTypes.Sphere: Gizmos.color = GizmoLine; Gizmos.DrawWireSphere(transform.position, Radius * GizmoSize); if (DrawVolumetric) { Gizmos.color = Volumetric; Gizmos.DrawSphere(transform.position, Radius * GizmoSize); } break; case GizmoTypes.Text: if (!string.IsNullOrEmpty(Text) && TextOffset != Vector3.zero) { Gizmos.color = new Color(TextColor.r, TextColor.g, TextColor.b, 0.3f); Gizmos.DrawLine(transform.position, transform.position + TextOffset); } GUIStyle style = new GUIStyle("box"); style.normal.textColor = TextColor; Handles.BeginGUI(); Vector3 pos = transform.position + TextOffset; Vector2 pos2D = HandleUtility.WorldToGUIPoint(pos); GUI.Label(new Rect(pos2D.x, pos2D.y, 100, 30), Text, style); Handles.EndGUI(); break; case GizmoTypes.Capsule: HELPER.DrawCapsule(transform, transform.position, Radius, Height, GizmoLine); break; case GizmoTypes.Character: // TODO: Future Gizmo for the npc/Enemy motor script ! break; case GizmoTypes.Player: if (GetComponent <RPGPlayerMotor>() != null) { Vector3 position = transform.position + GetComponent <CharacterController>().center; position = new Vector3(position.x, position.y - GetComponent <CharacterController>().height / 2f, position.z); HELPER.DrawCapsule(transform, position, GetComponent <CharacterController>().radius, GetComponent <CharacterController>().height, GizmoLine); HELPER.DrawArrow(transform.position, RPGPlayerMotor.Instance.MoveDirection, Extra); } break; case GizmoTypes.None: break; } if (PointSphere) { Gizmos.color = pointSphereColor; Gizmos.DrawSphere(transform.position, PoinSpehereRadius * GizmoSize); } if (DrawBoundings) { if (GetComponent <MeshFilter>() != null || gameObject.collider != null) { Gizmos.color = Outline; if (GetComponent <SphereCollider>() == null && GetComponent <CapsuleCollider>() == null && GetComponent <CharacterController>() == null) { var bounds = GetComponent <MeshFilter>() ? GetComponent <MeshFilter>().sharedMesh.bounds : gameObject.collider.bounds; if (UseLocalMatrix) { Gizmos.matrix = transform.localToWorldMatrix; } Gizmos.DrawWireCube(bounds.center, bounds.size); if (DrawVolumetric) { Gizmos.color = Volumetric; Gizmos.DrawCube(bounds.center, bounds.size); } Gizmos.matrix = mat; } else if (GetComponent <SphereCollider>()) { Gizmos.DrawWireSphere(transform.position, GetComponent <SphereCollider>().radius); if (DrawVolumetric) { Gizmos.color = Volumetric; Gizmos.DrawSphere(transform.position, GetComponent <SphereCollider>().radius); } } else if (GetComponent <CapsuleCollider>()) { var radius = GetComponent <CapsuleCollider>().radius; var height = GetComponent <CapsuleCollider>().height; Vector3 position = transform.position + GetComponent <CapsuleCollider>().center; position = new Vector3(position.x, position.y - height / 2f, position.z); HELPER.DrawCapsule(transform, position, radius, height, GizmoLine); } } } if (DrawCamera && GetComponent <Camera>()) { Vector3[] nearCorners = new Vector3[4]; Vector3[] farCorners = new Vector3[4]; Plane[] camPlanes = GeometryUtility.CalculateFrustumPlanes(GetComponent <Camera>()); Plane temp = camPlanes[1]; camPlanes[1] = camPlanes[2]; camPlanes[2] = temp; for (int i = 0; i < 4; i++) { nearCorners[i] = HELPER.Plan2Intersect(camPlanes[4], camPlanes[i], camPlanes[(i + 1) % 4]); farCorners[i] = HELPER.Plan2Intersect(camPlanes[5], camPlanes[i], camPlanes[(i + 1) % 4]); } for (int i = 0; i < 4; i++) { Debug.DrawLine(nearCorners[i], nearCorners[(i + 1) % 4], Outline, Time.deltaTime, true); Debug.DrawLine(farCorners[i], farCorners[(i + 1) % 4], Outline, Time.deltaTime, true); Debug.DrawLine(nearCorners[i], farCorners[i], GizmoLine, Time.deltaTime, true); } } if (DrawTexture && !string.IsNullOrEmpty(Icon)) { Gizmos.DrawIcon(transform.position + IconOffset, Icon); Gizmos.color = new Color(Outline.r, Outline.g, Outline.b, 0.3f); Gizmos.DrawLine(transform.position, transform.position + IconOffset); } if (PointBehavior == PointBehaviors.PlayerSpawn || PointBehavior == PointBehaviors.EnemySpawn || PointBehavior == PointBehaviors.NPCSpawn) { HELPER.DrawCircle(transform.position, 0.4f, 24, Vector3.zero, 360, GizmoLine); } Gizmos.color = tmp; }