private void Awake() { executor = GetComponent <MovementExecutor>(); animator = GetComponent <FramesAnimator>(); rb2d = GetComponent <Rigidbody2D>(); spriteRenderer = GetComponent <SpriteRenderer>(); rb2d.gravityScale = GameManager.GRAVITY; }
public virtual void OnEnable() { gameObject.layer = LayerMask.NameToLayer("Monster"); died = false; current = new BattleStat(); LoadLevel(level); executor = GetComponent <MovementExecutor>(); if (executor != null) { executor.enabled = true; GetComponent <FramesAnimator>().enabled = true; } }
public virtual void OnEnable() { gameObject.layer = LayerMask.NameToLayer("Monster"); died = false; getHit = false; current = new BattleStat(); LoadLevel(level); executor = GetComponent <MovementExecutor>(); if (executor != null) { executor.enabled = true; GetComponent <FramesAnimator>().enabled = true; } LeanTween.scale(gameObject, new Vector3(10f, 10f), 3f).setLoopPingPong(); }
void InstantiateUnit(int unitID, int PlayerID, Vector3 position) { GameObject UnitObject = Unit.FindUnitsObjectByIntID(unitID, PlayerID); GameObject InstantiatedUnit = Instantiate(UnitObject, position, UnitObject.transform.rotation); Unit myUnit = InstantiatedUnit.GetComponent <UnitScript>().unitUnit; InstantiatedUnit.name = myUnit.Name; if (PlayerID == 0) { NewGameScript.PlayerOneArmy.Add(position, myUnit); } else { NewGameScript.PlayerTwoArmy.Add(position, myUnit); } MovementExecutor.SetTileAndUnitPair(InstantiatedUnit.GetComponent <UnitScript>(), position); }
// NOTE - currently THIS is JUST doing NORMAL MOVEMENT. Please do not add special movments (like QC) here in ANY WAY! // ALSO - use THIS instead of SendCommand, if its already in a command, obviously. public void DoMovement(UnitMovement unit) { if (GameStateManager.Instance.IsCurrentPlayerAI()) { GameStateManager.Instance.Animate(); } MovementExecutor METool = new MovementExecutor(unit, PathCreator.Instance.GetMovementPath()); if (unit is UnitFlight) { StartCoroutine(METool.Fly((unit as UnitFlight), PathCreator.Instance.Path[PathCreator.Instance.Path.Count - 1].transform.position)); } else { StartCoroutine(METool.Travel()); } TileColouringTool.UncolourAllTiles(); MovementQuestions.Instance.CheckIfAnyMoreUnitsToMove(); }
public MovementExecutorTool(MovementExecutor movementExecutor, ToolPanelController toolPanelController) { _movementExecutor = movementExecutor; _toolPanelController = toolPanelController; }
public void SetUp() { myTestOutput = new TestStepperOutput(); myMovementExecutor = new MovementExecutor(myTestOutput); }