//float time = 10; void Start() { helpGod = new GameGod(); player = GameObject.Find("Tank"); mybullet = Resources.Load("mybullet") as GameObject; detonator = Resources.Load("explosion") as GameObject; }
// Update is called once per frame void Update() { camLeft = Camera.main.ScreenToWorldPoint(new Vector3(0.0f, 0.0f, 100.0f)); camTop = Camera.main.ScreenToWorldPoint(new Vector3(0.0f, Screen.height, 100.0f)); camRight = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, 0.0f, 100.0f)); camBottom = Camera.main.ScreenToWorldPoint(new Vector3(0.0f, 0.0f, 100.0f)); if (camTop.z + 2.0f >= transform.position.z) { isSpawning = true; } if (isSpawning) { transform.Translate(new Vector3(0.0f, 0.0f, 10.0f * Time.deltaTime)); spawnTimer += Time.deltaTime; if (spawnTimer >= spawnOffset && spawnNumber > 0) { Vector3 spawnPoint = new Vector3(0.0f, 0.0f, 0.0f); spawnTimer = 0.0f; Transform t = Instantiate(obj, transform.position, transform.rotation) as Transform; GameObject enemy = GameGod.GetLibraryScript(names, t); spawnNumber -= 1; } else if (spawnNumber <= 0) { Destroy(this.gameObject); } } }
private void Start() { // References. _gg = GetComponent <GameGod>(); // Actions. StartRound(); }
private void Awake() { CurrentPoints = 0; _instance = this; _started = false; DontDestroyOnLoad(gameObject); }
// Use this for initialization void Start() { GG = this.gameObject.GetComponent <GameGod>(); Unitlist = new List <SelectController>(); GameCamera = GameObject.Find("Main Camera").GetComponent <Camera>(); Rendercam.enabled = false; TName = UIName.GetComponent <Text>(); TDesc = UIDescription.GetComponent <Text>(); THP = UIhp.GetComponent <Text>(); HPPercent = UISlider.GetComponent <Slider>(); }
private IEnumerator Start() { _gg = GameObject.FindGameObjectWithTag("GameGod").GetComponent <GameGod>(); _currentSpawns = 0; _ragePT.SetActive(false); while (_currentSpawns < _maxSpawns) { Spawn(); _currentSpawns++; yield return(new WaitForSeconds(_spawnInterval)); } }
// Use this for initialization void Start() { GG = GameObject.Find("GameGod").GetComponent <GameGod>(); turtle = this.gameObject; turtle.transform.tag = "turtle"; Vector3 rot = new Vector3(0f, (float)rotation, 0f); turtle.transform.Rotate(rot, Space.Self); col = (BoxCollider)this.gameObject.AddComponent(typeof(BoxCollider)); rig = this.gameObject.AddComponent <Rigidbody>(); rig.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezePositionZ; this.gameObject.GetComponent <Rigidbody>().useGravity = false; turtle.transform.Translate(1 + 0.1f, 0, 0); //Debug.Log("split!"); }
public void Awake() { if (me != null) { Debug.LogError("TOO MANY GODS THEY MUST FIGHT"); Destroy(gameObject); return; } me = this; levelArray = new Level[4] { new Level1(), new Level2(), new Level3(), new Level4() }; //{ new MoveRightOne(), new MoveDiagonalUpLeft(), new MoveDiagonalUpLeftOnUnit(), new AccelerateRight()}; //playerRuleArr = new PlayerRule[4] // { new Lv1(), new Lv2(), new Lv3(), new Lv4()}; InitLevel(); arrowHead.SetActive(false); }
//public Unit unitprops; // Use this for initialization void Start() { updatetime = Random.Range(0f, 1f); //test.SetActive(false); GG = GameObject.Find("GameGod").GetComponent <GameGod>(); if (this.gameObject.tag.Equals("Unit")) { GG.PlayerUnits.Add(this.gameObject); //Add All units to the gamegod to work with } else if (this.gameObject.tag.Equals("enemy")) { GG.Enemyunits.Add(this.gameObject); } manag = GameObject.Find("GameGod").GetComponent <Manager>(); NMA = this.gameObject.GetComponent <NavMeshAgent>(); //selLight = this.gameObject.transform.GetChild(0).GetComponent<Light>(); }
// Use this for initialization void Start() { Copymat = GetComponent <MeshRenderer>().material; mg = GameObject.Find("GameGod").GetComponent <Manager>(); GG = GameObject.Find("GameGod").GetComponent <GameGod>(); if (this.gameObject.tag.Equals("Building")) { GG.Playerbuildings.Add(this.gameObject); } else if (this.gameObject.tag.Equals("enemyBuilding")) { GG.Enemybuildings.Add(this.gameObject); } this.hp = building.hp; this.def = building.def; buildTime = 0; maxBuildTime = building.BuildTime; }
void Awake() { var godObj = GameObject.FindWithTag("God"); if (godObj != null) { god = godObj.GetComponent <GameGod>(); } wiper = GetComponent <ScreenWiper>(); threshold = Screen.width / 2.5f; GenerateAnimations(); if (anims[0] != null) { anims[0].Play("Preview"); } var saver = GetComponent <GameStorageManager>(); saver.Load(out scores); UpdateLabel(); }
public GameObject gunBubbles; //Particle effect to instantiate private void Start() { _gg = GameObject.FindGameObjectWithTag("GameGod").GetComponent <GameGod>(); }
public void SpawnObject(GameObject _objectToSpawn, GameGod gg) { GameObject spawnedObject = Instantiate(_objectToSpawn, transform.position, transform.rotation); spawnedObject.GetComponentInChildren <EnemyController>()._gg = gg; }
// Use this for initialization void Start () { game = GameObject.Find("GameGod").GetComponent<GameGod>(); mouseClickDisable = true; }
void SpawnUnit(Vector3 pos) { Transform t = Instantiate(obj, pos, transform.rotation) as Transform; GameObject enemy = GameGod.GetLibraryScript(names, t); }
private void Start() { _currentDoors = new List <GameObject>(); _gg = GetComponent <GameGod>(); StartCoroutine(ActivateNextEvent()); }
private void Start() { GG = GameObject.Find("GameGod").GetComponent <GameGod>(); }