// Use this for initialization void Update() { if (pC == null) { GameObject player = GameObject.FindGameObjectWithTag ("Player"); pC = player.GetComponent<playerController> (); } }
public void changeState(playerController.zState zState) { switch (zState) { case playerController.zState.close: //print("state close"); if(!frontWind.activeSelf){ backWind.SetActive(true); rightWind.SetActive(false); frontWind.SetActive(false); } break; case playerController.zState.far: //print("state far"); if(!backWind.activeSelf){ backWind.SetActive(false); rightWind.SetActive(false); frontWind.SetActive(true); } break; case playerController.zState.center: //print("state center"); if(!rightWind.activeSelf){ backWind.SetActive(false); rightWind.SetActive(true); frontWind.SetActive(false); } break; } }
// Use this for initialization void Start() { blocks = new GameObject[25]; player = FindObjectOfType<playerController>(); blocks = GameObject.FindGameObjectsWithTag("Block"); //Debug.Log (blocks[0]); }
// Use this for initialization void Start() { WorldGestion = GameObject.Find ("WorldGestion"); WorldController = (World)WorldGestion.GetComponent(typeof(World)); TouchDetector = GameObject.Find ("TouchDetector"); SwipeScript = (SwipeDetector)TouchDetector.GetComponent(typeof(SwipeDetector)); Player = GameObject.Find ("player"); playerScript = (playerController)Player.GetComponent(typeof(playerController)); }
// Use this for initialization void Start() { speed = GameObject.Find ("Mouse").GetComponent<playerController> ().get_speed (); player = GetComponent<Transform>(); playerScript = GetComponent<playerController>(); moveToSpawn = true; levelStart = true; //Disable later - Enabled for testing deathTimer = 0.0f; timerOn = false; keyDraw = null; }
void OnTriggerEnter2D(Collider2D coll) { player = GameObject.Find ("Player(Clone)").GetComponent<playerController> (); if (player.purityEnabled) { LeavesFog (); } else if (!player.purityEnabled) { EntersFog(); } coll.gameObject.transform.position = transform.parent.position; }
// Use this for initialization void Start() { player1 = GameObject.FindGameObjectWithTag("Player").GetComponent <playerController>(); // enemy1 = gameObject.GetComponentInChildren<zombieMovementController>(); playerRB = GameObject.Find("mainCharacter").GetComponent <Rigidbody2D>(); }
// Update is called once per frame void Update() { if (Input.GetButtonDown ("Restart")) { Debug.Log ("Restart"); pc.isDead = true; } else if (Input.GetButtonDown ("Flag")) { Debug.Log ("Flag"); Destroy (curFlag); curFlag = Instantiate (flag); curFlag.transform.position = curPlayer.transform.position; spawnVelocity = curPlayer.GetComponent<Rigidbody2D> ().velocity.y; audio.PlayOneShot(flagSound); } else if (Input.GetButtonDown ("Cancel")) { Application.LoadLevel ("title"); } else if(Input.GetButtonDown("Jump")){ audio.PlayOneShot(jumpSound); } if (curPlayer.GetComponent<playerController> ().isDead) { Debug.Log ("DEAD"); audio.PlayOneShot(deathSound); Destroy (curPlayer); curPlayer = Instantiate (player); curPlayer.transform.position = curFlag.transform.position; attempts++; text.text = "Attempts: " + attempts; pc = curPlayer.GetComponent<playerController> (); } if (curPlayer.transform.position.x > finalBlock.transform.position.x) { pc.speed = 0; curPlayer.GetComponent<Rigidbody2D>().velocity = new Vector2(0,0); winText.text = "YOU WIN"; StartCoroutine("winTheGame"); } }
void Start() { playerController = GetComponent <playerController>(); }
public void SetTarget(playerController target) { _target = target; }
// Use this for initialization void Start() { isSuccess = false; player = this; numColored = 0; block00 = GameObject.Find("block00").transform.position; block01 = GameObject.Find("block01").transform.position; block02 = GameObject.Find("block02").transform.position; block03 = GameObject.Find("block03").transform.position; block04 = GameObject.Find("block04").transform.position; block05 = GameObject.Find("block05").transform.position; block06 = GameObject.Find("block06").transform.position; block10 = GameObject.Find("block10").transform.position; block11 = GameObject.Find("block11").transform.position; block12 = GameObject.Find("block12").transform.position; block13 = GameObject.Find("block13").transform.position; block14 = GameObject.Find("block14").transform.position; block15 = GameObject.Find("block15").transform.position; block16 = GameObject.Find("block16").transform.position; block20 = GameObject.Find("block20").transform.position; block21 = GameObject.Find("block21").transform.position; block22 = GameObject.Find("block22").transform.position; block23 = GameObject.Find("block23").transform.position; block24 = GameObject.Find("block24").transform.position; block25 = GameObject.Find("block25").transform.position; block26 = GameObject.Find("block26").transform.position; block30 = GameObject.Find("block30").transform.position; block31 = GameObject.Find("block31").transform.position; block32 = GameObject.Find("block32").transform.position; block33 = GameObject.Find("block33").transform.position; block34 = GameObject.Find("block34").transform.position; block35 = GameObject.Find("block35").transform.position; block36 = GameObject.Find("block36").transform.position; block40 = GameObject.Find("block40").transform.position; block41 = GameObject.Find("block41").transform.position; block42 = GameObject.Find("block42").transform.position; block43 = GameObject.Find("block43").transform.position; block44 = GameObject.Find("block44").transform.position; block45 = GameObject.Find("block45").transform.position; block46 = GameObject.Find("block46").transform.position; block50 = GameObject.Find("block50").transform.position; block51 = GameObject.Find("block51").transform.position; block52 = GameObject.Find("block52").transform.position; block53 = GameObject.Find("block53").transform.position; block54 = GameObject.Find("block54").transform.position; block55 = GameObject.Find("block55").transform.position; block56 = GameObject.Find("block56").transform.position; block60 = GameObject.Find("block60").transform.position; block61 = GameObject.Find("block61").transform.position; block62 = GameObject.Find("block62").transform.position; block63 = GameObject.Find("block63").transform.position; block64 = GameObject.Find("block64").transform.position; block65 = GameObject.Find("block65").transform.position; block66 = GameObject.Find("block66").transform.position; block70 = GameObject.Find("block70").transform.position; block71 = GameObject.Find("block71").transform.position; block72 = GameObject.Find("block72").transform.position; block73 = GameObject.Find("block73").transform.position; block74 = GameObject.Find("block74").transform.position; block75 = GameObject.Find("block75").transform.position; block76 = GameObject.Find("block76").transform.position; block80 = GameObject.Find("block80").transform.position; block81 = GameObject.Find("block81").transform.position; block82 = GameObject.Find("block82").transform.position; block83 = GameObject.Find("block83").transform.position; block84 = GameObject.Find("block84").transform.position; block85 = GameObject.Find("block85").transform.position; block86 = GameObject.Find("block86").transform.position; //Debug.Log(block00); }
// Start is called before the first frame update void Start() { _playerController = FindObjectOfType(typeof(playerController)) as playerController; StartCoroutine("spawnBarril"); }
void Start() { GameObject player = GameObject.Find("Player"); playerCon = player.GetComponent <playerController>(); }
//rect(left, top, width, height) void Start() { controller = GetComponent<playerController>(); behavior = GetComponent<ActorBehavior>(); Left = 0; Right = Screen.width; HorizMiddle = Screen.width/2; HorizQuarter = HorizMiddle/2; Top = 0; Bottom = Screen.height; VertMiddle = Screen.height/2; VertQuarter = VertMiddle/2; }
public override void OnInteraction(playerController playerScript) { //no behaviour }
public override void OnCollisionEnd(playerController playerScript) { //no behaviour }
/// <summary> /// Attempt to interact with the object by calling the script's OnInteraction(). /// </summary> /// <param name="playerScript">The playerController script calling this method.</param> public void PlayerInteract(playerController playerScript) { OnInteraction(playerScript); }
/// <summary> /// Method called when the player stops touching the object. /// </summary> /// <param name="playerScript">The playerController script calling this method.</param> public abstract void OnCollisionEnd(playerController playerScript);
/// <summary> /// Method called when the player attempts to interact with the object. /// </summary> /// <param name="playerScript">The playerController script calling this method.</param> public abstract void OnInteraction(playerController playerScript);
// Use this for initialization void Start() { invenpen = GameObject.Find ("InvenPan"); inventhin = GameObject.Find ("InventarHinweis").GetComponent<Text> (); player = GameObject.Find ("First Person Controller").GetComponent<playerController> (); qp = GameObject.Find ("QuestionPanel"); qptexts = qp.GetComponentsInChildren<Text> (); qpimages = qp.GetComponentsInChildren<Image> (); itemlog = GameObject.Find ("ItemLog").GetComponent<ItemScript> (); itemcoco = GameObject.Find ("ItemCoco").GetComponent<ItemScript> (); itemaxe = GameObject.Find ("ItemAxe").GetComponent<ItemScript> (); itemfire = GameObject.Find ("ItemFire").GetComponent<ItemScript> (); itemtent = GameObject.Find ("ItemTent").GetComponent<ItemScript> (); itemnet = GameObject.Find ("ItemNet").GetComponent<ItemScript> (); itemfish = GameObject.Find ("ItemFish").GetComponent<ItemScript> (); itemmeat = GameObject.Find ("ItemMeat").GetComponent<ItemScript> (); itemhealth = GameObject.Find ("ItemHealth").GetComponent<ItemScript> (); itemBottle = GameObject.Find ("ItemBottle").GetComponent<ItemScript> (); itemStone = GameObject.Find ("ItemStone").GetComponent<ItemScript> (); if(craftingcorrect == null) craftingcorrect = GameObject.Find("CraftingCorrect").audio; axe = GameObject.Find ("axe").GetComponent<WeaponScript> (); net = GameObject.Find ("net").GetComponent<WeaponScript> (); leftHand = ""; rightHand = ""; setInventarHinweis (""); }
// Use this for initialization void Start() { //system init intervalCnt = 0; //cash //transform cash cashTransform = transform; //maincontroller mainCtr = GameObject.Find("mainController"); mc = mainCtr.GetComponent <mainController> (); //playercontroller playerCtr = GameObject.Find("playerController"); plc = playerCtr.GetComponent <playerController> (); //sprite sr = GetComponent <SpriteRenderer>(); //animator animt = GetComponent <Animator>(); animt.speed = 2.5f; //option idx //(set from parent objects) // optionIdx = 0; //player position //(set from parent objects) // px = 0; // py = 0; //move directiion //set from parent objects //op0 // mvDirection = mvDirInit_op0; //op1 // mvDirection = mvDirInit_op1; mvsizex = 0.0f; mvsizey = 0.0f; absposx = 0.0f; absposy = 0.0f; //shot direction //set from parent objects //op0 // stDirection = 0.0f; // ssd = stDirSpeedInit_op0; //op1 // stDirection = 0.0f; // ssd = stDirSpeedInit_op1; //bullet cnt bltcnt = 0; //player mode //set from parent objects // pMode = plc.playerModeNoExist; //player type //set from parent objects // playerType = 0; //bullet power //set from parent objects // bPower = 0; //objnum inc mc.incObj(); }
// Use this for initialization void Start() { anim = GetComponent<Animator>(); player = GetComponentInParent<playerController>(); }
private void Start() { _player = GameObject.FindWithTag("Player"); _playerController = _player.GetComponent <playerController>(); _collider = gameObject.GetComponent <CircleCollider2D>(); }
// Use this for initialization void Start() { playerScript = GetComponent<Transform>().parent.gameObject.GetComponent<turret>().playerScript; }
// Use this for initialization void Start() { player = GameObject.FindWithTag("Player"); playerController = player.GetComponent <playerController>(); }
// Use this for initialization void Start() { _state = new controllerState(); _controller = this.gameObject.GetComponent<playerController>(); }
public void ResetPlayer(playerController player) { player.score = 0; player.UpdateScore(); }
// Use this for initialization void Start() { //system init intervalCnt = 0; //cash //transform cash cashTransform = transform; //sprite renderer sr = GetComponent <SpriteRenderer>(); //maincontroller mainCtr = GameObject.Find("mainController"); mc = mainCtr.GetComponent <mainController> (); //playercontroller playerCtr = GameObject.Find("playerController"); plc = playerCtr.GetComponent <playerController> (); //pos x,y //(set from parent objects) cashTransform.position = new Vector3(posx, posy, 0.0f); //target pos tposx = 0.0f; tposy = 0.0f; tpossize = 4.0f; tposdir = 90.0f; tposdd = 4.0f; //bullet cnt bcnt = 0; //atack stop cnt attime = 0; //move speed xx = xspdbase * Random.Range(-1.5f, 1.5f); yy = yspdbase * -1; //current direction //(set from parent objects) // cdir = 270.0f; // cdir = -90.0f; //target direction //(set from parent objects) // tdir = 270.0f; // tdir = -90.0f; //item //(set from parent objects) // item = -1; //enemy inital hitpoint eHpIntial = basehitpoint + 0; //enemy hitpoint eHp = eHpIntial; //objnum inc mc.incObj(); incobj = true; }
// Use this for initialization void Start() { Player = FindObjectOfType <playerController>(); levelManager = GameObject.Find("Level Manager").GetComponent <LevelManager>(); StartCoroutine(startDeadZone()); }
void Awake() { anim = player.GetComponent <Animator>(); script = player.GetComponent <playerController>(); }
void Awake() { player = GameObject.Find("Player").GetComponent <playerController> (); }
public virtual void OnPickUp(playerController player) { player.PickUpRelic(this); }
// Use this for initialization void Start() { player = FindObjectOfType <playerController> (); shotCounter = waitBetweenShots; anim = GetComponent <Animator> (); }
// Use this for initialization void Start() { playerA = GameObject.Find("PlayerA"); playerB = GameObject.Find("PlayerB"); states.Add("standing"); states.Add("walking"); states.Add("jumping"); states.Add("hands up"); Screen.lockCursor = true; characterController = GetComponent<CharacterController>(); if (!characterController) { //freak out } playerStatA = playerA.GetComponent<playerController>(); playerStatB = playerB.GetComponent<playerController>(); animator = GetComponent<Animator>(); moveList[0] = -1; moveList[1] = 0; moveList[2] = 1; makeKillDead = false; }
// Use this for initialization void Start() { pc = GameObject.FindGameObjectWithTag("Player").GetComponent <playerController>(); }
// Use this for initialization void Start() { Camera camera = GetComponent<Camera> (); Vector3 p = camera.ScreenToWorldPoint (new Vector3 (16, 16, camera.nearClipPlane)); p.z = 0; GameObject go = Instantiate (block); go.transform.position = p; curFlag = Instantiate (flag); curFlag.transform.position = curPlayer.transform.position; spawnVelocity = curPlayer.GetComponent<Rigidbody2D> ().velocity.y; attempts = 0; audio = GetComponent<AudioSource> (); text.text = "Attempts: " + attempts; GameObject gb; Vector3 p1; pc = curPlayer.GetComponent<playerController> (); int i; for (i=0; i<35; i++) { gb = Instantiate (block); p1 = p; p1.x = p1.x + 0.5f * i; gb.transform.position = p1; if (i == 30) { gb = Instantiate (spikes); p1 = p; p1.x = p1.x + 0.5f * i; p1.y = p1.y + 0.65f; gb.transform.position = p1; } } while (i<end) { gb = Instantiate (block); p1 = p; p1.x = p1.x + 0.5f * i; gb.transform.position = p1; i++; int start = i; for (i=i; i<start+15; i++) { gb = Instantiate (block); p1 = p; p1.x = p1.x + 0.5f * i; gb.transform.position = p1; } gb = Instantiate (block); p1 = p; p1.x = p1.x + 0.5f * i; gb.transform.position = p1; //Randomly generate one of the following platform setups if (i < (end - 50)) { room = Random.Range (1, 5); } else { room = -1; } start = i; switch (room) { case 1: for (i=i; i<start+3; i++) { gb = Instantiate (block); p1 = p; p1.x = p1.x + 0.5f * i; gb.transform.position = p1; gb = Instantiate (spikes); p1 = p; p1.x = p1.x + 0.5f * i; p1.y = p1.y + 0.65f; gb.transform.position = p1; } start = i; for (i=i; i<start+3; i++) { gb = Instantiate (block); p1 = p; p1.x = p1.x + 0.5f * i; gb.transform.position = p1; } start = i; for (i=i; i<start+3; i++) { gb = Instantiate (block); p1 = p; p1.x = p1.x + 0.5f * i; gb.transform.position = p1; gb = Instantiate (spikes); p1 = p; p1.x = p1.x + 0.5f * i; p1.y = p1.y + 0.65f; gb.transform.position = p1; } break; case 2: for (i = i; i<start+20; i++) { gb = Instantiate (block); p1 = p; p1.x = p1.x + 0.5f * i; gb.transform.position = p1; gb = Instantiate (spikes); p1 = p; p1.x = p1.x + 0.5f * i; p1.y = p1.y + 0.65f; gb.transform.position = p1; if ((i - start) % 8 == 0) { gb = Instantiate (block); p1 = p; p1.x = p1.x + 0.5f * i; p1.y = p1.y + 1.35f; gb.transform.position = p1; } } break; case 3: for (i=i; i<start+5; i++) { gb = Instantiate (block); p1 = p; p1.x = p1.x + 0.5f * i; gb.transform.position = p1; gb = Instantiate (spikes); p1 = p; p1.x = p1.x + 0.5f * i; p1.y = p1.y + 0.65f; gb.transform.position = p1; } break; case 4: break; default: break; } } finalBlock = Instantiate (winFlag); p1 = p; p1.x = p1.x + 0.5f * i; p1.y = p1.y + 0.65f; finalBlock.transform.position = p1; }
// Use this for initialization void Start() { player = GameObject.Find("player").GetComponent <playerController>(); }
// Use this for initialization void Start() { player = GameObject.Find ("Player").GetComponent<playerController>(); enemyPrefab.GetComponent<enemyManager> ().value = startval; }
// Use this for initialization void Start() { _player = FindObjectOfType(typeof(playerController)) as playerController; plattaformRB = GetComponent <Rigidbody2D> (); }
void Associate() { playerShip = this.GetComponent <GameObject>(); playerShipScript = GetComponent <playerController>(); shipParticle = GetComponentInChildren <ParticleSystem>(); }
// Use this for initialization void Start() { p = FindObjectOfType <playerController>(); }
// Use this for initialization void Start() { enemyTouchAttackColliderAfterWithinRange = GetComponent<CapsuleCollider>(); playerScript = GameObject.FindObjectOfType<playerController>().GetComponent<playerController>(); }
void Start() { playerC = FindObjectOfType(typeof(playerController)) as playerController; startP = transform.position; }
// Reference the player private void getPlayer() { playerSphere = FindObjectOfType<playerController>(); if (playerSphere) { print("PlayerSphere referenced"); } else { print("PlayerSphere reference failed"); } }
void Awake() { _instance = this; }
// Use this for initialization void Start() { GameObject player = GameObject.FindGameObjectWithTag ("Player"); pC = player.GetComponent<playerController> (); }
// Start is called before the first frame update void Start() { playerCScript = player.GetComponent <playerController>(); }
void Awake() { me = this; }
// Use this for initialization void Start() { //system init intervalCnt = 0; //cash //transform cash cashTransform = transform; //sprite renderer sr = GetComponent <SpriteRenderer>(); //maincontroller mainCtr = GameObject.Find("mainController"); mc = mainCtr.GetComponent <mainController> (); //playercontroller playerCtr = GameObject.Find("playerController"); plc = playerCtr.GetComponent <playerController> (); //type //(set from parent objects) // type = 0; //explosion explosion = false; //move seq movseq = 0; //move seq cnt movseqcnt = 0; //pos x,y posx = 0.0f; posy = ymax; if (type == 0) { posx = posx + xoffset_0; posy = posy + yoffset_0; } else if (type == 1) { posx = posx + xoffset_1; posy = posy + yoffset_1; } else if (type == 2) { posx = posx + xoffset_2; posy = posy + yoffset_2; } else if (type == 3) { posx = posx + xoffset_3; posy = posy + yoffset_3; } //position init cashTransform.position = new Vector3(posx, posy, 0); //mov x,y //(set from parent objects) // xx = 0; // yy = 0; //first mov x,y //cdir cdir = 0.0f; cdd = 1.0f; //shot seq //(set from parent objects) stseq = 99; //bullet cnt bcnt = 0; //(set from parent objects) bcnt2 = 0; bcnt3 = 0; bcnt4 = 0; bcnt5 = 0; bdir = 0; //damage cnt damagecnt = 0; //on damage ondamage = false; //blink cnt blinkcnt = 0; //enemy inital hitpoint eHpIntial = basehitpoint; eHpIntial = eHpIntial + (plc.pPower * 75); eHpIntial = eHpIntial + ((plc.oNum - 2) * 50); eHpIntial = eHpIntial + (plc.pLaser * 50); eHpIntial = eHpIntial + (plc.pMissile * 75); //adjust at game level if (mc.gameLevel == mc.gameLevelEasy) { eHpIntial = (int)((float)eHpIntial * 0.95f); } else if (mc.gameLevel == mc.gameLevelNormal) { eHpIntial = (int)((float)eHpIntial * 1.00f); } else if (mc.gameLevel == mc.gameLevelHard) { eHpIntial = (int)((float)eHpIntial * 1.05f); } //enemy hitpoint eHp = eHpIntial; //explosion count expcnt = 0; expcnt2 = 0; //sprite sr.sprite = null; //scale cashTransform.localScale = new Vector3(0.2f, 0.2f, 1.0f); //tag this.tag = "unavailableEnemy"; //objnum inc mc.incObj(); }