public ActionResult AddtoCart(int courseid) { int studentID = int.Parse(Session["studentid"].ToString()); var cours = db.courses.FirstOrDefault(i => i.courseID == courseid); if (cours != null) { GetCart().AddCourse(cours, 1); } try { take addc = new take(); addc.studentID = studentID; addc.courseID = courseid; addc.semesterno = cours.semesterno; db.takes.Add(addc); db.SaveChanges(); TempData["alert"] = "<script>alert('course is added');</script>"; } catch (Exception e) { e.ToString(); } return(RedirectToAction("CourseRegistration", "Kullanicilar")); }
void advanceTake(UnityEngine.Video.VideoPlayer vp) { if (debug) { Debug.Log("take manager: end of " + currentTake.name); } if (currentTakeIndex < takes.Length - 1) //If we're at the second-to-last index of the take array { do { currentTakeIndex++; } while (takes[currentTakeIndex].skip); //First, some clean-up currentTake.actors = null; //Wipe references to actor objects in the scene if (actors != null) { for (int i = 0; i < actors.Length; i++) //Then delete the actor objects { Destroy(actors[i]); } } //And now to business currentTake = takes[currentTakeIndex]; if (debug) { Debug.Log("take manager: starting " + currentTake.name); } player.clip = currentTake.video; //Advance the player's clip (plays automatically) spawnActors(); //Then, re-spawn new actors based on the take's spec gazeZones = currentTake.gazeZones; for (int i = 0; i < currentTake.actors.Length; i++) { if (currentTake.actors[i].animation.Length > 0) { currentTake.actors[i].currentKeyframe = currentTake.actors[i].animation[0]; currentTake.actors[i].frameDuration = currentTake.actors[i].currentKeyframe.time; } } player.Play(); } else { if (debug) { Debug.Log("take manager: finished playback"); } finished = true; } }
await _tableStorage.GetDataWithContinuationTokenAsync(take, continuation);
void Start() { if (offscreen.singleton == null) { offscreen.singleton = this; } //Define this instance as the singleton variable else { GameObject.Destroy(this); } /* * Scene property setup */ takes = new take[sequence.Length]; //Set up the takes for (int i = 0; i < sequence.Length; i++) { int fixedIndex = //Make sure the take index actually fits the take pool's array boundaries Mathf.Max(0, Mathf.Min(sequence[i].selectedTakeIndex, sequence[i].takes.Length - 1)); takes[i] = sequence[i].takes[fixedIndex]; //Set each take in the take array as the one chosen from the take pool ('sequence' variable) takes[i].skip = sequence[i].skip; //Transfer properties takes[i].name = sequence[i].name; if (debug) { Debug.Log("take manager: " + takes[i].name + " skip value " + takes[fixedIndex].skip); } } while (takes[currentTakeIndex].skip) { currentTakeIndex++; } //Set the current take as the first in the take array that doesn't have a skip flag currentTake = takes[currentTakeIndex]; /* * Scene object setup */ actorsDummy = new GameObject(); //Just to keep the Inspector hierachy organized actorsDummy.name = "actors"; player.playOnAwake = false; player.loopPointReached += advanceTake; //Move on to the next take when the video clip ends gazeZones = currentTake.gazeZones; player.clip = currentTake.video; player.Prepare(); //Animation setup for (int i = 0; i < currentTake.actors.Length; i++) { if (currentTake.actors[i].animation.Length > 0) { currentTake.actors[i].keyframeStartPosition = currentTake.actors[i].position; currentTake.actors[i].currentKeyframe = currentTake.actors[i].animation[0]; //Load the first keyframe currentTake.actors[i].frameDuration = currentTake.actors[i].currentKeyframe.time; //Since we're at 0s, duration = time } } }