Esempio n. 1
0
        protected IEnumerator MovementMidpoint(float time)
        {
            yield return(new WaitForSeconds(time));

            GridPosition tempPos = Position.Clone();

            TruePosition = Position.Clone();

            body.GetComponent <SpriteRenderer>().sortingOrder = InputHandlerer.GetSortingOrder(this) + 5;
            body.shadowRenderer.sortingOrder = body.sRenderer.sortingOrder - 1;
        }
Esempio n. 2
0
        protected IEnumerator MovementMidpointAttack(float time)
        {
            yield return(new WaitForSeconds(time));

            //  if (targetEnemy != null)targetEnemy.RecieveAttack();
            anim.Play("Attack");
            GridPosition tempPos = Position.Clone();

            TruePosition = Position.Clone();

            body.GetComponent <SpriteRenderer>().sortingOrder = InputHandlerer.GetSortingOrder(this) + 5;
            body.shadowRenderer.sortingOrder = body.sRenderer.sortingOrder - 1;
        }
 public void DisplayRange(List <GridPosition> posses, RangeType rType)
 {
     currentRangeType = rType;
     Clear();
     Container = new GameObject();
     foreach (GridPosition pos in posses)
     {
         GridPosition pos2 = pos.Clone();
         GameObject   go   = GameObject.Instantiate(UIManager._instance.rangeTilePrefabs[(int)rType]);
         go.transform.position = GameGrid.currentGrid.GetPositionOf(pos2.y, pos2.x, pos2.z) + GameGrid.BlockDirections.UP / 2;
         pos2.z--;
         go.GetComponent <SpriteRenderer>().sortingOrder = InputHandlerer.GetSortingOrder(pos2) + 1;
         hightlighters.Add(go);
         go.transform.parent = Container.transform;
     }
 }
Esempio n. 4
0
        public void MoveInstant(GridPosition pos)
        {
            GameTile tile = GameGrid.currentGrid.GetTile(pos);

            if (tile)
            {
                body.transform.position = tile.CenterPoint + topOffset;

                Position = pos.Clone();

                TruePosition = Position.Clone();
                body.sRenderer.sortingOrder      = InputHandlerer.GetSortingOrder(this);
                body.shadowRenderer.sortingOrder = body.sRenderer.sortingOrder - 1;
            }
            else
            {
                Debug.LogWarning("No Tile At Spawnpoint : " + pos);
            }
        }
 public void SetTarget(GridPosition pos)
 {
     currentPosition = pos;
     gameObject.transform.position = GameGrid.currentGrid.GetPositionOf(pos.y, pos.x, pos.z) + GameGrid.BlockDirections.UP;
     SetSorting(InputHandlerer.GetSortingOrder(pos) + 5);
 }