void Awake() { if (Instance == null) { Instance = this; } else { Destroy (gameObject); } }
private void Start() { goalManager = FindObjectOfType <GoalManager>(); sprite = GetComponent <SpriteRenderer>(); board = GameObject.FindWithTag("Board").GetComponent <Board>(); }
void Start() { m_GoalManager = FindObjectOfType <GoalManager>(); remainingTargetTime = newTargetTime; }
void Start() { myInstance = this; }
void Awake() { goalMgr = GoalManager.Instance; }
void Awake() { speed = Random.Range(5.0f, 15.0f); goalManager = GetComponent <GoalManager>(); }
void Awake() { gm = this; }
protected internal override void CallOn(HacknetPlugin plugin, MemberInfo targettedInfo) { GoalManager.RegisterGoal((Type)targettedInfo, XmlName); }
// Start is called before the first frame update void Start() { GoalManager = GameObject.Find("GoalManager"); script = GoalManager.GetComponent <GoalManager>(); }
void Awake() { instance = this; }
private static MisisonGoal LoadGoal(ElementInfo info) { var type = info.Attributes.GetString("type").ToLower(); var os = OS.currentInstance; if (GoalManager.TryLoadCustomGoal(type, out var customGoal)) { if (customGoal is PathfinderGoal pfGoal) { pfGoal.LoadFromXML(info); } return(customGoal); } switch (type) { case "filedeletion": var compName = info.Attributes.GetString("target").Filter(); return(new FileDeletionMission( info.Attributes.GetString("path").Filter(), info.Attributes.GetString("file").Filter(), ComputerLookup.FindById(compName)?.ip ?? compName, os )); case "clearfolder": return(new FileDeleteAllMission( info.Attributes.GetString("path").Filter(), info.Attributes.GetComp("target").ip, os )); case "filedownload": return(new FileDownloadMission( info.Attributes.GetString("path").Filter(), info.Attributes.GetString("file").Filter(), info.Attributes.GetComp("target").ip, os )); case "filechange": return(new FileChangeMission( info.Attributes.GetString("path").Filter(), info.Attributes.GetString("file").Filter(), info.Attributes.GetComp("target").ip, info.Attributes.GetString("keyword").Filter(), os, info.Attributes.GetBool("removal") ) { caseSensitive = info.Attributes.GetBool("filechange") }); case "getadmin": return(new GetAdminMission(info.Attributes.GetComp("target").ip, os)); case "getstring": return(new GetStringMission(info.Attributes.GetString("target").Filter())); case "delay": return(new DelayMission(info.Attributes.GetFloat("time", 1f))); case "hasflag": return(new CheckFlagSetMission(info.Attributes.GetString("target").Filter(), os)); case "fileupload": return(new FileUploadMission( info.Attributes.GetString("path").Filter(), info.Attributes.GetString("file").Filter(), info.Attributes.GetComp("target").ip, info.Attributes.GetComp("destTarget").ip, info.Attributes.GetString("destPath").Filter(), os, info.Attributes.GetBool("decrypt"), info.Attributes.GetString("decryptPass").Filter() )); case "adddegree": return(new AddDegreeMission( info.Attributes.GetString("owner").Filter(), info.Attributes.GetString("degree").Filter(), info.Attributes.GetString("uni").Filter(), info.Attributes.GetFloat("gpa", -1f), os )); case "wipedegrees": return(new WipeDegreesMission(info.Attributes.GetString("owner").Filter(), os)); case "removedeathrowrecord": return(new DeathRowRecordRemovalMission( info.Attributes.GetString("fname", info.Attributes.GetString("name").Split(' ')[0]), info.Attributes.GetString("lname", info.Attributes.GetString("name").Split(' ')[1]), os )); case "modifydeathrowrecord": return(new DeathRowRecordModifyMission( info.Attributes.GetString("fname", info.Attributes.GetString("name").Split(' ')[0]), info.Attributes.GetString("lname", info.Attributes.GetString("name").Split(' ')[1]), info.Content, os )); case "sendemail": return(new SendEmailMission( info.Attributes.GetString("mailServer", "jmail").Filter(), info.Attributes.GetString("recipient").Filter(), info.Attributes.GetString("subject").Filter(), os )); case "databaseentrychange": return(new DatabaseEntryChangeMission( info.Attributes.GetComp("comp").ip, os, info.Attributes.GetString("operation").Filter(), info.Attributes.GetString("fieldName").Filter(), info.Attributes.GetString("targetValue").Filter(), info.Attributes.GetString("recordName").Filter() )); case "getadminpasswordstring": return(new GetAdminPasswordStringMission(info.Attributes.GetComp("target").ip, os)); default: throw new KeyNotFoundException("Unknown goal type"); } }
protected void Page_Load(object sender, EventArgs e) { sysManager = new SystemExerciseManager(); routManager = new routineManager(); logManager = new LoggedExerciseManager(); goalMngr = new GoalManager(); lb = (ListBox)this.Parent.FindControl("lbRoutines"); if (Session["exerciseID"] != null) { exerciseID = (int)Session["exerciseID"]; } if (!IsPostBack) { Session.Abandon(); init(); } if (lb != null && lb.SelectedIndex > -1) { GridView1.DataSource = routManager.getExerciseFromRoutine(Convert.ToInt32(lb.SelectedItem.Value)); GridView1.DataBind(); routineID = Convert.ToInt32(lb.SelectedItem.Value); pnlInfo.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { HtmlGenericControl li = (HtmlGenericControl)this.Page.Master.FindControl("Ulnav").FindControl("liManageExerciseGoals"); li.Attributes.Add("class", "active"); userName = User.Identity.Name; goalMngr = new GoalManager(); viewExercises.userControlEventHappened += new EventHandler(viewExercises_userControlEventHappened); if (!Page.IsPostBack) { viewGoalsBtn.Enabled = false; addGoalBtn.Enabled = true; exerciseGoalMultiView.ActiveViewIndex = 2; loadExerciseGoals(); } }
protected void SaveCloneGoalClicked(object o, EventArgs e) { for (int i = 0; i < note_name.Entries.Count; i++) { if (note_name.Entries[i].Value.StartsWith("team:")) { var t = new TeamServices().GetByID(Convert.ToInt32(note_name.Entries[i].Value.Replace("team:", ""))); foreach (var m in t.Members) { var goal = new Goal(); goal.AccountID = CurrentGoal.AccountID; goal.Description = CurrentGoal.Description; goal.IsAccepted = true; goal.Name = CurrentGoal.Name; goal.ReviewID = CurrentGoal.ReviewID; goal.StatusID = CurrentGoal.StatusID; goal.Title = CurrentGoal.Title; goal.TypeOfItem = CurrentGoal.TypeOfItem; goal.Weight = CurrentGoal.Weight; goal.DueDate = (DateTime)tbCloneGoalDueDate.DateInput.SelectedDate; goal.EnteredBy = SecurityContextManager.Current.CurrentUser.ID; goal.ChangedBy = SecurityContextManager.Current.CurrentUser.ID; goal.DateCreated = DateTime.Now; goal.LastUpdated = DateTime.Now; goal.EnteredFor = m.PersonID; goal.IsTemplate = false; goal.Progress = 0; goal.Score = 0; goal.EmployeeEvaluation = ""; goal.ManagerEvaluation = ""; new GoalServices().Save(goal); foreach (DataListItem row in dlMilestoneDueDates.Items) { var date = row.FindControl("tbDueDate") as Telerik.Web.UI.RadDatePicker; var oldms = new GoalMilestoneServices().GetByID(Convert.ToInt32(date.Attributes["milestoneid"])); var ms = new GoalMilestone(); ms.AccountID = oldms.AccountID; ms.ChangedBy = SecurityContextManager.Current.CurrentUser.ID; ms.Description = oldms.Description; ms.EmployeeEvaluation = ""; ms.ManagerEvaluation = ""; ms.Name = oldms.Name; ms.Status = (int)GoalStatus.ACCEPTED; ms.Title = oldms.Title; ms.DateCreated = DateTime.Now; ms.DueDate = (DateTime)date.SelectedDate; ms.EnteredBy = SecurityContextManager.Current.CurrentUser.ID; ms.EnteredFor = m.PersonID; ms.GoalID = goal.ID; ms.IsAccepted = true; ms.IsComplete = false; ms.LastUpdated = DateTime.Now; new GoalMilestoneServices().Save(ms); } foreach (var s in CurrentGoal.Managers) { var subscriber = new GoalManager(); subscriber.GoalID = goal.ID; subscriber.PersonID = s.PersonID; subscriber.RecievesNotifications = s.RecievesNotifications; new GoalManagerServices().Save(subscriber); } } } else { var p = new PersonServices().GetByEmail(note_name.Entries[i].Value); var goal = new Goal(); goal.AccountID = CurrentGoal.AccountID; goal.Description = CurrentGoal.Description; goal.IsAccepted = true; goal.Name = CurrentGoal.Name; goal.ReviewID = CurrentGoal.ReviewID; goal.StatusID = CurrentGoal.StatusID; goal.Title = CurrentGoal.Title; goal.TypeOfItem = CurrentGoal.TypeOfItem; goal.Weight = CurrentGoal.Weight; goal.DueDate = (DateTime)tbCloneGoalDueDate.DateInput.SelectedDate; goal.EnteredBy = SecurityContextManager.Current.CurrentUser.ID; goal.ChangedBy = SecurityContextManager.Current.CurrentUser.ID; goal.DateCreated = DateTime.Now; goal.LastUpdated = DateTime.Now; goal.EnteredFor = p.ID; goal.IsTemplate = false; goal.Progress = 0; goal.Score = 0; goal.EmployeeEvaluation = ""; goal.ManagerEvaluation = ""; new GoalServices().Save(goal); foreach (DataListItem row in dlMilestoneDueDates.Items) { var date = row.FindControl("tbDueDate") as Telerik.Web.UI.RadDatePicker; var oldms = new GoalMilestoneServices().GetByID(Convert.ToInt32(date.Attributes["milestoneid"])); var ms = new GoalMilestone(); ms = oldms; ms.DateCreated = DateTime.Now; ms.DueDate = (DateTime)date.SelectedDate; ms.EnteredBy = SecurityContextManager.Current.CurrentUser.ID; ms.EnteredFor = p.ID; ms.GoalID = goal.ID; ms.IsAccepted = true; ms.IsComplete = false; ms.LastUpdated = DateTime.Now; new GoalMilestoneServices().Save(ms); } foreach (var s in CurrentGoal.Managers) { var subscriber = new GoalManager(); subscriber.GoalID = goal.ID; subscriber.PersonID = s.PersonID; subscriber.RecievesNotifications = s.RecievesNotifications; new GoalManagerServices().Save(subscriber); } } } Response.Redirect(SecurityContextManager.Current.CurrentURL); }
public void Start() { sprite = GetComponent <SpriteRenderer>(); goalManager = FindObjectOfType <GoalManager>(); }
private void Start() { goals = FindObjectOfType <GoalManager>(); sprite = GetComponent <SpriteRenderer>(); }
// Start is called before the first frame update void Start() { goalManager = GameObject.Find("GoalManager").GetComponent <GoalManager>(); }
private void Start() { s_singleton = this; OpenConnection(); }
private void Awake() { spriteRenderer = GetComponent <SpriteRenderer>(); goalManager = FindObjectOfType <GoalManager>(); }
private void CreateNextLevel(Vector3 oldPlatformCenter, Vector3 oldLeftGoal, int level) { float nextCenterDistance = Random.Range(minCenterDistance, maxCenterDistance); float nextPlatformRotation = Random.Range(-maxRotation, maxRotation); Vector3 newPlatformCenter = new Vector3(oldPlatformCenter.x - nextCenterDistance, oldPlatformCenter.y, oldPlatformCenter.z); Vector3 leftRightOffset = new Vector3(0, 0, platform1.transform.localScale.z / 2); int randomness = Random.Range(0, 5); GameObject leftPlatform; switch (randomness) { case 1: leftPlatform = Instantiate(platform1, newPlatformCenter - leftRightOffset, Quaternion.Euler(0, -nextPlatformRotation, 0)); break; case 2: leftPlatform = Instantiate(platform2, newPlatformCenter - leftRightOffset, Quaternion.Euler(0, -nextPlatformRotation, 0)); break; case 3: leftPlatform = Instantiate(platform3, newPlatformCenter - leftRightOffset, Quaternion.Euler(0, -nextPlatformRotation, 0)); break; case 4: leftPlatform = Instantiate(platform4, newPlatformCenter - leftRightOffset, Quaternion.Euler(0, -nextPlatformRotation, 0)); break; default: leftPlatform = Instantiate(platform0, newPlatformCenter - leftRightOffset, Quaternion.Euler(0, -nextPlatformRotation, 0)); break; } randomness = Random.Range(0, 5); GameObject rightPlatform; switch (randomness) { case 1: rightPlatform = Instantiate(platform1, newPlatformCenter + leftRightOffset, Quaternion.Euler(0, 180.0f + nextPlatformRotation, 0)); break; case 2: rightPlatform = Instantiate(platform2, newPlatformCenter + leftRightOffset, Quaternion.Euler(0, 180.0f + nextPlatformRotation, 0)); break; case 3: rightPlatform = Instantiate(platform3, newPlatformCenter + leftRightOffset, Quaternion.Euler(0, 180.0f + nextPlatformRotation, 0)); break; case 4: rightPlatform = Instantiate(platform4, newPlatformCenter + leftRightOffset, Quaternion.Euler(0, 180.0f + nextPlatformRotation, 0)); break; default: rightPlatform = Instantiate(platform0, newPlatformCenter + leftRightOffset, Quaternion.Euler(0, 180.0f + nextPlatformRotation, 0)); break; } float newGoalOffset = Random.Range(-0.5f, 1.5f); GoalManager leftGoalManager = leftPlatform.GetComponent <GoalManager>(); GoalManager rightGoalManager = rightPlatform.GetComponent <GoalManager>(); leftGoalManager.MoveGoal(newGoalOffset); rightGoalManager.MoveGoal(newGoalOffset); float additionalBridgeLength = 1.0f / (level + 6.0f) * 6.0f - 0.3f; float bridgeLength = (oldLeftGoal - leftGoalManager.GetGoalPosition()).magnitude + additionalBridgeLength - 1; levels.Add(new Level(newPlatformCenter, leftGoalManager, rightGoalManager, bridgeLength, nextCenterDistance - platform1.transform.localScale.x)); }
private void StageInit() { m_laser = Instantiate(m_laserPrefab, new Vector3(500, 500, 0), Quaternion.identity); m_laser.DestroyEvent += m_resultManager.ShowGameOverUI; m_goal = Instantiate(m_goalManager, Vector3.zero, Quaternion.identity); m_start = Instantiate(m_startPointManager, Vector3.zero, Quaternion.identity); m_pointsManager.SetObjPointData(m_goal, m_stageData.GoalData.pos, m_stageData.GoalData.state); m_pointsManager.SetObjPointData(m_start, m_stageData.StartData.pos, m_stageData.StartData.state); m_start.SetLaser(m_laser); for (int i = 0; i < m_stageData.WallPoses.Length; i++) { Wall wall = Instantiate(m_wallPrefab, new Vector3(0, 0, 0), Quaternion.identity); IOnPointObject obj = wall; m_walls.Add(wall); m_pointsManager.SetObjPointData(obj, m_stageData.WallPoses[i], 0); } for (int i = 0; i < m_stageData.ReflectorsData.Length; i++) { AReflector reflector = Instantiate(m_reflecterPrefab, new Vector3(0, 0, 0), Quaternion.identity); IOnPointObject obj = reflector; m_staticReflectors.Add(reflector); obj.Init(Vector3.zero, -1, m_stageData.ReflectorsData[i].durable); m_pointsManager.SetObjPointData(obj, m_stageData.ReflectorsData[i].pos, m_stageData.ReflectorsData[i].state); reflector.SetCanMove(false); } for (int i = 0; i < m_stageData.InfinityReflectorsData.Length; i++) { AReflector reflector = Instantiate(m_infinityReflectorPrefab, new Vector3(0, 0, 0), Quaternion.identity); IOnPointObject obj = reflector; obj.Init(Vector3.zero, -1, 99); m_pointsManager.SetObjPointData(obj, m_stageData.InfinityReflectorsData[i].pos, m_stageData.InfinityReflectorsData[i].state); reflector.SetCanMove(false); } m_coin = Instantiate(m_coinManager, Vector3.zero, Quaternion.identity); m_pointsManager.SetObjPointData(m_coin, m_stageData.CoinPos, 0); m_playableReflectorManager.CreateReflector(m_stageData.PlayerSetReflectors); m_playableReflectorManager.SetReflectorEvents( (a) => { return; }, m_pointsManager.SetObjPointData, m_pointsManager.NextState ); if (!isFirstInit) { DisposeEvents(); } RegistEvents(); }
public GoalManager Save(GoalManager item) { return(new GoalManagerRepository().SaveOrUpdate(item)); }
public void Delete(GoalManager item) { new GoalManagerRepository().Delete(item); }
private void Start() { gm = GoalManager.gm; //gm.goalGameObject = this; }
void Start() { myInstance = this; }
protected void Page_Load(object sender, EventArgs e) { userName = User.Identity.Name; goalMngr = new GoalManager(); viewExercises.userControlEventHappened += new EventHandler(viewExercises_userControlEventHappened); if (!Page.IsPostBack) { viewGoalsBtn.Enabled = false; addGoalBtn.Enabled = true; if (goalMngr.getUnachievedExerciseGoalsFromUser(userName, Convert.ToInt32(orderByRbl.SelectedValue)).Count < 1) exerciseGoalMultiView.ActiveViewIndex = 1; else { exerciseGoalMultiView.ActiveViewIndex = 2; loadExerciseGoals(); } } }
void Start() { m_GoalManager = FindObjectOfType <GoalManager>(); speed = m_GoalManager.speed * speedModifier; }