// Use this for initialization
 void Start()
 {
     turnManager = GameObject.Find("AITurnManager").GetComponent<AITurnManager>();
     unit = transform.parent.GetComponent<TileObject>();
     movePoints = transform.FindChild("MovePoints").GetComponent<Text>();
     healthBar = transform.FindChild("Health").FindChild("HealthGreen").GetComponent<Image>();
     sanityBar = transform.FindChild("Sanity").FindChild("SanityBlue").GetComponent<Image>();
 }
 public void InitializeMovementPlane()
 {
     grid = GameObject.Find("Grid").GetComponent<LevelGrid>();
     transform.parent = grid.gameObject.transform;
     turnManager = GameObject.Find("AITurnManager").GetComponent<AITurnManager>();
 }
Exemple #3
0
    public void UpdateGrid()
    {
        turnManager = GameObject.Find("AITurnManager").GetComponent<AITurnManager>();
        spawnTiles.Clear ();

        if (grid != null)
        {
            for (int i = 0; i <= grid.Length - 1; i++)
            {
                grid[i].GetComponent<BasicTile>().InitializeTile();
            }
        }
    }
Exemple #4
0
 // Use this for initialization
 void Start()
 {
     turnManager = GameObject.Find("AITurnManager").GetComponent<AITurnManager>();
     turn = transform.GetChild(0).GetComponent<Text>();
     turnCount = transform.GetChild(1).GetComponent<Text>();
 }
Exemple #5
0
    public void InitializeTileObject()
    {
        grid = GameObject.Find("Grid").GetComponent<LevelGrid>();
        transform.parent = grid.gameObject.transform;

        List<GameObject> possibleSpawns = new List<GameObject>();
        for(int i = 0; i < grid.spawnTiles.Count; i++)
        {
            GameObject tile = grid.spawnTiles[i].gameObject;
            for (int j = 0; j < tile.GetComponent<BasicTile>().spawnTags.Length; j++)
            {
                if (gameObject.CompareTag(tile.GetComponent<BasicTile>().spawnTags[j]) && !tile.GetComponent<BasicTile>().IsOccupied && tile.GetComponent<BasicTile>().IsSpawn)
                {
                    possibleSpawns.Add(tile);
                }
            }
        }

        if (possibleSpawns.Count <= 0)
        {
            presentTile = null;
            print("No spawns!");
        }
        else
        {
            presentTile = possibleSpawns[Random.Range(0, possibleSpawns.Count - 1)];
            presentTile.GetComponent<BasicTile>().IsOccupied = true;
            presentTile.GetComponent<BasicTile>().CharacterStepping = this;
            nextTile = null;
        }

        if (gameObject.GetComponent<AuraManager>() != null)
        {
            aura = gameObject.GetComponent<AuraManager>();
        }

        turnManager = GameObject.Find("AITurnManager").GetComponent<AITurnManager>();
        animatedMesh = transform.GetChild(1).gameObject.GetComponent<Animator>();
        isMoving = false;
        orientation = BasicTile.Orientation.Forward;
        movementPoints = maxMovementPoints;
        actionPoints = maxActionPoints;
        hP = maxHP;
        sanity = maxSanity;

        //UI
          //  descriptionBox = gameObject.transform.FindChild("PlayerCanvas").FindChild("MouseOverText").GetComponent<Image>();
    }