// Update is called once per frame void Update () { if (Followers == null) { GetFollowers(); } if (AttackTarget != null) { CurrentAttachLength -= Time.deltaTime; if (CurrentAttachLength <= 0) { AquireNewTarget(); }else{ var distance = Vector3.Distance(AttackTarget.transform.position, transform.position); if (distance <= LethalRange) { AttackTarget.Kill(); AttackTarget = null; } else { var direction = (AttackTarget.transform.position - transform.position).normalized; RigidBody.MovePosition(transform.position + direction * AttackSpeed * Time.deltaTime); transform.rotation = Quaternion.LookRotation(direction); } } } else { var closestTarget = FindClosesTarget(); if (closestTarget != null) { var range = Vector3.Distance(closestTarget.transform.position, transform.position); if (range <= PreyRange) { closestTarget.IsAttacked(transform.position); AttackTarget = closestTarget; } } } }
public FollowerInfo(Follower f) { follower = f.FollowerId.ToInt32(); abilities = f.Abilities; avgilvl = f.ItemLevel; level = f.Level; quality = f.Quality.ToInt32(); }
public void SetItem(Follower follower) { m_follower = follower; m_oldFollower = Creature.InstanceCreature(Const.GetSpawn().transform.Find("OldEvolution").gameObject, Resources.Load<GameObject>("Pref/mon_skin/" + m_follower.RefMob.prefBody), Vector3.zero, Quaternion.Euler(Vector3.zero)); m_newFollower = Creature.InstanceCreature(Const.GetSpawn().transform.Find("NewEvolution").gameObject, Resources.Load<GameObject>("Pref/mon_skin/" + m_follower.RefMob.prefBody), Vector3.zero, Quaternion.Euler(Vector3.zero)); Follower.Transformation(m_oldFollower.transform, m_follower.WeaponHolder.MainWeapon.Evolution-1); Follower.Transformation(m_newFollower.transform, m_follower.WeaponHolder.MainWeapon.Evolution); }
private List<string> FindRecommendedUsersBasedOnSocialTags(Follower[] followers) { /* * Real system would look at the users tags and find * popular accounts with similar tags by making more * RPC calls. */ var tags = followers.SelectMany(f => f.SocialTags).Distinct(); return tags.Select(t => t + "_user_1").ToList(); }
void OnDisable() { TimeEffector.Instance.StartTime(); Camera.main.gameObject.transform.eulerAngles = m_backupCameraRotation; m_follower = null; GameObject.Destroy(m_oldFollower.transform.Find("Body").gameObject); GameObject.Destroy(m_newFollower.transform.Find("Body").gameObject); m_oldFollower = null; m_newFollower = null; }
/// <summary> /// Add a follow /// </summary> /// <param name="patientId"> Id of a patient </param> /// <param name="professionalId"> Id of a pro </param> public void AddFollow(int patientId, int professionalId) { if (patientId == 0 || professionalId == 0) throw new ArgumentNullException("Id can't be equal to 0"); string filePath = patientId + "$" + professionalId; Follower f = new Follower() { Patient = _context.SelectRequest.SelectPatient(patientId), Professionnal = _context.SelectRequest.SelectProfessional(professionalId) }; _context.Follower.Add(f); _context.SaveChanges(); }
public void AquireNewTarget( ) { var closestTarget = FindClosesTarget(); if (closestTarget != null) { var range = Vector3.Distance(closestTarget.transform.position, transform.position); if (range <= PreyRange) { closestTarget.IsAttacked(transform.position); AttackTarget = closestTarget; CurrentAttachLength = MaxAttackLength; } } }
IEnumerator OnAwakeFollowerEvent(Follower follower) { follower.IsActive = false; yield return(new WaitForSeconds(follower.OnAwakeDelayTime)); follower.OnAwakeEvent.Invoke(); follower.IsActive = true; if (SPData.FollowerType == FollowerType.PathFinding) { SPData.SplinePlus.PFFindAllShortestPaths(); } }
void OnTriggerEnter(Collider col) { if (!started) { if (col.transform.root.tag == "oldman") { print("PLOT EVENT TRIGGER"); follower = col.transform.root.GetComponent<Follower>(); follower.stay_put = true; agent = col.transform.root.GetComponent<NavMeshAgent>(); agent.SetDestination(waypoint.position); started = true; } } }
public static bool FollowerCanAutoCollect(Follower follower, string skill, int level) { if (follower.AutoCollectSkill != skill) { return(false); } if (follower.AutoCollectLevel >= level) { return(true); } return(false); }
public async Task ShouldReplyFalseIfLogDoesntContainEntryAtPreviousLogIndexWhoseTermMatchesRpcPrevLogTerm() { _currentState = new CurrentState(Guid.NewGuid().ToString(), 2, default(string), 0, 0, default(string)); await _log.Apply(new LogEntry(new FakeCommand(""), typeof(string), 2)); var appendEntriesRpc = new AppendEntriesBuilder().WithTerm(2).WithPreviousLogIndex(1).WithPreviousLogTerm(1).Build(); var follower = new Follower(_currentState, _fsm, _log, _random, _node, _settings, _rules, _peers, _loggerFactory.Object); var appendEntriesResponse = await follower.Handle(appendEntriesRpc); appendEntriesResponse.Success.ShouldBe(false); appendEntriesResponse.Term.ShouldBe(2); }
public IActionResult Follow(User user) { Follower follower = new Follower(); follower.UserId = (int)HttpContext.Session.GetInt32("UserId"); follower.FollowId = user.UserId; context.Followers.Add(follower); context.SaveChanges(); return(RedirectToAction("HomePage", "Home")); }
public void ChangeColor(Collider other) { //Debug.Log("t enter from " + name); Follower f = other.GetComponent <Follower>(); //other.transform.parent = transform; other.GetComponent <MeshRenderer>().material = mat; if (other.GetComponent <PlayerAI>()) { Destroy(other.GetComponent <PlayerAI>()); } if (f != null) { Destroy(other.GetComponent <Follower>()); //Debug.Log("destroyed"); } string tagForOthers = null; if (tag.Contains("RED")) { tagForOthers = "RED"; } else if (tag.Contains("YELLOW")) { tagForOthers = "YELLOW"; } else { tagForOthers = "BLUE"; } other.tag = tagForOthers; f = other.gameObject.AddComponent <Follower>(); switch (other.tag) { case "RED": f.parent = GameObject.Find("Red"); other.transform.parent = f.parent.transform; break; case "YELLOW": f.parent = GameObject.Find("Yellow"); other.transform.parent = f.parent.transform; break; case "BLUE": f.parent = GameObject.Find("Player"); other.transform.parent = f.parent.transform; Debug.Log("parenting P"); break; } //f.parent = gameObject; }
//void Awake() { // DialogueControl.globalstate = 2; //} void OnTriggerEnter(Collider col) { if (DialogueControl.globalstate == 2 && !started) { if (col.transform.root.tag == "oldman") { print("PLOT EVENT TRIGGER"); follower = col.transform.root.GetComponent<Follower>(); follower.stay_put = true; agent = col.transform.root.GetComponent<NavMeshAgent>(); agent.SetDestination(waypoint.position); started = true; anim = follower.transform.Find("dialogue").GetComponent<Animator>(); } } }
public async Task <IActionResult> DeleteFollowerAsync(Follower follower) { try { await topicObj.DeleteFollowerAsync(follower); } catch (Exception e) { Console.WriteLine("-----------Inside delete follower--------" + e.Message); Console.WriteLine("-----------Inside delete follower--------" + e.StackTrace); } return(Ok()); }
private void TryOpen(Player player, Follower fol) { Collidable = false; bool flag = !Scene.CollideCheck <Solid>(player.Center, Center); if (flag) { opening = true; (fol.Entity as Key).StartedUsing = true; Add(new Coroutine(UnlockRoutine(fol), true)); } Collidable = true; }
public virtual async Task <ApiFollowerServerResponseModel> Get(int id) { Follower record = await this.FollowerRepository.Get(id); if (record == null) { return(null); } else { return(this.DalFollowerMapper.MapEntityToModel(record)); } }
//public void attackOpponentPlayer(int attack){ // this.player2.GetComponent<PlayerManager>().life -= attack; // checkGameOver(player2); //} public void battleFollowers(Follower follower1, Follower follower2) { follower1.attackAnim(); follower1.setHealth(follower1.health - follower2.attack); follower2.setHealth(follower2.health - follower1.attack); follower1.canAttack = false; follower2.canAttack = false; this.player1.GetComponent <PlayerManager>().checkFollowersHealth(); this.player2.GetComponent <PlayerManager>().checkFollowersHealth(); }
// POST: api/Follower_Delete /// <summary> /// 取消关注 /// </summary> /// <param name="value"></param> /// <returns></returns> public string Post([FromBody] Follower value) { try { MyConnent.MySqlWrite("DELETE FROM 关注表 WHERE FollowerAccount ='" + value.FollowerAccount + "' AND WasFollowederAccount = '" + value.WasFollowederAccount + "'"); return("true"); } catch (Exception e) { Debug.WriteLine(e.ToString()); return("false"); } }
public static bool DistanceCheck(SPData SPData, Follower follower) { var pathLength = SPData.Length; if (!follower.Reverse) { return((follower.Distance >= pathLength) ? true : false); } else { return((follower.Distance <= 0) ? true : false); } }
public void MapEntityToModelList() { var mapper = new DALFollowerMapper(); Follower item = new Follower(); item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, "A", "A"); List <ApiFollowerServerResponseModel> response = mapper.MapEntityToModel(new List <Follower>() { { item } }); response.Count.Should().Be(1); }
public void OpenSerialPort(string SerialName) { _ArduinoManager = new ArduinoManagerComm(); _AutomateComm = new AutomateCommunication(SerialName, true, _ArduinoManager); _AutomateComm.OpenSerialPort(SerialName); _Follower = new Follower(_ArduinoManager, _AutomateComm); _tUpdate = new Thread(new ThreadStart(_threadUpdate)); _tUpdate.Start(); //_AutomateComm.OnNewTrameArduinoReceived += new AutomateCommunication.NewTrameArduinoReceivedEventHandler(_AutomateComm_OnNewTrameArduinoReceived); }
public override void playCard() { if (!used) { used = 1; Follower temp = from.removeLoyalist(fr.faction); to.addLoyalist(temp); Follower temp1 = to.removeLoyalist(t.faction); from.addLoyalist(temp1); Follower temp2 = from.removeLoyalist(fr2.faction); to.addLoyalist(temp2); } }
private List <Follower.Traits> GetCheckedTrait() { List <Follower.Traits> list = new List <Follower.Traits>(); foreach (AbilityCheckBox checkBox in this.traitCheckBoxPanel.Children) { if (checkBox.IsChecked == true) { list.Add(Follower.GetTratByString(checkBox.Name)); } } return(list); }
public void Delete_Ok_Follower() { // Prepare followers content var toDelete = new Follower() { CreatedAt = new DateTime(2014, 8, 1), Email = "*****@*****.**", Id = "ID1" }; var isDeleted = Delete(toDelete); Assert.Equal(true, isDeleted); }
public async Task <ActionResult> Unfollow(string userId) { Follower follower = db.Followers .Where(c => c.follower_id == User.Identity.Name && c.user_id == userId) .FirstOrDefault(); db.Followers.Remove(follower); await db.SaveChangesAsync(); String redirectPath = "~/UserPhotos?id=" + userId.ToString(); return(RedirectPermanent(redirectPath)); }
public BuildAction(GameObject follower, GameObject building) { this.follower = follower; this.followerScript = follower.GetComponent <Follower>(); this.targetGameObject = building; this.storagePoint = GameObject.FindGameObjectWithTag("Storage"); this.building = building; this.blueprints = building.GetComponent <Building>(); this.gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); this.blueprints.assignees.Add(follower); Debug.Log(blueprints.requirementsList[0].type); StartAction(targetGameObject); }
// POST: api/Follower /// <summary> /// 关注 /// </summary> /// <param name="value"></param> /// <returns></returns> public string Post([FromBody] Follower value) { try { MyConnent.MySqlWrite("INSERT INTO 关注表() VALUES('" + value.FollowerAccount + "','" + value.WasFollowederAccount + "')"); return("true"); } catch (Exception e) { Debug.WriteLine(e.ToString()); return("false"); } }
public static bool FollowerCanAutoCollect(Follower follower, GameItem item) { if (follower.AutoCollectSkill != item.ActionRequired) { return(false); } if (follower.AutoCollectLevel >= item.RequiredLevel) { return(true); } return(false); }
public FollowerRow(Follower follower, ref List <Follower> list, bool isFavorite = false) { InitializeComponent(); this.currentFollower = follower; this.favoriteFollowers = list; this.isFavoriteMode = isFavorite; this.SetFollower(follower); if (isFavorite) { this.isFavorit.IsChecked = true; this.isFavorit.IsEnabled = false; } }
public FollowerViewModel(Follower follower) { Follower = follower; Title = Follower.Name; var fs = new FollowersService(); FollowerLocation = fs.GetLocationByFollower(Follower); if (FollowerLocation == null) { return; } HasLocationLink = true; }
public Follower selectFollwerByfol_no(Follower follower) { MyDB mydb = new MyDB(); Follower result = new Follower(); MySqlConnection con = null; MySqlDataReader rd = null; try { con = mydb.GetCon(); string Sql = "SELECT * FROM toourshared.follwer where fol_no =@fol_no"; MySqlCommand cmd = new MySqlCommand(Sql, con); cmd.Parameters.AddWithValue("@fol_no", follower.fol_no); con.Open(); rd = cmd.ExecuteReader(); if (rd.HasRows) { rd.Read(); result.fol_no = rd["fol_no"].ToString(); result.Mem_id = rd["mem_id"].ToString(); result.Fol_id = rd["fol_id"].ToString(); //lstMember.Add(tmpMemberPointer); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); rd.Close(); } finally { rd.Close(); con.Close(); } return(result); }
// Start is called before the first frame update public void Start() { rb = GetComponent <Rigidbody2D>(); GetComponent <Damageable>().damageAction += (n) => rb.AddForce(15 * Mathf.Sign(n.transform.lossyScale.x) * Vector2.right, ForceMode2D.Impulse); GetComponent <Damageable>().dieAction += () => Destroy(gameObject); motion = GetComponent <MoveXCommand>(); attackCommand = GetComponent <ZombiAttack>(); stateMachine = GetComponent <UnitStateMachine>(); Patroler patroler = new Patroler(new StateInfo(transform, stateMachine), transform.position) { speed = BaseSpeed * 0.7f, time = 3f }; Follower follower = new Follower(new StateInfo(transform, stateMachine)) { maxSpeed = BaseSpeed }; MoveToPoint motionToPoint = new MoveToPoint(new StateInfo(transform, stateMachine), patroler.point, patroler) { speed = new Vector2(BaseSpeed * 0.8f, 0) }; //stateMachine.SetState(patroler); stateMachine.Initialize(follower); target = GameObject.FindGameObjectWithTag(targetTag).GetComponent <Rigidbody2D>(); follower.SetTarget(target); detectPlayer.Enter += () => stateMachine.SetState(follower); attackZone.Enter += () => stateMachine.SetState(new IdleState(new StateInfo(transform, stateMachine))); attackZone.Stay += () => attackCommand.Execute(); attackZone.Exit += () => stateMachine.SetState(follower); //lostZone.Exit += () => //{ // if (stateMachine.currentState == follower) // { // stateMachine.SetState(new WaitState(transform, stateMachine, 1, motionToPoint)); // } //}; }
public async Task ProcessAsync_HaveFollowings() { #region Stubs var follower = new Follower { Id = 12, Followings = new List <int> { 1 } }; var followers = new List <Follower> { follower, new Follower { Id = 11 } }; #endregion #region Mocks var rejectAllFollowingsActionMock = new Mock <IRejectAllFollowingsAction>(MockBehavior.Strict); rejectAllFollowingsActionMock .Setup(x => x.ProcessAsync( It.Is <Follower>(y => y.Id == follower.Id))) .Returns(Task.CompletedTask); var followersDalMock = new Mock <IFollowersDal>(MockBehavior.Strict); followersDalMock .Setup(x => x.GetFollowersAsync( It.Is <int>(y => y == 1))) .ReturnsAsync(followers.ToArray()); followersDalMock .Setup(x => x.DeleteFollowerAsync( It.Is <int>(y => y == 12))) .Returns(Task.CompletedTask); var twitterUserDalMock = new Mock <ITwitterUserDal>(MockBehavior.Strict); #endregion var action = new RemoveFollowerAction(followersDalMock.Object, twitterUserDalMock.Object, rejectAllFollowingsActionMock.Object); await action.ProcessAsync(follower); #region Validations followersDalMock.VerifyAll(); twitterUserDalMock.VerifyAll(); rejectAllFollowingsActionMock.VerifyAll(); #endregion }
// Is it the first normally collectable strawberry in the train? public static bool IsFirstStrawberry(Entity self) { Follower follow = self.Components.Get <Follower>(); if (follow == null) { return(false); } // we need it searchable and Find doesn't work on a ReadOnlyCollection aaaaa List <RegisteredBerry> berries = registeredBerries.ToList(); ReadOnlyCollection <Type> types = GetBerryTypes(); for (int i = follow.FollowIndex - 1; i >= 0; i--) { Entity strawberry = follow.Leader.Followers[i].Entity; Type t = strawberry.GetType(); RegisteredBerry berry = berries.Find(b => b.berryClass == t); // Is the "strawberry" registered? If not, bail immediately. // This is a safety check and should _never_ fail. bool isRegistered = types.Contains(strawberry.GetType()); // Does the strawberry not collect in the normal way? // If it does, we need to defer "leader" to another berry. bool blocksCollect = false; if (berry != null) { blocksCollect = berry.blocksNormalCollection; } // Is it a vanilla Gold Strawberry? // This needs to defer "leader" to another berry. bool goldenCheck = false; if (strawberry as Strawberry != null) { goldenCheck = (strawberry as Strawberry).Golden; } // Did we find a berry closer to the front that doesn't defer? // It must be registered, must NOT block collection, and is NOT a gold berry // in order to be a valid leader. if (types.Contains(strawberry.GetType()) && !blocksCollect && !goldenCheck) { return(false); } } return(true); }
public async Task ExecuteAsync(IEnumerable <ExtractedTweet> tweets, Follower follower, SyncTwitterUser user) { var userId = user.Id; var fromStatusId = follower.FollowingsSyncStatus[userId]; var tweetsToSend = tweets .Where(x => x.Id > fromStatusId) .OrderBy(x => x.Id) .ToList(); var inbox = follower.InboxRoute; var syncStatus = fromStatusId; try { foreach (var tweet in tweetsToSend) { try { if (!tweet.IsReply || tweet.IsReply && tweet.IsThread || _settings.PublishReplies) { var note = _statusService.GetStatus(user.Acct, tweet); await _activityPubService.PostNewNoteActivity(note, user.Acct, tweet.Id.ToString(), follower.Host, inbox); } } catch (ArgumentException e) { if (e.Message.Contains("Invalid pattern") && e.Message.Contains("at offset")) //Regex exception { _logger.LogError(e, "Can't parse {MessageContent} from Tweet {Id}", tweet.MessageContent, tweet.Id); } else { throw; } } syncStatus = tweet.Id; } } finally { if (syncStatus != fromStatusId) { follower.FollowingsSyncStatus[userId] = syncStatus; await _followersDal.UpdateFollowerAsync(follower); } } }
void InitRecruitmentButton(Follower f) { string cardPrefabName = f.getFollowerType() + "Card"; GameObject card = Instantiate(Resources.Load("Prefabs/UI Prefabs/Cards/" + cardPrefabName), CardDeck.transform) as GameObject; card.transform.position = new Vector3(0, 0, 0); getCardViewStatsTextGameObject(card).text = f.statsAsString(morale: false); getCardViewNameTextGameObject(card).text += ": " + f.recruitCost; Button btn; btn = card.GetComponent <Button>(); btn.onClick.AddListener(() => { eventRecruitmentButtonOnClick(f); }); }
public ActionResult Previous(FormCollection collection) { try { Follower followerModel = new Follower(); followerModel.PageNumber--; return RedirectToAction("Index"); } catch { return View(); } }
public async Task <bool> IsTopicFollowedByUserAsync(Follower follower) { var isFollower = await context.Followers.FindAsync(follower.TopicId, follower.UserId); return((isFollower is null) ? false : true); // if(isFollower is null) // { // return true; // } // else // { // return false; // } }
private void DropLastFollower() { if (line.Count <= 0) { return; } Follower last = line.Last.Value; FollowerListingManager.i.RemoveFriend(last.gameObject); last.following = false; last.target.target = null; line.RemoveLast(); }
public virtual Follower Follow( int userId, int targetId ) { if (userId <= 0) return null; if (targetId <= 0) return null; if (IsFollowing( userId, targetId )) return null; if (friendService.IsFriend( userId, targetId )) return null; User user = userService.GetById( userId ); User target = userService.GetById( targetId ); Follower f = new Follower(); f.User = user; f.Target = target; db.insert( f ); recountUsers( userId ); recountUsers( targetId ); return f; }
private void addNotification( Follower f ) { int receiverId = f.Target.Id; String msg = "<a href='" + Link.ToMember( f.User ) + "'>" + f.User.Name + "</a> " + lang.get( "followedYou" ); new NotificationService().send( receiverId, typeof( User ).FullName, msg, NotificationType.Follow ); }
private void addFeedInfo( Follower f ) { Feed feed = new Feed(); feed.Creator = f.User; feed.DataType = typeof( Follower ).FullName; feed.TitleTemplate = "{*actor*} " + lang.get( "follow" ) + " {*friend*}"; String userLink = Link.ToMember( f.Target ); Dictionary<string, object> dic = new Dictionary<string, object>(); String flnk = string.Format( "<a href=\"{0}\">{1}</a>", userLink, f.Target.Name ); dic.Add( "friend", flnk ); dic.Add( "friendId", f.Target.Id ); String templateData = JSON.DicToString( dic ); feed.TitleData = templateData; new FeedService().publishUserAction( feed ); }
public dynamic getFollowerInformation(Follower follower) { return getObjectFromURL(hostLookup[Host] + "/api/d3/data/follower/" + follower.ToString().ToLower()); }
public void AddFollower(Follower follower) { if(!_followers.Contains(follower)) _followers.Add(follower); }
void UpdateMyFollows(Follower follower, Chirper chirper, Action<MyFollows,Chirper> update) { var myFollows = _myFollowsRepository.GetById(follower.FollowerId); update.Invoke(myFollows,chirper); _myFollowsRepository.Update(myFollows); }
void UpdateMyFollowers(Chirper chirper, Follower follower, Action<MyFollowers, Follower> update) { var myFollowers = _myFollowersRepository.GetById(chirper.ChirperId); update.Invoke(myFollowers,follower); _myFollowersRepository.Update(myFollowers); }
private void addFeedInfo( Follower f ) { String msg = MbTemplate.GetFeed( "��ע��", f.Target.Name, Link.ToMember( f.Target ), "", f.Target.PicSX ); IMicroblogService microblogService = ObjectContext.Create<IMicroblogService>( typeof( MicroblogService ) ); microblogService.AddSimplePrivate( f.User, msg, typeof( Follower ).FullName, f.Target.Id, f.Ip ); }
//TODO - Implement public static void OpenFollower(Follower follower) { GarrisonButler.Diagnostic("OpenFollower - id: " + follower.FollowerId); //Scroll until we see follower first //TODO - Change for followers instead of missions var lua = "local mission; local am = {}; C_Garrison.GetAvailableMissions(am);" + String.Format( "for idx = 1, #am do " + "if am[idx].followerID == {0} then " + "follower = am[idx];" + "end;" + "end;" + "GarrisonMissionList_Update();" + "GarrisonMissionFrame.FollowerTab.FollowerList:Hide();" + "GarrisonMissionFrame.FollowerTab.MissionPage:Show();" + "GarrisonFollowerPage_ShowFollower(follower);" + "GarrisonMissionFrame.followerCounters = C_Garrison.GetBuffedFollowersForMission(\"{0}\");" + "GarrisonMissionFrame.followerTraits = C_Garrison.GetFollowersTraitsForMission(\"{0}\");" + "GarrisonFollowerList_UpdateFollowers(GarrisonMissionFrame.FollowerList);" , follower.FollowerId); Lua.DoString(lua); }
// Use this for initialization void Awake () { host = gameObject; follower = transform.GetChild (0).GetComponent<Follower>(); pathObject = transform.GetChild (1).GetComponent<PathObject>(); }
public virtual void Awake() { m_rigidbody = gameObject.GetComponent<Rigidbody>(); m_ShadowRenderer = GetComponent<BallShadowRenderer>(); m_LightRenderer = transform.FindChild("RefLight").GetComponent<Follower>(); m_FocusRenderer = transform.FindChild("Focus").GetComponent<Follower>(); sphereCollider = gameObject.GetComponent<SphereCollider>(); m_Mesh = GetComponent<MeshRenderer>(); //m_BallPhysicalDrag = GetComponent<BallPhysicalDrag>(); m_Radius = sphereCollider.radius * transform.localScale.x; m_BallPhysicalDrag = PhysicalSupportTools.PhysicalDragTo(gameObject, ConstantData.GetPoolDatas().BallDrag, ConstantData.GetPoolDatas().BallAngularDrag); //m_AngularVelocityCorrection = PhysicalSupportTools.AngularVelocityCorrectionTo(gameObject, m_rigidbody, m_Radius); m_PhysicMaterial = collider.sharedMaterial; }
void GenerateFoe() { Follower foll = new Follower(new Vector2(jugador.GetPosition().x + UnityEngine.Random.Range(-Futile.screen.width*2, Futile.screen.width*2), UnityEngine.Random.Range(-Futile.screen.height / 2, Futile.screen.height / 2))); enemies.Add(foll); }
void Start() { follower = GetComponent<Follower>(); }
public void AddFollower(Follower follower, bool snap = false) { string followerName = "follower_" + (Followers.Count + 1); //Debug.Log("Adding follower"); follower.name = followerName; Followers.Add(follower); GameObject goFollowerTransform = new GameObject("follower_mount") as GameObject; goFollowerTransform.transform.SetParent(transformFollowers); FollowerTransforms[follower] = goFollowerTransform.transform; follower.AttachToCircle(goFollowerTransform.transform, snap); }
public void FollowerSuppression( Follower follower ) { _context.Follower.Remove(follower); _context.SaveChanges(); }
public void RemoveFollower(Follower follower) { //Debug.Log("Removing follower " + follower.name); if(FollowerTransforms.ContainsKey(follower)) { GameObject.Destroy(FollowerTransforms[follower].gameObject); FollowerTransforms.Remove(follower); follower.RemoveFromCircle(); Followers.Remove(follower); } }
public void RemoveFollower(Follower follower) { if(_followers.Contains(follower)) _followers.Remove(follower); }
public void Initialize() { maxDelayinSeconds = int.Parse(CloudConfigurationManager.GetSetting("syncmaxdelayinseconds")); checkinSeconds = int.Parse(CloudConfigurationManager.GetSetting("synccheckinseconds")); //get all the dbs and their connectionstrings char[] separators = {';'}; dbCxnMap = new Dictionary<string,string>(); string []clients = CloudConfigurationManager.GetSetting("syncgroup").Split(separators); foreach (string client in clients) { dbCxnMap[client] = ConfigurationManager.ConnectionStrings[client].ConnectionString; } //find the leaders and followers leaders = new List<Leader>(); foreach (string client in clients) { Leader ld = new Leader(); ld.Name = client; ld.Followers = new List<Follower>(); ld.LastUpdated = DateTime.MinValue; foreach (string others in clients) { if (String.Compare(others, client) == 0) continue; Follower fl = new Follower(); fl.Name = others; ld.Followers.Add(fl); } leaders.Add(ld); } //the blob that contains the status info CloudStorageAccount storageAccount = CloudStorageAccount.Parse( CloudConfigurationManager.GetSetting("blobConnectionString")); string blobContainer = CloudConfigurationManager.GetSetting("blobContainer"); //create blob container and set permission CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); container = blobClient.GetContainerReference(blobContainer); container.CreateIfNotExists(); BlobContainerPermissions containerPermissions = new BlobContainerPermissions(); containerPermissions.PublicAccess = BlobContainerPublicAccessType.Blob; container.SetPermissions(containerPermissions); }