protected void StealthApproach() { Timer stealthApproachTimer = new Timer(7000); _isStealthApproching = true; if (ObjectManager.Me.IsAlive && ObjectManager.Target.IsAlive) { while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && (ObjectManager.Target.GetDistance > 2.5f || !Claw.IsSpellUsable) && (specialization.RotationType == Enums.RotationType.Party || ToolBox.GetClosestHostileFrom(ObjectManager.Target, 20f) == null) && Fight.InFight && !stealthApproachTimer.IsReady && Me.HaveBuff("Prowl")) { Vector3 position = ToolBox.BackofVector3(ObjectManager.Target.Position, ObjectManager.Target, 2.5f); MovementManager.MoveTo(position); Thread.Sleep(50); CastOpener(); } if (stealthApproachTimer.IsReady && ToolBox.Pull(cast, settings.AlwaysPull, new List <AIOSpell> { FaerieFireFeral, MoonfireRank1, Wrath })) { _combatMeleeTimer = new Timer(2000); return; } //ToolBox.CheckAutoAttack(Attack); _isStealthApproching = false; } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // Makes Input Manager as a service and adds as a component m_gameState = new GameState(this); Components.Add(m_gameState); m_inputManager = new InputManager(this); Services.AddService(typeof(InputManager), m_inputManager); Components.Add(m_inputManager); m_movementManager = new MovementManager(this); Services.AddService(typeof(MovementManager), m_movementManager); Components.Add(m_movementManager); // Setting up HUD. Must follow setting up MovementManager! headsUpDisplay = new HUDComponent(this); Components.Add(headsUpDisplay); RasterizerState state = new RasterizerState(); state.CullMode = CullMode.None; m_graphics.GraphicsDevice.RasterizerState = state; m_gameState.GraphicsDevice = m_graphics.GraphicsDevice; m_gameState.AspectRatio = m_graphics.GraphicsDevice.Viewport.AspectRatio; base.Initialize(); }
// Use this for initialization void Start() { currentSquadIndex = 0; //squadCamera.SetTarget(squads[currentSquadIndex].gameObject.transform.position); squadCamera.SetTarget(squads[currentSquadIndex].gameObject.transform); movementManager = GetComponent<MovementManager>(); }
private void FightLoopHandler(WoWUnit unit, CancelEventArgs cancel) { if (specialization is FeralDPSParty && settings.PartyStandBehind && _moveBehindTimer.IsReady) { if (ToolBox.StandBehindTargetCombat()) { _moveBehindTimer = new Timer(4000); } } if (specialization is Feral && (ObjectManager.Target.HaveBuff("Pounce") || ObjectManager.Target.HaveBuff("Maim")) && !MovementManager.InMovement && Me.IsAlive && !Me.IsCast && ObjectManager.Target.IsAlive) { Vector3 position = ToolBox.BackofVector3(ObjectManager.Target.Position, ObjectManager.Target, 2.5f); MovementManager.Go(PathFinder.FindPath(position), false); while (MovementManager.InMovement && Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && (ObjectManager.Target.HaveBuff("Pounce") || ObjectManager.Target.HaveBuff("Maim"))) { // Wait follow path Thread.Sleep(500); } } }
public SShellGameTest(Game game) : base(game) { movementManager = new MovementManager(); objectShellFactory = new ObjectShellFactory(Game.Content, movementManager); }
public override void Run() { _lastTimeRunning = Others.Times; MovementManager.StopMove(); Thread.Sleep(500); Tasks.MountTask.DismountMount(); Logging.Write("Prospecting in progress"); Timer timer = new Timer(15 * 60 * 1000); // Prospecting while (Prospecting.NeedRun(nManagerSetting.CurrentSetting.MineralsToProspect) && Products.Products.IsStarted && Usefuls.InGame && !ObjectManager.ObjectManager.Me.InCombat && !ObjectManager.ObjectManager.Me.IsDeadMe && !timer.IsReady) { Thread.Sleep(200); Prospecting.Pulse(nManagerSetting.CurrentSetting.MineralsToProspect); Thread.Sleep(750); while (ObjectManager.ObjectManager.Me.IsCast && Products.Products.IsStarted && Usefuls.InGame && !ObjectManager.ObjectManager.Me.InCombat && !ObjectManager.ObjectManager.Me.IsDeadMe && !timer.IsReady) { Thread.Sleep(100); } Thread.Sleep(Others.Random(600, 1600) + Usefuls.Latency); } }
public async Task <bool> ForceLand() { StatusText = "Landing"; landingStopwatch.Restart(); while (MovementManager.IsFlying && Behaviors.ShouldContinue) { MovementManager.StartDescending(); if (landingStopwatch.ElapsedMilliseconds > 2000 && MovementManager.IsFlying) { var move = ExProfileBehavior.Me.Location.AddRandomDirection2D(10).GetFloor(15); await move.MoveToNoMount(false, 0.5f); landingStopwatch.Restart(); } await Coroutine.Yield(); } Logger.Verbose(Localization.Localization.ExFlyTo_Landing, landingStopwatch.Elapsed); landingStopwatch.Reset(); return(true); }
void Start() { brain = GetComponent <FSM>(); movementManager = GetComponent <MovementManager>(); movementManager.Invoke(this); GameCtrl.Instance.RegisterActiveUnit(this); }
public void AddScene(Type sceneType) { ConstructorInfo constructorInfo = sceneType.GetConstructor(new Type[] { typeof(IContext) }); IScene scene; object[] constructorParams = new object[] { }; if (constructorInfo != null) { constructorParams = new object[] { _context }; } else if ((constructorInfo = sceneType.GetConstructor(new Type[] { typeof(IContext), typeof(EntityManager) })) != null) { EntityManager entityManager = new EntityManager(); constructorParams = new object[] { _context, entityManager }; } else if ((constructorInfo = sceneType.GetConstructor(new Type[] { typeof(IContext), typeof(EntityManager), typeof(IMovementManager) })) != null) { EntityManager entityManager = new EntityManager(); IMovementManager movementManager = new MovementManager(entityManager); constructorParams = new object[] { _context, entityManager, movementManager }; } else { constructorInfo = sceneType.GetConstructors()[0]; } scene = constructorInfo.Invoke(constructorParams) as IScene; scene.Setup(); Scenes.Add(scene.SceneId, scene); }
internal static async Task <bool> MoveOutOfIdyllshire() { Logger.SendLog("We're in Idyllshire, moving to The Dravanian Hinterlands."); await MountUp(); var movementParams = new MoveToParameters { Destination = "Idyllshire Exit", Location = new Vector3(142.6006f, 207f, 114.136f), DistanceTolerance = 5f }; while (Core.Player.Distance(movementParams.Location) > 5f) { Navigator.MoveTo(movementParams); await Coroutine.Yield(); } Navigator.Stop(); Core.Player.SetFacing(0.9709215f); MovementManager.MoveForwardStart(); await Coroutine.Sleep(TimeSpan.FromSeconds(2)); await Coroutine.Wait(TimeSpan.MaxValue, () => !CommonBehaviors.IsLoading); await Coroutine.Sleep(TimeSpan.FromSeconds(2)); return(true); }
// Approach spell target private void ApproachSpellTarget() { Timer limit = new Timer(10000); if (CurrentSpellTarget != null) { Logger.Log($"Approaching {CurrentSpellTarget.Name} to cast {CurrentSpell.Name} ({CurrentSpellTarget.GetDistance}/{CurrentSpell.MaxRange}"); MovementManager.Go(PathFinder.FindPath(CurrentSpellTarget.Position), false); Thread.Sleep(1000); while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !limit.IsReady && (CurrentSpellTarget.IsAlive || CurrentSpell.OnDeadTarget) && (CurrentSpellTarget.GetDistance > CurrentSpell.MaxRange - 2 || TraceLine.TraceLineGo(CurrentSpellTarget.Position))) { Thread.Sleep(100); } MovementManager.StopMoveNewThread(); } else if (CurrentSpellLocation != null) { Logger.Log($"Approaching {CurrentSpellLocation} to cast {CurrentSpell.Name}"); MovementManager.Go(PathFinder.FindPath(CurrentSpellLocation), false); Thread.Sleep(1000); while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !limit.IsReady && (CurrentSpellLocation.DistanceTo(ObjectManager.Me.Position) > CurrentSpell.MaxRange - 2)) { Thread.Sleep(100); } MovementManager.StopMoveNewThread(); } }
private void Awake() { player = FindObjectOfType <PlayerController>().gameObject; playerMovement = player.GetComponent <MovementManager>(); pixelPerfect = GetComponent <PixelPerfectCamera>(); originalAppu = pixelPerfect.assetsPPU; }
void OnMouseDown() { if (_movementPossible) { MovementManager.MakeActiveUnitMove_CLIENT(); // this just checks is a unit is currently selected and then does the moving shit } }
private void FightLoopHandler(WoWUnit unit, CancelEventArgs cancel) { if (specialization.RotationType == Enums.RotationType.Party && _moveBehindTimer.IsReady) { if (ToolBox.StandBehindTargetCombat()) { _moveBehindTimer = new Timer(4000); } } else { if (IsTargetStunned() && !MovementManager.InMovement && Me.IsAlive && !Me.IsCast && ObjectManager.Target.IsAlive) { Vector3 position = ToolBox.BackofVector3(ObjectManager.Target.Position, ObjectManager.Target, 2.5f); MovementManager.Go(PathFinder.FindPath(position), false); while (MovementManager.InMovement && StatusChecker.BasicConditions() && IsTargetStunned()) { // Wait follow path Thread.Sleep(200); } } } }
public string GetAllMovements(string data) { var para = JsonConvert.DeserializeObject <MovementSearchParameter>(data); var retValues = new List <GridMovement>(); var movements = MovementManager.GetMovementsBySearchparameter( para, SessionManager.CurrentUser.ID); foreach (var m in movements) { retValues.Add( new GridMovement { ID = m.ID, Amount = m.AMOUNT, CategoryName = m.CATEGORY.NAME, ReasonText = m.REASON.TEXT, UserName = m.USER.NAME, AccountName = m.ACCOUNT.NAME, DateAdded = m.DATE_ADDED.ToShortDateString(), DateEdit = m.DATE_EDIT.HasValue ? m.DATE_EDIT.Value.ToShortDateString() : string.Empty, Message = m.MESSAGE, CategoryID = m.CATEGORY_ID, ReasonID = m.REASON_ID, AccountID = m.ACCOUNT_ID }); } return(JsonConvert.SerializeObject(retValues)); }
public static void Land(bool useLuaToLand = false) { try { LongMove.LongMoveIsLanding = true; Logging.WriteNavigator("Landing in progress."); MovementManager.StopMove(); MovementsAction.Descend(true, false, useLuaToLand); Timer t = new Timer(60000); bool completeLanding = false; while (Usefuls.IsFlying && !t.IsReady) { float z0 = ObjectManager.ObjectManager.Me.Position.Z; Thread.Sleep(250); if (z0 == ObjectManager.ObjectManager.Me.Position.Z) { completeLanding = true; t.ForceReady(); } } if (Usefuls.IsFlying && !completeLanding) { Logging.WriteDebug("Still flying after 1min of landing."); } Thread.Sleep(150); MovementsAction.Descend(false, false, useLuaToLand); } finally { LongMove.LongMoveIsLanding = false; } }
static public string Play(string input) { //初期値 var moveMng = new MovementManager('B', 'A'); var output = new StringBuilder(); output.Append('A'); foreach (var command in input) { if (command == 'r') { moveMng.TurnRight(); } else if (command == 'l') { moveMng.TurnLeft(); } else if (command == 'b') { moveMng.Back(); } else { return(string.Format("無効な文字\'{0}\'が含まれています", command)); } output.Append(moveMng.NowNode); } return(output.ToString()); }
protected async override Task Main() { await CommonTasks.HandleLoading(); await GoThere(); if (UseMesh) { await MoveAndStop(Destination, Distance, "Moving to Location", true); if (InPosition(Destination, Distance)) { _done = true; } } else { Me.Face(Destination); MovementManager.MoveForwardStart(); if (InPosition(Destination, Distance)) { _done = true; } } }
public static async Task <bool> Dismount(byte maxTicks = 100, ushort interval = 100) { var dismountTicks = 0; while (dismountTicks++ < maxTicks && Core.Player.IsMounted && Behaviors.ShouldContinue) { if (MovementManager.IsFlying) { if (Navigator.PlayerMover is FlightEnabledSlideMover) { Navigator.Stop(); } else { MovementManager.StartDescending(); } } else { ActionManager.Dismount(); } await Wait(interval, () => !Core.Player.IsMounted); } if (dismountTicks > maxTicks) { Logger.Instance.Error("Failed to dismount."); return(false); } return(true); }
void Start() { movementManager = GetComponent <MovementManager>(); audioSource = GetComponent <AudioSource>(); gunDatsuManager = GetComponent <GunDatsuManager>(); animator = GetComponent <Animator>(); }
public async Task <bool> AetherialFlowHandler(GameObject context) { if (ScriptHelper.InCombat()) { return(false); } if (SelectYesno.IsOpen) { SelectYesno.ClickYes(); return(true); } while (!Navigator.InPosition(context.Location, Core.Me.Location, 3f) && ScriptHelper.IsTodoChecked(0)) { Navigator.PlayerMover.MoveTowards(context.Location); MovementManager.Jump(); return(true); } if (ScriptHelper.IsTodoChecked(0)) { if (MovementManager.IsMoving) { await CommonTasks.StopMoving(); return(true); } } return(await ScriptHelper.ObjectInteraction(context)); return(false); }
public MainPage() { InitializeComponent(); //TODO get config from _movementManager = new MovementManager(2, 4); _personManager = new PersonManager(); _personManager.PeopleReceivedEventHandler += new EventHandler <List <Person> >(PeopleReceived); _pobCount = 0; txtCount.Text = _pobCount.ToString(); PeopleOnBoard = new SortedObservableCollection <PobItem>(); DataContext = this; _personService = new PersonService(); _dispatcher = Window.Current.Dispatcher; //start background task to connect to card Reader. var task = new Task(async() => await CreateNfcReader()); task.Start(); //Mqtt Service Connect MqttService.Connect(); MqttService.MessageReceived += new EventHandler <Movement>(MovementMessage); }
void InstantiateObject(int viewID, int playerType, int team, string playerPlayFabID, string playFabName) { GameObject obj = Instantiate(charactersPrefabs[playerType], Vector3.zero, Quaternion.identity) as GameObject; PhotonView objView = obj.GetComponent <PhotonView>(); objView.viewID = viewID; obj.name = playFabName; PlayerNetworkLayer playerNetwork = obj.GetComponent <PlayerNetworkLayer>(); playerNetwork.Initialize(); PlayerManager playerManager = obj.GetComponent <PlayerManager>(); playerManager.StartPlayer(true, (TeamTypes)team, playerPlayFabID, playFabName); MovementManager movementManager = obj.GetComponent <MovementManager>(); movementManager.StartMovementManager(objView.isMine); GameController.instance.AddPlayer(playerManager); SkinnedMeshRenderer[] renderers = playerManager.GetComponentsInChildren <SkinnedMeshRenderer>(); for (int j = 0; j < renderers.Length; j++) { ProceduralMaterial material = renderers[j].material as ProceduralMaterial; material.SetProceduralBoolean("Team", (TeamTypes)team == TeamTypes.Blue); material.RebuildTextures(); } AudioManager.instance.PlayGameplayMusic(); }
private void SetMovementManager() { MovementManager movementManager = m_Skeleton[(int)PlayerSkeleton.pelvis].AddComponent <MovementManager>(); movementManager.SetRayCastMask(LayerMask.GetMask("Ground")); movementManager.UseKeyboard(m_UseKeyboard); }
private static bool CheckPath(Point destination, bool isHoldingWGFlag, bool isSomeoneHoldingMyFlag, bool isSomeoneHoldingThemFlag, bool inCombat) { if (CurrentInformationsHasChanged(Main.InternalIgnoreFight, isHoldingWGFlag, isSomeoneHoldingMyFlag, isSomeoneHoldingThemFlag, inCombat)) { return(false); } if (MovementManager.CurrentPath == null) { MovementManager.StopMove(); Logging.Write("InternalGoTo : MovementManager.CurrentPath = null; InMovement = " + MovementManager.InMovement); } else if (MovementManager.CurrentPath.Count <= 0) { MovementManager.StopMove(); Logging.Write("InternalGoTo : MovementManager.CurrentPath.Count <= 0; InMovement = " + MovementManager.InMovement); } else if ((!inCombat || Main.InternalIgnoreFight) && MovementManager.CurrentPath[MovementManager.CurrentPath.Count - 1].DistanceTo(destination) > 1.5) { MovementManager.StopMove(); Logging.Write("InternalGoTo : MovementManager.CurrentPath[MovementManager.CurrentPath.Count - 1].DistanceTo(point) = " + MovementManager.CurrentPath[MovementManager.CurrentPath.Count - 1].DistanceTo(destination) + "; InMovement = " + MovementManager.InMovement); } return(true); }
private static async Task <bool> StopMovement() { if (!MovementManager.IsFlying) { if (!MovementManager.IsMoving) { return(true); } int ticks = 0; while (MovementManager.IsMoving && ticks < 100) { MovementManager.MoveStop(); await Coroutine.Sleep(100); ticks++; } if (ticks >= 100) { Logging.WriteVerbose("Timeout whilst trying to stop movement."); } return(true); } else { MovementManager.MoveStop(); await Coroutine.Sleep(100); return(true); } }
// Use this for initialization void Start() { GameObject ballCarrier = GameObject.FindGameObjectWithTag("offense"); target = ballCarrier.GetComponent <OffensePlayerController>(); steering = new MovementManager(this); }
public override void Run() { if (!_enRoute) { MovementManager.StopMove(); Logging.Write("Nearby Flight Master " + _flightMaster.Name + " (" + _flightMaster.Entry + ") is not yet discovered."); } _enRoute = true; Npc target = new Npc { Entry = _flightMaster.Entry, Position = _flightMaster.Position, Name = _flightMaster.Name, ContinentIdInt = Usefuls.ContinentId, Faction = ObjectManager.ObjectManager.Me.PlayerFaction.ToLower() == "horde" ? Npc.FactionType.Horde : Npc.FactionType.Alliance, }; uint baseAddress = MovementManager.FindTarget(ref target, 5.0f); if (MovementManager.InMovement) { return; } if (_flightMaster.GetDistance > 5) { return; } if (baseAddress > 0) { MovementManager.StopMove(); // avoid a red wow error Thread.Sleep(150); Interact.InteractWith(baseAddress); } }
void Awake() { _gameManager = FindObjectOfType <GameManager>(); if (_gameManager == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _locationManager = GetComponentInChildren <LocationManager>(); if (_locationManager == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _movementManager = GetComponentInChildren <MovementManager> (); if (_movementManager == null) { Debug.LogError("OOPSALA we have an ERROR!"); } _combatManager = GetComponentInChildren <CombatManager> (); if (_combatManager == null) { Debug.LogError("OOPSALA we have an ERROR!"); } }
private void Follow(double lastTick) { followTimer.Update(lastTick); if (!followTimer.HasElapsed) { return; } Player owner = GetVisible <Player>(OwnerGuid); if (owner == null) { // this shouldn't happen, log it anyway log.Error($"VanityPet {Guid} has lost it's owner {OwnerGuid}!"); RemoveFromMap(); return; } // only recalculate the path to owner if distance is significant float distance = owner.Position.GetDistance(Position); if (distance < FollowMinRecalculateDistance) { return; } MovementManager.Follow(owner, FollowDistance); followTimer.Reset(); }
public override MoveResult MoveTo(MoveToParameters location) { //if we aren't in POTD default to the original mover right away. if (!Constants.Maps.ContainsKey(WorldManager.RawZoneId)) { return(Original.MoveTo(location)); } SetupDetour(); AddBlackspots(); WallCheck(); if (AvoidanceManager.Avoids.Any(r => r.IsPointInAvoid(location.Location))) { Logger.Warn("Location is in sidestep avoidance - ##AVOID##"); if (!AvoidanceManager.Avoids.Any(r => r.IsPointInAvoid(Core.Me.Location))) { Logger.Error("Forcing stop"); MovementManager.MoveStop(); } // CommonTasks.StopMoving("Wait for avoidance"); return(MoveResult.PathGenerationFailed); } location.WorldState = new WorldState { MapId = WorldManager.ZoneId, Walls = wallList, Avoids = trapList }; return(Original.MoveTo(location)); }
protected async override Task <bool> Main() { await CommonTasks.HandleLoading(); if (UseMesh) { if (await MoveAndStop(Destination, Distance, "Moving to Destination", true, (ushort)MapId, MountDistance)) { return(true); } _done = true; } else { Core.Player.Face(Destination); MovementManager.MoveForwardStart(); if (!Navigator.InPosition(Core.Player.Location, Destination, Distance)) { return(true); } else { _done = true; } } return(false); }
protected virtual void Init() { weaponManager = GetComponent<WeaponManager> (); movementManager = GetComponent<MovementManager> (); healthManager = GetComponent<HealthManager> (); spriteRenderer = GetComponent<SpriteRenderer> (); healthManager.Killed += OnKilled; }
public PoleAi(GameObject[] controlledPoles, MovementManager movementManager) { aiPoles = controlledPoles; moveMgmt = movementManager; GetNearestPole(); GetNearestMan(); }
void Start(){ movementManager = GetComponent<MovementManager> (); playerSpawner = GetComponent<PlayerSpawner> (); player = GetComponent<Player> (); elementSpawner = GetComponent<ElementSpawner> (); spellSpawner = GetComponent<SpellSpawner> (); shieldSpawner = GetComponent<ShieldSpawner> (); audioManager = GetComponent<AudioManager> (); }
// Use this for initialization void Start () { InputM = GetComponent<InputManager>(); Movement = GetComponent<MovementManager>(); Tester = GetComponent<TestScript>(); isRunning = false; }
void Awake() { if(!instance || instance == this) { instance = this; } else { Destroy(this); } }
public SGame(Game game) : base(game) { SwapMe = false; gameStateManager = new GameStateManager(Game.Content, true); movementManager = new MovementManager(); gameStateManager.setMovementManager(movementManager); OnPauseEvent += gameStateManager.OnPause; OnResumeEvent += gameStateManager.OnResume; }
protected override void Awake() { base.Awake(); attackNoticeWatcher = GetComponentInChildren<AttackNoticeWatcher>(); // attackNoticeWatcher.onAttackNotice += HandleOnAttackNotice; movementComponent = transform.parent.GetComponent<MovementManager>(); movementComponent.StopMovement(); enemyTracking = null; enemiesInRange = new List<HeroComponent>(); }
void Awake() { #region singleton if(instance == null) { instance = this; } else if(instance != this) { Destroy(gameObject); } #endregion #region component initializations pause = GetComponent<PauseMenu>(); notebook = gameObject.GetComponentInChildren<NoteBook>(); movement = GetComponent<MovementManager> (); interaction = GetComponent<InteractionManager> (); #endregion }
/// <summary> /// Inicializacion /// </summary> private void Start() { Offset = Vector2.zero; Mecanim = GameManager.Instance.Player.GetComponentInChildren<Animator>(); Movement = GameManager.Instance.Player.GetComponentInChildren<MovementManager>(); }
/// <summary> /// Serializa un movement manager /// </summary> /// <param name="writer">Archivo xml</param> /// <param name="component">Movement manager</param> public static void Serialize(XmlWriter writer, MovementManager component) { writer.WriteStartElement("MovementManager"); SimpleSerialization.Serialize(writer, component.Speed, "Speed"); SimpleSerialization.Serialize(writer, component.Rotation, "Rotation"); SimpleSerialization.Serialize(writer, component.Gravity, "Gravity"); writer.WriteEndElement(); }
public MapEditor() { InitializeComponent(); //Find config file IniFile.SetConfigurationPath( @".\MapEditor.ini"); //Load the editor options editorOptions = new EditorOptions(); //Load the entity creator creator = new EntityCreator(objectTree.Nodes); //Create a new xna window to render into xna = new XnaForms(pnlOutput.Handle, pnlOutput.Width, pnlOutput.Height); xna.Content.RootDirectory = @"Content"; camera = new Camera(); spriteBatch = new SpriteBatch(xna.GraphicsDevice); //Adjust the current size previousSize = Size; levelBuilder = new LevelBuilder(); ScreenHeight = 800; gameStateManager = new GameStateManager(xna.Content, false); movementManager = new MovementManager(); gameStateManager.setMovementManager(movementManager); selectedItems = new List<WorldObject>(); closeHandeler += GetMapProperties; //Mouse handeling initializing mousePosition = Vector2.Zero; prevMousePosition = Vector2.Zero; mouseButtonDown = MouseButtons.None; Level level = new Level(); gameStateManager.Level = level; LoadTextures(); RenderFrame(); }
protected override void Start() { // Busco componentes TrackPosition = GetComponentInChildren<TrackLocation>(); Movement = GetComponentInChildren<MovementManager>(); // Desactivo el componente de inmunidad GetComponentInChildren<Inmunity>().enabled = false; // Configuro las animaciones Mecanim = GetComponentInChildren<Animator>(); MecanimState = Animator.StringToHash("StateID"); // Localizo las capas ObstaclesLayer = LayerMask.NameToLayer("Obstacles"); RampsLayer = LayerMask.NameToLayer("Ramps"); base.Start(); // Agrego los sonidos Sounds = new List<AudioSource>(); foreach (State state in StatesMap.Values) { AudioSource source = gameObject.AddComponent<AudioSource>(); source.clip = (AudioClip)Resources.Load("Audio/" + state.ID.ToString()); if (state.ID == StateID.Forward) source.loop = true; Sounds.Add(source); } }
void Start() { Instance = this; StartCoroutine(WaitForPlayer()); }
public static void Wipe() { MovementManager.instance = null; }
// Use this for initialization void Start() { MM_Script = GameObject.Find("MovementManager").GetComponent<MovementManager>(); }
/// <summary> /// Constructor /// </summary> /// <param name="character">Personaje a controlar</param> /// <param name="target">Objetivo a seguir</param> public FollowState(FSMBehaviour character) : base(character, StateID.Follow) { Movement = Character.GetComponentInChildren<MovementManager>(); }
// Use this for initialization void Start() { animator = GetComponent<Animator>(); movementManager = player.GetComponent<MovementManager>(); }
// Use this for initialization void Start() { MM_Script = GameObject.Find("MovementManager").GetComponent<MovementManager>(); LevelTitle.text = "- " + LevelTitleName + " -"; LevelTagLines.text = LevelTagLineText; numOfTurns.text = totalTurns.ToString(); if(numOfShapes > 1) { CollectShapes(); } StartCoroutine(FadeOutLevelTitle()); }
/// <summary> /// Constructor /// </summary> /// <param name="character">Personaje a controlar</param> /// <param name="stateID">Estado</param> public MoveState(FSMBehaviour character, StateID stateID) : base(character, stateID) { Movement = Character.GetComponentInChildren<MovementManager>(); }
public void SetPlayer (Transform player) { ptrMovementManager = player.GetComponent<MovementManager>(); }