void FixedUpdate() { // update location obstacleLoc = transform.position; if (enemystrength < 0f) { //PRINCESS DEATH princessengaged = false; enemySpawn enemySpawn = GameObject.Find("Game Manager").GetComponent <enemySpawn> (); // don't spawn where i died enemySpawn.existingEnemies -= 1; enemySpawn.princessdeathCount += 1; Movementscript Movementscript = GameObject.Find("Mino-man_Sprite").GetComponent <Movementscript>(); Movementscript.pausemove = true; if (Movementscript.ragecount == 0) { Movementscript.ragecount = 1; } Destroy(gameObject); } }
// Use this for initialization void Start() { Instantiate(floorTiles1, new Vector3(2.024f, -1.026f, 0), Quaternion.identity); sr = Background.GetComponent <SpriteRenderer>(); fScript = GameObject.FindGameObjectWithTag("floor").GetComponent <FloorMovement>(); eScript = GameObject.FindGameObjectWithTag("spawner").GetComponent <enemySpawn>(); Screen.SetResolution(640, 480, true); anim = transform.gameObject.GetComponent <Animator>(); levelno = 1; }
void Start () { SpaceKey = false; GameObject ESObject = GameObject.Find("EnemySpawnObject");//EnemySpawnObjectのオブジェクト取得 ES = ESObject.GetComponent<enemySpawn>(); //EnemySpawnObjectオブジェクトの中のenemySpawnスクリプトを取得 tm= GameObject.Find("TimerObject").GetComponent<timer>(); tm.setTime(0.0f); point = playtime / 3; state = 0; clear = false; ES.Espeed = 0.0f; GameObject.Find("Main Camera").GetComponent<AudioSource>().Play(); }
//================================================================================================================================================ void Start() { Panel.SetActive(false); Time.timeScale = 1; //textlevel.SetActive (true); //flag = true; //timeforfinish = Time.time; random = Random.Range(4, 7); //specify range of random health = 100; Score = 0; UpdateScore(Score); enemies.enemiesDestroid = 0; GameObject gameControllerObject = GameObject.FindGameObjectWithTag("enemySpawn"); control = gameControllerObject.GetComponent <enemySpawn> (); }
void Start() { enePreFab = GameObject.Find("EnemyBullet"); speed = -5f; thisList = GetComponent <enemySpawn> (); }
void FixedUpdate() { // update location obstacleLoc = transform.position; if (knightstrength < 0f) { // KNIGHT DEATH knightengaged = false; enemySpawn enemySpawn = GameObject.Find("Game Manager").GetComponent <enemySpawn> (); enemySpawn.existingEnemies -= 1; Movementscript Movementscript = GameObject.Find("Mino-man_Sprite").GetComponent <Movementscript>(); Movementscript.pausemove = true; Destroy(gameObject); } // KNIGHT DIRECTION if (knightengaged) { // FACE MINO WHEN ENGAGED Vector3 Minoman = GameObject.Find("Mino-man_Sprite").transform.position; if (Minoman.x < transform.position.x) { transform.localEulerAngles = new Vector3(0, 0, -90); //Debug.Log ("West to face Minoman"); } if (Minoman.x > transform.position.x) { transform.localEulerAngles = new Vector3(0, 0, 90); //Debug.Log ("East to face Minoman"); } if (Minoman.y < transform.position.y) { transform.localEulerAngles = new Vector3(0, 0, 0); //Debug.Log ("South to face Minoman"); } if (Minoman.y > transform.position.y) { transform.localEulerAngles = new Vector3(0, 0, -180); //Debug.Log ("North to face Minoman"); } } else { // DECISION TIME FOR DIRECTION dirtimer -= Time.deltaTime; if (dirtimer <= 0) { dirtimer = 10f; // DECIDING DIRECTION knightpath(); RaycastHit2D knightsight = Physics2D.Linecast(transform.position + (knightdir * knightsightStart), transform.position + (knightdir * knightsightLength)); Debug.DrawLine(transform.position + (knightdir * knightsightStart), transform.position + (knightdir * knightsightLength), Color.blue, 1.5f); } } }
// Start is called before the first frame update void Start() { Dino = FindObjectOfType <Dino>(); enemySpawn = FindObjectOfType <enemySpawn>(); groundMovement = FindObjectOfType <groundMovement>(); }