// Use this for initialization void Start () { gameObject.tag = "Player"; GetComponent<Renderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On; GetComponent<Renderer> ().receiveShadows = true; controller = gameObject.GetComponent<CharacterController> (); gameCon = gameObject.GetComponent<SB_GameController> (); moving = false; currentTile = gameCon.startTile; currentLoc = tileSystem.GetTile (currentTile).gameObject.transform.position; currentLoc.y = .75f; transform.position = currentLoc; }
// Use this for initialization void Start() { GetComponent<Renderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On; GetComponent<Renderer>().receiveShadows = true; player = GameObject.Find("SB_Player"); tileSystem = player.GetComponent<SB_PlayerController>().tileSystem; startPos = tileSystem.GetTile(startTile).gameObject.transform.position; startPos.y = .74f; transform.position = startPos; endPos = tileSystem.GetTile(endTile).gameObject.transform.position; endPos.y = .74f; gameCon = player.GetComponent<SB_GameController>(); seeker = GetComponent<Seeker>(); currentPos = 0; controller = GetComponent<CharacterController>(); //A* function that generates the closest path from startPos to endPos. seeker.StartPath(startPos, endPos, OnPathComplete); to = true; from = false; updatedPos = false; moved = true; isAlarmed = false; }