Vector3 moveLeft() { animator.Play(Anims.Run); if (lastMove == LastMovement.RIGHT) { spriteRenderer.flipX = !spriteRenderer.flipX; } lastMove = LastMovement.LEFT; return(Vector3.left * this.movingSpeed); }
private static void insertIfValueChanged(int p_cameraId, string p_cameraName, int p_motionLevel, int p_alarmLevel, Int64 p_milliSsecondsSinceStart, string p_profile, bool p_outputToFile, string p_fileName, double p_maxLength) { int statsLimit = statisticsCountLimit; bool found = false; //keep the list of statistics to a reasonable size if (statList.Count > statsLimit) { statList.RemoveRange(0, 1); } foreach (LastMovement item in lastMovementList) { if (item.cameraId == p_cameraId && item.profile == p_profile) { found = true; if (item.motionLevel != p_motionLevel) { item.milliSecondsSinceStart = p_milliSsecondsSinceStart; item.motionLevel = p_motionLevel; movement mv = new movement(); mv.cameraId = p_cameraId; mv.cameraName = p_cameraName; mv.motionLevel = p_motionLevel; mv.alarmLevel = p_alarmLevel; mv.milliSecondsSinceStart = p_milliSsecondsSinceStart; mv.dateTime = DateTime.Now; mv.profile = p_profile; statList.Add(mv); if (p_outputToFile) { WriteToFile(p_fileName, p_maxLength, statList.Last()); } } break; } } if (!found) { LastMovement mov = new LastMovement(); mov.cameraId = p_cameraId; mov.milliSecondsSinceStart = p_milliSsecondsSinceStart; mov.motionLevel = p_motionLevel; mov.profile = p_profile; lastMovementList.Add(mov); } }
private static void insertIfValueChanged(int p_cameraId, int p_motionLevel, Int64 p_milliSsecondsSinceStart, string p_profile) { int statsLimit = statisticsCountLimit; bool found = false; //keep the list os statistics to a reasonable size if (statList.Count > statsLimit) { statList.RemoveRange(0, 1); } foreach (LastMovement item in lastMovementList) { if (item.cameraId == p_cameraId && item.profile == p_profile) { found = true; if (item.motionLevel != p_motionLevel) { item.milliSecondsSinceStart = p_milliSsecondsSinceStart; item.motionLevel = p_motionLevel; movement mv = new movement(); mv.cameraId = p_cameraId; mv.motionLevel = p_motionLevel; mv.milliSecondsSinceStart = p_milliSsecondsSinceStart; mv.dateTime = DateTime.Now; mv.profile = p_profile; statList.Add(mv); } break; } } if (!found) { LastMovement mov = new LastMovement(); mov.cameraId = p_cameraId; mov.milliSecondsSinceStart = p_milliSsecondsSinceStart; mov.motionLevel = p_motionLevel; mov.profile = p_profile; lastMovementList.Add(mov); } }