// Use this for initialization void Start() { LeaderController = Leader.GetComponent <VehiclePathController>(); LeaderController.enabled = false; FolowerController = Folower.GetComponent <VehiclePathController>(); FolowerController.enabled = false; string[] args = System.Environment.GetCommandLineArgs(); for (int i = 0; i < args.Length; i++) { Debug.Log("ARG " + i + ": " + args [i]); if (args [i] == "-scenDuration") { ScenDuration = float.Parse(args [i + 1]); } if (args [i] == "-scenReplay") { string replay = args [i + 1]; if (replay == "1") { showReplay = true; } } } }
private void Start() { if (follower != null) { hasFollower = true; positionQueue = new Queue <Tuple <Vector2, Node> >(); oTilePosition = follower.GetComponent <ObjectTilePosition>(); folowerFolowerScript = follower.GetComponent <Folower>(); } }
// ------------------------------------------------- void Start() { _folower = Camera.main.GetComponent <Folower>(); line.enabled = false; line.startWidth = 0.2f; line.endWidth = 0.2f; line.positionCount = 37; y = 1f; x = 0.5f; velosity = 5.5f; for (int i = 0; i < 25; i++) { list.Add(new GameObject(i.ToString())); } Transform StickMan = GameObject.Find("StickMan").transform; foreach (GameObject jkaem in list) { Instantiate(jkaem, StickMan); Instantiate(pref, jkaem.transform); } InitKinect(); }
public async Task <JsonResult> SubAjax([FromBody] AjaxPostViewModel model) { var CurrentUser = await GetCurrentUserAsync(); Post FolowerAccount = null; Profile FolowerProfile = null; Profile CurrentUserProfile = null; if (model.postID == 0)//TODO VIEW THIS ? { FolowerProfile = _profile.Profiles.FirstOrDefault(p => model.profileID == p.ProfileID); } else { FolowerAccount = _post.Posts.FirstOrDefault(p => p.PostID == model.postID); if (FolowerAccount != null) { FolowerProfile = _profile.Profiles.FirstOrDefault(p => FolowerAccount.UserID == p.UserID); } } if (CurrentUser != null && FolowerProfile != null) { CurrentUserProfile = _profile.Profiles.FirstOrDefault(p => p.UserID == CurrentUser.Id); if (!Url.IsLocalUrl(model.returnUrl)) { model.returnUrl = "/"; } var folower = _folower.Folowers.Where(i => i.FolowerID.Equals(FolowerProfile.UserID)); if (folower != null) { if (CurrentUser.Id.Equals(FolowerProfile.UserID)) { return(Json("Exist")); } foreach (var item in folower) { if (item.UserID.Equals(CurrentUser.Id)) { FolowerProfile.Folowers--; CurrentUserProfile.Folowing--; _folower.DeleteFolower(item.ID); _profile.SaveProfile(FolowerProfile); _profile.SaveProfile(CurrentUserProfile); return(Json("Delete")); } } Folower modelFolower = new Folower() { FolowerID = FolowerProfile.UserID, UserID = CurrentUser.Id }; CurrentUserProfile.Folowing++; FolowerProfile.Folowers++; _folower.AddFolower(modelFolower); _profile.SaveProfile(FolowerProfile); _profile.SaveProfile(CurrentUserProfile); return(Json("Add")); } } if (CurrentUser == null) { return(Json("NewUser")); } return(Json("Error")); }