private void Start() { // timer shield = GameObject.FindWithTag("Shield"); render = shield.GetComponent <MeshRenderer>(); collider = shield.GetComponent <Collider>(); actionPickup = GetComponent <Pickupper>(); //finished = GameObject.Find("Portal").GetComponent<GameOver>(); door = GameObject.Find("Door").GetComponent <CesarOpen>(); shieldActivated = false; index = 0; icon = GameObject.Find("shieldToken"); shieldText.enabled = false; //keyText.enabled = false; shieldText.text = ""; //st = GameObject.FindWithTag("ShieldTimer"); stimer = timer.GetComponent <ShieldTimer>(); timer.enabled = false; }
void Start() { actionPickup = GetComponentInParent <Pickupper>(); actionEat = GetComponentInParent <Eat>(); actionShield = GetComponentInParent <ShieldActivator>(); st = GameObject.FindWithTag("ShieldTimer"); stimer = st.GetComponent <ShieldTimer>(); fpsCam = GetComponent <Camera>(); firstCamPosition = GetComponent <Transform>().localPosition; thirdCamPosition = firstCamPosition + new Vector3(0, 5, -5); actionThrow = GetComponent <Throw>(); // set the current object to ActivePlayer gameObject.transform.parent.tag = "ActivePlayer"; shield = GameObject.FindWithTag("Shield"); //shieldOff = shield.GetComponent<ShieldActivator>(); // if(shield != null) { // render = shield.GetComponent<MeshRenderer>(); // collider = shield.GetComponent<Collider>(); // shieldActivated = false; // } }
void Start() { //player = GameObject.FindWithTag("ActivePlayer"); actionPickup = player.GetComponent <Pickupper>(); defaultRotationAngle = transform.localEulerAngles.y; }
void Start() { // Get the NavMeshAgent component agent = this.GetComponent <NavMeshAgent>(); controller = GetComponentInParent <NavMeshController>(); // Calls the "Pickupper" script on the player (if you follow the Pickupper script's instructions, the player should have the pickupper script on him) pickUpFunction = player.GetComponent <Pickupper>(); // Enemy starts his round GoToNextPoint(); }
public void EatFood() { myFood = GetComponentInParent <Pickupper>(); if (myFood.IsHoldingObject()) { foodLoc = myFood.grabPoint; foreach (Transform child in foodLoc) { Eatable eatable = child.GetComponent <Eatable>(); if (child.gameObject != null && eatable != null) { Vector3 foodSize = child.gameObject.transform.localScale; StartCoroutine(EatTheShit(child, foodSize, duration)); } } } }
void Start() { isChanging = false; myFood = GetComponentInParent <Pickupper>(); // shield = GameObject.FindWithTag("Shield"); // render = shield.GetComponent<MeshRenderer>(); // collider = shield.GetComponent<Collider>(); actionShield = GetComponentInParent <ShieldActivator>(); //playerSize = player.transform.localScale; small = false; //player = GameObject.FindWithTag("ActivePlayer"); playerSize = this.transform.localScale; initialPos = initialObj.transform.position; initialPosPlayer = initialPlayer.transform.position; //initialPos = shroom.transform.position; }
// Start is called before the first frame update void Start() { pickupper = GetComponent <Pickupper>(); }
// Start is called before the first frame update void Start() { PickUp = GetComponent <Pickupper>(); }
//player actions private void PlayerActions() { float horizontal = Input.GetAxis("Horizontal"); float vertical = Input.GetAxis("Vertical"); RigidBodyController controller = GetComponentInParent <RigidBodyController>(); controller.Locomote(new Vector3(horizontal, 0, vertical)); controller.Rotate(); if (Input.GetKeyDown(KeyCode.Space)) { controller.Jump(); } if (Input.GetMouseButtonDown(0)) { //become other player on left click CreateRay(); } if (Input.GetKeyDown(KeyCode.C)) { if (CamMode == 1) { CamMode = 0; } else { CamMode++; } StartCoroutine(CamChange()); } if (Input.GetKeyDown(KeyCode.U)) { if (actionPickup && actionPickup.IsHoldingObject()) { Usable usable = actionPickup.HeldObject().GetComponent <Usable>(); if (usable) { usable.Use(); } } } if (Input.GetKeyDown(KeyCode.I)) { //checks for the actionpickup script and if it is holding an object if (actionPickup && actionPickup.IsHoldingObject()) { //get the spawner script in the children component of pickupper script actionSpawn = actionPickup.GetComponentInChildren <Spawner>(); //call spawn function actionSpawn.Spawn(); } } if (Input.GetKeyDown(KeyCode.P)) { //call pickup function actionPickup = GetComponentInParent <Pickupper>(); actionPickup.PickUp(); } if (Input.GetKeyDown(KeyCode.E)) { //call eat function actionEat = GetComponentInParent <Eat>(); actionEat.EatFood(); } if (Input.GetKeyDown(KeyCode.T)) { if (actionPickup && actionThrow && actionPickup.IsHoldingObject()) { actionThrow.ThrowObject(); } } //... more actions }
// Use this for initialization void Start () { InputHandler = ConfigurableInput.Instance; pickupper = GetComponent<Pickupper>(); }
// Start is called before the first frame update void Start() { pickupper = GetComponent <Pickupper>(); throwSound = GetComponent <AudioSource>(); }