コード例 #1
0
    private void Awake()
    {
        executor       = GetComponent <MovementExecutor>();
        animator       = GetComponent <FramesAnimator>();
        rb2d           = GetComponent <Rigidbody2D>();
        spriteRenderer = GetComponent <SpriteRenderer>();

        rb2d.gravityScale = GameManager.GRAVITY;
    }
コード例 #2
0
    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;
        }
    }
コード例 #3
0
    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();
    }
コード例 #4
0
    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);
    }
コード例 #5
0
    // 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();
    }
コード例 #6
0
 public MovementExecutorTool(MovementExecutor movementExecutor, ToolPanelController toolPanelController)
 {
     _movementExecutor    = movementExecutor;
     _toolPanelController = toolPanelController;
 }
コード例 #7
0
 public void SetUp()
 {
     myTestOutput       = new TestStepperOutput();
     myMovementExecutor = new MovementExecutor(myTestOutput);
 }