void Start() { solved = false; // Register the singleton if (Instance != null) { Debug.LogError("Multiple instances of Timer!"); } Instance = this; int len = orignalImgPlaces.Length; tempImgPostions = new Vector3[len]; origImgPostions = new Vector3[len]; for (int a = 0; a < orignalImgPlaces.Length; a++) { tempImgPostions[a] = orignalImgPlaces[a].transform.position; } for (int c = 0; c < orignalImgPlaces.Length; c++) { origImgPostions[c] = tempImgPostions[c]; } tempImgPostions = reshuffle(tempImgPostions); scrambleImgPlaces2(); }
// Use this for initialization void Start() { gameManagerScriptRef = GameObject.Find ("gameManager").GetComponent<gameManagerScript> (); gameManagerScriptRef.gridContents [(int)gameObject.transform.position.x,(int)gameObject.transform.position.y] = gameObject; gameManagerScriptRef.enemies[4-(int)transform.position.x]=gameObject; }
// Update is called once per frame void Update() { // shakes text text.localPosition = startPosition + Random.insideUnitSphere * power; // Adjusts shake power depending on point value GameObject gameManager = GameObject.Find("GameManager"); gameManagerScript gameManager_script = gameManager.GetComponent <gameManagerScript>(); points = gameManager_script.pointCounter; power = points * 0.01f; }
// Use this for initialization void Awake() { Cursor.lockState = CursorLockMode.Confined; if (instance == null) { instance = this; } else { instance = null; } }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } instance = this; //Allows scripts to run in every scene. DontDestroyOnLoad(this.gameObject); }
// Start is called before the first frame update private void Awake() { manager = GameObject.Find("gameManager").GetComponent <gameManagerScript>(); towers = manager.towerList; //may need to add into update //tRateText = GameObject.Find("tRateText").GetComponent<Text>(); pSpeedText = GameObject.Find("pSpeedText").GetComponent <Text>(); Debug.LogWarning(pSpeedText.GetComponent <Text>().text); pDamageText = GameObject.Find("pDamageText").GetComponent <Text>(); //pSpeedText.transform.parent.gameObject.SetActive(false); //pDamageText.transform.parent.gameObject.SetActive(false); }
// Start is called before the first frame update void Start() { mScript = GameObject.Find("gameManager").GetComponent<gameManagerScript>(); speed = 0.01f; if (mScript.waveNumber < 10) { damage = 1.0f; } else { damage = (mScript.waveNumber / 10)+1; } Debug.Log(damage); }
//method to destroy enemy and call methods in manager to add score/money void destroyEnemy() { //remove from enemy list mScript.enemyList.Remove(gameObject); //destroy enemy Destroy(gameObject); //call manager to reduce enemy count for wave mScript.enemiesRemaining--; //call manager to add money to player's bank etc gameManagerScript manager = GameObject.Find("gameManager").GetComponent <gameManagerScript>(); manager.score += score; manager.scoreText.text = "Score: " + manager.score; }
// Start is called before the first frame update void Start() { manager = GameObject.Find("gameManager").GetComponent <gameManagerScript>(); manager.towerList.Add(this); store = GameObject.Find("gameManager").GetComponent <storeScript>(); this.damage = store.currentTowerDamage; this.speed = store.currentTowerSpeed; if (direction == "") { direction = "right"; dVector = new Vector3(1, 0); } currentTime = fireRate / 2.0f; DetermineDirection(); }
// Use this for initialization void Start() { mScript = GameObject.Find("gameManager").GetComponent <gameManagerScript>(); //add to a list of enemies //mScript.enemyList.Add(this.gameObject); targetPosition = Vector2.zero; distanceFromCores = new Vector2(0, 1000); distanceFromDoors = new Vector2(0, 1000); position = transform.position; direction = -1; //calculateTargetCore(); hasMovedVertical = false; hasMovedHorizontal = false; health = mScript.waveNumber + 1; hasEnteredMansion = false; Debug.Log(health); attackRate = 120; calculateDoorway(); }
// Use this for initialization void Start() { gms = gameManager.GetComponent <gameManagerScript>(); img_weapon = GameObject.Find("img_weapon").GetComponent <Image>(); }
// Use this for initialization void Start() { gmc = GameObject.FindGameObjectWithTag ("GameController").GetComponent<gameManagerScript>(); }
// Use this for initialization void Start() { gameManagerScriptRef = GameObject.Find ("gameManager").GetComponent<gameManagerScript> (); if (isLocalPlayer) gameManagerScriptRef.localPlayer = gameObject; }
void Awake() { sInstance = this; }
public void Start() { gameManager = GameObject.Find("GameManager").gameObject.GetComponent <gameManagerScript>(); }
// Use this for initialization void Start() { gameManagerScript = GameObject.Find ("gameManager").GetComponent<gameManagerScript> (); }
//public float boxOffset=0.22f; // Use this for initialization void Start() { hideAllWalls (); //fov [0] = new Vector2 (2, 2); gameManagerScript = GameObject.Find ("gameManager").GetComponent<gameManagerScript> (); //gameManagerScript.gridContents [(int)gameObject.transform.position.x, (int)gameObject.transform.position.y] = gameObject; gameManagerScript.squadMembers[(int)transform.position.x-2]=gameObject; for(int j=0;j<2;j++){ for(int i=0;i<7;i++){ fovX[i+(j*7)] = (int) gameObject.transform.position.x-3+i; fovY[i+(j*7)] = (int) gameObject.transform.position.y+j; } } for (int i=0; i<5; i++) { fovX [i +14] = (int)gameObject.transform.position.x - 2 + i; fovY [i + 14] = (int)gameObject.transform.position.y+2; } for (int i=0; i<3; i++) { fovX [i +19] = (int)gameObject.transform.position.x - 1 + i; fovY [i + 19] = (int)gameObject.transform.position.y+3; } for (int i=0; i<22; i++){ visibleTiles[i] = (GameObject) Instantiate (fovPrefab, new Vector3(fovX [i], fovY [i], 0), Quaternion.identity); //visibleTiles[i] = visibleTile; visibleTiles[i].transform.SetParent(gameObject.transform); } // checkOOB(); hideAllVisibilityTiles (); //updateFOVUp (); }
void Awake() { gameManager = GameObject.FindGameObjectWithTag("GameManager"); managerScript = gameManager.GetComponent <gameManagerScript>(); }
void Awake() { playerActionControl = new TwoPlayerActionControl(); gameManager = FindObjectOfType <gameManagerScript>(); anim = GetComponent <Animator>(); }
void Start() { manager = GameObject.Find("gameManager").GetComponent <gameManagerScript>(); manager.cores.Add(this.gameObject); health = 50; }