void Update() { if (cameraOptions == null) { cameraOptions = this; } if (blackScrn != null) { fade_timer = fading ? fade_timer -= Time.deltaTime : fade_timer += Time.deltaTime; blackScrn.color = Color.Lerp(Color.black, Color.clear, fade_timer); if (fade_timer < 0 || fade_timer > 1) { fading = false; } } if (target != null) { if (timeMove < speed) { timeMove = +Time.deltaTime; float s = timeMove / speed; transform.position = Vector2.Lerp(transform.position, new Vector2(Mathf.Clamp(target.transform.position.x, minCameraBoundaries.x, maxCameraBoundaries.x), Mathf.Clamp(target.transform.position.y, minCameraBoundaries.y, maxCameraBoundaries.y)), s * 5.5f); } } //= new Vector2(Mathf.Clamp(target.transform.position.x, minCameraBoundaries.x, maxCameraBoundaries.x), Mathf.Clamp(target.transform.position.y, minCameraBoundaries.y, maxCameraBoundaries.y)); }
void Awake() { movement = pc.GetComponent <CharacterMotor> (); message = text.GetComponent <uiSystem> (); cam = holder.GetComponent <cameraScript> (); menu = holder.GetComponent <menuScript> (); }
// Start is called before the first frame update void Start() { rb = Rolling_Panel.GetComponent <Rigidbody>(); rb.maxAngularVelocity = 100f; main_camera = GameObject.Find("Main Camera"); cameraScript = main_camera.GetComponent <cameraScript>(); }
// Use this for initialization void Start() { targets = GameObject.FindGameObjectsWithTag("blue"); cam = GameObject.Find("Main Camera").GetComponent <cameraScript>(); camZLook = GameObject.Find("cameraZLook").GetComponent <cameraZLookScript>(); visualJoyStick = GameObject.Find("visualJoyStick").GetComponent <visualJoyStick>(); player = GameObject.Find("player").GetComponent <biology>(); cam.setTarget(player.transform); camZLook.setFollowTarget(player.transform); }
void Awake() { // Variables to hold the scripts on other game objects so that we can manipulate them from this script mouse = pc.GetComponent <MouseLook> (); movement = pc.GetComponent <CharacterMotor> (); cam = Camera.main.GetComponent <MouseLook> (); talk = pc.GetComponent <playerScript> (); menu = holder.GetComponent <menuScript> (); inventory = holder.GetComponent <cameraScript> (); message = text.GetComponent <uiSystem> (); }
// Use this for initialization void Start() { myText = GameObject.Find("Text").GetComponent <textScript>(); myCamera = GameObject.Find("Main Camera").GetComponent <cameraScript>(); blocks = new GameObject[transform.childCount]; for (int i = 0; i < transform.childCount; i++) { blocks[i] = transform.GetChild(i).gameObject; } blockCount = blocks.Length; spawnBlock(); }
void Awake() { player = PC.GetComponent <playerScript> (); inv = holder.GetComponent <cameraScript> (); m = holder.GetComponent <menuScript> (); //badge = maria.GetComponent <mariaBehavior> (); if (Application.loadedLevel == 1) { key = npc.GetComponent <securityBehavior> (); badge = picture.GetComponent <pictureScript> (); } }
// Use this for initialization void Awake() { cameraBoundary = 9; initPosition = transform.position; if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
void Start() { PrimeCamera = Camera.main.gameObject; cameraScripti = PrimeCamera.GetComponent <cameraScript>(); Debug.Log("unit count " + units.Count); toimintolista = new int[128, 3]; SortList(); foreach (GameObject unit in units) { targets.Add(unit.transform); } }
//private pictureScript pic; void Awake() { // Variables to hold the scripts on other game objects so that we can manipulate them from this script mouse = pc.GetComponent <MouseLook> (); //movement = pc.GetComponent <CharacterMotor> (); cam = Camera.main.GetComponent <MouseLook> (); inventory = this.GetComponent <cameraScript> (); message = text.GetComponent <uiSystem> (); cursor = gui.GetComponent <guiSystem> (); //pic = picture.GetComponent <pictureScript> (); if (Application.loadedLevel == 3) { talk = SH.GetComponent <playerScript> (); } else { talk = pc.GetComponent <playerScript> (); } }
void Start() { gameObject.name = objectName; camScript = GetComponent <cameraScript>(); if (gameObject.name == "Blue_Player") { attackSide = "Enemy"; allySide = "Friendly"; camScript.cam.cullingMask |= 1 << 9; } else { allySide = "Enemy"; attackSide = "Friendly"; camScript.cam.cullingMask |= 1 << 10; transform.Rotate(0, 180, 0); transform.position = new Vector3(45, transform.position.y, 45); } foreach (GameObject go in GameObject.FindGameObjectsWithTag(allySide)) { troops.Add(go.GetComponent <TroopClass>()); } }
// OVERLOAD: Applies the command method to every element of the troopList. ONLY for List<TroopClass> public static void IterateAll(List <TroopClass> troopList, SelectCommand command, cameraScript cam) { if (cam == null) { return; } Vector3 corner1 = cam.selectedStartPoint; Vector3 corner2 = cam.selectedEndPoint; for (int i = 0; i < troopList.Count; i++) { command(troopList[i], corner1, corner2); } }
void Awake() { if (cam == null) { cam = this; } }
private void Start() { en = GetComponent <cameraScript>(); }
void Start() { gameManager = GameObject.FindGameObjectWithTag("Game manager"); cameraScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <cameraScript>(); }
void Awake(){ //player = gameObject.GetComponent<playerC>(); cameraS = GameObject.Find ("mainCamera").GetComponent<cameraScript> (); }
// Use this for initialization void Start () { if (MainCamera != null) { CameraSc = MainCamera.GetComponent<cameraScript> (); } }
void Awake() { // Variables to hold the scripts on other game objects so that we can manipulate them from this script cam = holder.GetComponent <cameraScript> (); //chosen = holder.GetComponent <timeChanger> (); menu = holder.GetComponent <menuScript> (); message = text.GetComponent <uiSystem> (); mouse = pc.GetComponent <MouseLook> (); look = Camera.main.GetComponent <MouseLook> (); movement = pc.GetComponent <CharacterMotor> (); info = this.GetComponent <displayInfo> (); talk = pc.GetComponent <playerScript> (); pic = picture.GetComponent <pictureScript> (); cursor = gui.GetComponent <guiSystem> (); }
void Start() { createPlatform(); startItem(); GAME_RUNNING = true; cameraScriptInst = (cameraScript)FindObjectOfType(typeof(cameraScript)); gameGUIinst = (gameGUIManager)FindObjectOfType(typeof(gameGUIManager)); }
void Awake() { // Variables to hold the scripts on other game objects so that we can manipulate them from this script cam = holder.GetComponent <cameraScript> (); //chosen = holder.GetComponent <timeChanger> (); menu = holder.GetComponent <menuScript> (); message = text.GetComponent <uiSystem> (); mouse = this.GetComponent <MouseLook> (); look = Camera.main.GetComponent <MouseLook> (); movement = this.GetComponent <CharacterMotor> (); talk = this.GetComponent <playerScript> (); core = Core.GetComponent <displayInfo> (); daphne = Daphne.GetComponent <displayInfo> (); ic = Core.GetComponent <icScript> (); scepter = scepterBroken.GetComponent <displayInfo> (); okScepter = Scepter.GetComponent <displayInfo> (); cursor = gui.GetComponent <guiSystem> (); }