// Use this for initialization void Start() { GameObject playerManager = GameObject.FindGameObjectWithTag("PlayerManager"); PlayerManager playerManagerScript = playerManager.GetComponent <PlayerManager> (); for (int i = 0; i < playerManagerScript.numPlayers; i++) { if (playerManagerScript.players[i].GetComponent <PlayerBase>().classType == playerClass.WOODSMAN) { woodsPlayer = playerManagerScript.players[i]; } } playerForward = woodsPlayer.transform.forward; transform.up = new Vector3(playerForward.x, playerForward.y, playerForward.z); if (heldTime > 5.0f) { infinitePierce = true; } else { numPiercing = Mathf.FloorToInt(heldTime); } hawk = GameObject.FindGameObjectWithTag("Hawk"); hawkScript = hawk.GetComponent <HawkAI2> (); }
public void Awake() { classType = playerClass.WOODSMAN; anim = GetComponent <Animator>(); // instantiate the hawk at the hawkspawn position hawkPos = transform.Find("hawkSpawn"); hawk = Instantiate(Resources.Load("Prefabs/Character/WoodsMan/Hawk"), hawkPos.position, Quaternion.identity) as GameObject; // acquire the position from where to shoot arrows shootPosition = transform.Find("shootPos"); // set the moveTimer to 0 at the beginning canMoveTimer = 0.0f; // Get the hawk script to be able to set modes hawkScripts = hawk.GetComponent <HawkAI2>(); }
// Use this for initialization void Start() { GameObject playerManager = GameObject.FindGameObjectWithTag("PlayerManager"); PlayerManager playerManagerScript = playerManager.GetComponent <PlayerManager> (); for (int i = 0; i < playerManagerScript.numPlayers; i++) { if (playerManagerScript.players[i].GetComponent <PlayerBase>().classType == playerClass.WOODSMAN) { woodsPlayer = playerManagerScript.players[i]; } } playerForward = woodsPlayer.transform.forward; //transform.up = playerForward; timer = 1.0f; hawk = GameObject.FindGameObjectWithTag("Hawk"); hawkScript = hawk.GetComponent <HawkAI2> (); }
private void Start() { woodsman = GameObject.Find("Woodsman(Clone)").GetComponent <Woodsman>(); hawkScript = GameObject.FindGameObjectWithTag("Hawk").GetComponent <HawkAI2>(); }