void Start() { slider = GetComponent <Slider>(); rect = PositiveArea.GetComponent <RectTransform>(); arrowrect = Arrow.GetComponent <RectTransform>(); DaramFunc = GameManager.gm.DaramFunction[UserLevel]; switch (UserLevel) { case User.level1: UnlockKey = "UnlockDaram1"; break; case User.level2: UnlockKey = "UnlockDaram2"; break; } // NaN exception이 뜨지 않게 대충 초기화 DaramFunc.k = 1; DaramFunc.x = 0; DaramFunc.a = 0; DaramFunc.max = 1; DaramFunc.min = -1; }
void Start() { arrowImage = GetComponent <Image>(); slider = GetComponent <Slider>(); //rect = PositiveArea.GetComponent<RectTransform>(); arrowrect = Arrow.GetComponent <RectTransform>(); DaramFunc = GameManager.gm.DaramFunction[UserLevel]; SetUnlockKey(); /* * switch (UserLevel) * { * case User.level1: * UnlockKey = "UnlockBasic1"; * break; * case User.level2: * UnlockKey = "UnlockBasic2"; * break; * } */ // NaN exception이 뜨지 않게 대충 초기화 DaramFunc.x = 0; DaramFunc.a = 0; DaramFunc.max = 1; DaramFunc.min = -1; DaramFunc.solution = 2; }
//lv2 다람쥐가 해금되면 실행됨 public void FameDaram2() { CalculateQuadric(); Quadric q = DaramFunction[User.level2]; fame += (int)q.value; }
private void UpdateTextureImage(string filename) { if (selectedSceneElement != null && isPolygon(selectedSceneElement)) { Polygon polygon = getPolygon(selectedSceneElement); //polygon.Material = new Material(); polygon.Material.Texture.Create(sceneControl1.Scene.OpenGL, filename); statusStripStatusLabel1.Text = "Tips:拖入纹理前请选中要添加纹理的对象"; } else if (selectedSceneElement != null && isQuadric(selectedSceneElement)) { Quadric quadric = getQuadric(selectedSceneElement); quadric.Material.Texture.Create(sceneControl1.Scene.OpenGL, filename); statusStripStatusLabel1.Text = "Tips:拖入纹理前请选中要添加纹理的对象"; } else { statusStripStatusLabel1.Text = "Warming:当前未选中物体,请左键点击后再进行操作。"; statusStripStatusLabel1.ForeColor = Color.Red; } //var gl = this.sceneControl1.OpenGL; //if (this.texture != null) //{ // this.texture.Destroy(gl); // this.texture.Create(gl, filename); //} }
public void Evaluate() { Quadric function = new Quadric(); Vector v1 = new Vector(new double[] { 0, 0, 0 }); Vector v2 = new Vector(new double[] { 1, 2, 3 }); Assert.AreEqual(0, function.Evaluate(v1)); Assert.AreEqual(46, function.Evaluate(v2)); }
public void Daram2Number() { if (DN2Cool < gm.time) { Quadric q = gm.DaramFunction[User.level2]; if (q.value == 0) { return; } if (q.value > 0) { return; } else if (q.diff < 0) { switch (Random.Range(0, 3)) { case 0: CreateChat("아직도 Lv1짜리 다람쥐뿐인가..", 3); break; case 1: CreateChat("고렙 다람쥐가 있기는 한거야?", 3); break; case 2: CreateChat("한방짜리 다람쥐는 너무 시시하다구!!", 3); break; } } else { switch (Random.Range(0, 3)) { case 0: CreateChat("초보자 배려좀 ㅠㅠ", 3); break; case 1: CreateChat("고렙 다람쥐 잡을 파티 구합니다 (5/8)", 3); break; case 2: CreateChat("여기 초보자 사냥터 아닌가여;;;;", 3); break; } } DN2Cool = gm.time + Random.Range(3, 5); } }
void Awake() { if (GMCreated == true) // GM 중복생성 방지 { Destroy(gameObject); return; } Application.targetFrameRate = 60; DontDestroyOnLoad(this); // 씬이 넘어가도 파괴되지 않음 gm = this; _Gamemanager = Gamemanager; if (SceneManager.GetActiveScene().name == "Test") { currentStageScene = "Test"; } mus = GetComponentInChildren <Music>(); se = GetComponentInChildren <SE>(); //UserCount, UserDamagePerLevel 초기화 userCount = Enumerable.Repeat(0, User.Count).ToArray(); userCount[User.level1] = 1000; userDamagePerLevel = Enumerable.Repeat(0f, User.Count).ToArray(); userDamagePerLevel[User.level1] = 0.001f; userDamagePerLevel[User.level2] = 0.01f; DaramFunction = new Quadric[User.Count]; for (int i = 0; i < User.Count; i++) { DaramFunction[i] = new Quadric(); } DaramDeath += DaramDeath1; DaramDeath += DaramDeath2; DaramDeath += EnemyFameChange; // 인기도 계산 전에 실행되야 함 FameChange += Daram.CalculateDaramVariety; FameChange += FameDaram1; FameChange += FameBug; UserChange += UserLevel1; FameChange += CheckFameZero; //RoundStartEvent += CheckDaramDeveloper; Random.seed = (int)Time.time; }
// // // 인기도 // // // public void FameDaram1() { // IsInterRound가 true이면 인기도는 변하지 않아도 함수는 작동함 Quadric q = DaramFunction[User.level1]; q.k = 0.2f; q.x = Daram.All.Count; q.a = 10 + fame / 1000; q.max = 5; q.min = -5; if (!isInterRound) { fame += (int)q.value; } }
//lv2 다람쥐가 해금되면 실행됨 public void FameDaram2() { // IsInterRound가 true이면 인기도는 변하지 않아도 함수는 작동함 Quadric q = DaramFunction[User.level2]; q.k = 0.2f; q.x = Daram.FindByType("Basic", 2); q.a = 5 + userCount[User.level2] / 100 + userCount[User.level1] / 2000; q.max = 2; q.min = -3; if (!isInterRound) { fame += (int)q.value; } }
void CalculateQuadric() { Quadric q = DaramFunction[User.level1]; q.x = Daram.FindByType("", 1); q.a = 9.0f + (float)userCount[User.level1] / 500.0f; q.max = 5.0f + Daram.VarietyModifier / 2.0f; q.min = -5.0f; q.solution = 10.0f * Daram.VarietyModifier + q.a / 10.0f; q = DaramFunction[User.level2]; q.x = Daram.FindByType("", 2); q.a = 5.0f + (float)userCount[User.level2] / 500.0f + (float)userCount[User.level1] / 2000.0f; q.max = 2.0f + Daram.VarietyModifier / 3.0f; q.min = -3.0f; q.solution = 5.0f * Daram.VarietyModifier + q.a / 10.0f; }
private void 纹理ToolStripMenuItem_Click(object sender, EventArgs e) { 点模型ToolStripMenuItem1.Checked = false; 线框模型ToolStripMenuItem1.Checked = false; 面模型ToolStripMenuItem1.Checked = false; OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Multiselect = false; openFileDialog.Title = "选择图片文件"; openFileDialog.Filter = "图片|*.bmp;*jpg;*jpeg;*gif";//SerializationEngine.Instance.Filter; if (openFileDialog.ShowDialog() == DialogResult.OK) { // Destroy the existing texture. //texture.Destroy(sceneControl1.Scene.OpenGL); // Create a new texture. //texture.Create(sceneControl1.Scene.OpenGL, openFileDialog.FileName); // Redraw. //openGLControl1.Invalidate(); // openGLControl1.OpenGL.PolygonMode(FaceMode.FrontAndBack, PolygonMode.Filled); //sceneControl1.OpenGL.PolygonMode(FaceMode.FrontAndBack, PolygonMode.Filled); // openGLControl1.OpenGL.Disable(OpenGL.GL_LIGHTING); if (selectedSceneElement != null && isPolygon(selectedSceneElement)) { Polygon polygon = getPolygon(selectedSceneElement); //polygon.Material = new Material(); polygon.Material.Texture.Create(sceneControl1.Scene.OpenGL, openFileDialog.FileName); //polygon.Material.Texture.Name = "12312";//openFileDialog.FileName.Substring(openFileDialog.FileName.LastIndexOf('\\')); ; } else if (selectedSceneElement != null && isQuadric(selectedSceneElement)) { Quadric quadric = getQuadric(selectedSceneElement); quadric.Material.Texture.Create(sceneControl1.Scene.OpenGL, openFileDialog.FileName); } else { statusStripStatusLabel1.Text = "Warming:当前未选中物体,请左键点击后再进行操作。"; statusStripStatusLabel1.ForeColor = Color.Red; } } }
public override void glDraw() { GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer GL.glLoadIdentity(); GL.glTranslatef(0f, 0.0f, -10.0f); GL.glRotatef(40f, 0.71f, 0, 0.71f); GL.glColor3f(1, 1, 1); #if USECLASS Quadric q = new Quadric(); q.Style = GL.GLU_LINE; q.Sphere(5, 20, 20); #else GLUquadric q; q = GL.gluNewQuadric(); GL.gluQuadricDrawStyle(q, GL.GLU_LINE); GL.gluSphere(q, 5, 20, 20); GL.gluDeleteQuadric(q); // don't forget to free it.. #endif }
public void Cylinder(Quadric obj, double baseRadius, double topRadius, double height, int slices, int stacks) => cylinder(obj.Data, baseRadius, topRadius, height, slices, stacks);
public void DeleteQuadric(Quadric obj) => deleteQuadric(obj.Data);
public QuadricGeometry(float3x3 Q, float3 P, float R) { quadric = new Quadric(Q, P, R); }
public void QuadricDrawStyle(Quadric obj, QuadricDrawStyle style) => quadricDrawStyle(obj.Data, style);
public void Disk(Quadric obj, double inner, double outer, int slices, int loops) => disk(obj.Data, inner, outer, slices, loops);
void DaramNumber() { if (DNCool < gm.time) { Quadric q = gm.DaramFunction[User.level1]; if (q.value == 0) { return; } if (q.value > 0) { switch (Random.Range(0, 4)) { case 0: CreateChat(GoodChat("이 게임 할만하구만."), 3); break; case 1: CreateChat(GoodChat("좋아 좋아."), 3); break; case 2: CreateChat(GoodChat("열정적인 GM!"), 3); break; case 3: CreateChat(GoodChat("이게 요즘 흥한다는 그 게임인가요?"), 3); break; } } else if (q.diff < 0) { switch (Random.Range(0, 5)) { case 0: CreateChat("사람이 다람쥐보다 많은듯..", 3); break; case 1: CreateChat("일해라 GM!!", 3); break; case 2: CreateChat("다람쥐 멸종위기....", 3); break; case 3: CreateChat("넥슨은 다람쥐를 뿌려라!", 2); break; case 4: CreateChat("다람쥐가 있어야 퀘스트를 하지...", 3); break; } } else { switch (Random.Range(0, 3)) { case 0: CreateChat("다람쥐에 깔려죽겠다 ㅠㅠ", 3); break; case 1: CreateChat("이걸 다 언제잡아..", 3); break; case 2: CreateChat("공기반 다람쥐반이네..", 3); break; } } DNCool = gm.time + Random.Range(5, 10); } }