// Use this for initialization void Start() { TotalCoinsText.text = PlayerPrefs.GetInt("TotalCoins").ToString(); cameraScroll = cam.GetComponent <CameraScroll>(); pauseLevel = UIManager.GetComponent <PauseLevel>(); timerScript = UIManager.GetComponent <TimerScript>(); //advertismentScript = UIManager.GetComponent<AdvertisementScript>(); muteAudio = UIManager.GetComponent <MuteAudio>(); levelCharacteristics = UIManager.GetComponent <LevelCharacteristics>(); if (levelCharacteristics.isGravitySwitch) { jumpDirection = Vector2.left; levelCharacteristics.GravitySwitch(); } coinArray = GameObject.FindGameObjectsWithTag("Coin"); coinListLength = coinArray.Length; for (int x = 0; x < coinListLength; x++) { coinList.Add(coinArray[x]); } playerPosition = player.transform.position; camPosition = cam.transform.position; music.Pause(); }
public override void Dispose() { UnitDrawDistance.ValueChanged -= UnitDrawDistanceChanged; ProjectileDrawDistance.ValueChanged -= ProjectileDrawDistanceChanged; TerrainDrawDistance.ValueChanged -= TerrainDrawDistanceChanged; CameraScroll.ValueChanged -= CameraScrollChanged; CameraRotation.ValueChanged -= CameraRotationChanged; MouseCamRotation.ValueChanged -= MouseCamRotationChanged; ZoomSpeed.ValueChanged -= ZoomSpeedChanged; Resolutions.ItemSelected -= ResolutionSelected; WindowTypes.ItemSelected -= WindowTypeSelected; HighDPI.Toggled -= HighDPIToggled; TripleBuffer.Toggled -= TripleBufferToggled; VSync.Toggled -= VSyncToggled; DebugHUD.Toggled -= DebugHUDToggled; BorderMovement.Toggled -= BorderMovementToggled; PathFindingVisualization.ItemSelected -= PathFindingVisualizationSelected; UnitDrawDistance.Dispose(); ProjectileDrawDistance.Dispose(); TerrainDrawDistance.Dispose(); CameraScroll.Dispose(); CameraRotation.Dispose(); MouseCamRotation.Dispose(); ZoomSpeed.Dispose(); window.RemoveAllChildren(); window.Remove(); window.Dispose(); }
//Vector3 posOnScreen; private void Start() { cameraScroller = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraScroll>(); gm = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManagerScript>(); rb = GetComponent <Rigidbody>(); bounds = GetComponent <BoundsManager>(); }
void Update() { swipe = null; if (Input.GetMouseButtonDown(0)) { down = true; start = Camera.main.ScreenToWorldPoint(Input.mousePosition); } if (Input.GetMouseButtonUp(0)) { down = false; timer = 0f; end = Camera.main.ScreenToWorldPoint(Input.mousePosition); SceneChanger sc = GameObject.FindGameObjectWithTag("UI")?.GetComponent <SceneChanger>(); CameraScroll cs = GameObject.FindGameObjectWithTag("MainCamera")?.GetComponent <CameraScroll>(); if (timer < maxDuration && (end - start).magnitude > 0.1f && (sc == null || !sc.openUI) && (cs == null || !cs.scrolling)) { swipe = new Swipe(start, end); } } // keep track of swipe duration if (down) { timer += Time.deltaTime; } }
CameraScroll cameraScrollInit() { cameraScroll = new CameraScroll(); cameraScroll.SetMouse(Mouse); cameraScroll.SetCameraMovementController(this); return(cameraScroll); }
void Start() { scrollRef = Camera.main.GetComponent <CameraScroll>(); finger1GO = GameObject.FindGameObjectWithTag("Finger1"); finger2GO = GameObject.FindGameObjectWithTag("Finger2"); finger1GO.SetActive(false); finger2GO.SetActive(false); }
private void Awake() { if (instance != null) { Destroy(gameObject); Debug.LogError("Duplicate instances of '" + this.GetType().ToString() + "'. Bug?"); } else { instance = this; } }
public void trigger() { CameraScroll cam = Camera.main.GetComponent <CameraScroll>(); cam.lockCamera(); center = cam.endPos; _player = FindObjectOfType <PhysicalPlayerController>(); cam.move(_player.tf, new Vector2(0.2f, 0.2f), 1.5f); common.TimerManager.instance.addEventListeners(this); closerTrigger(); }
void Start() { Rigidbody rb = GetComponent <Rigidbody>(); if (rb) { rb.freezeRotation = true; } originalRotation = transform.localRotation; CameraStrollInstance = GetComponent <CameraScroll>(); }
void Start() { ScreenWidth = Screen.width; ScreenHeight = Screen.height; GamePlaneBounds = GameObject.Find("Plane").GetComponent <PlaneBoundry>().GamePlaneBounds; CameraOrthographicSize = ScrollWheelLimit.y / 6; Mouse = GetComponent <MouseBoundry>(); cameraMovement = cameraMovementInit(); cameraScroll = cameraScrollInit(); }
public void trigger() { a = 1.5f * initSpeedX; delta.x = -initSpeedX; delta.y = -initspeedY; CameraScroll cam = Camera.main.GetComponent <CameraScroll>(); cam.lockCamera(); _player = FindObjectOfType <PhysicalPlayerController>(); cam.move(_player.tf, new Vector2(0.2f, 0.2f), 1.5f); common.TimerManager.instance.addEventListeners(this); closerTrigger(); }
void Start() { cam = Camera.main.GetComponent <CameraScroll>(); if (ani != null) { CharacterAnimation newAni = tf.gameObject.AddComponent <CharacterAnimation>(); newAni.copy(ani); ani = newAni; ani.addSprToDic(); } rb.gravityScale = 0; Setting s = GlobalController.instance.setting; if (GlobalController.instance.curScene.underWater) { _gravityScale = 0; _upSpeed = s.waterUpSpeed; _moveSpeed = s.waterMoveSpeed; jumpHandler = waterUpHandler; } else { _gravityScale = s.playerG / s.g; _upSpeed = s.smallUpSpeed; _moveSpeed = s.moveSpeed; jumpHandler = spaceJumpHandler; } col = tf.GetComponent <BoxCollider2D>(); col.size = s.roleColliderSize; col.offset = new Vector2(0, col.size.y * 0.5f); height = col.size.y * 0.9f; reboundReleaseDelay = new WaitForSeconds(s.reboundProtectTime); ani.play(Config.CharcterAction.Idle); _lockPosture = true; initScaleX = Mathf.Abs(transform.lossyScale.x); _lastPostion = tf.position; bulletData = new BulletData(); bulletData.speed = GlobalController.instance.setting.bigUpSpeed; AwakeManager.instance.addEventListener(this); }
// Use this for initialization void Start() { if (GlobalState.SharedPassQuest != 1) { base.mobile = InitMobileGUI.InitMobileGUIObject(false); } else { base.mobile = InitMobileGUI.InitMobileGUIObject(true); CameraScroll cam = sceneCamera.GetComponent <CameraScroll>(); cam.scroll_min = minScroll; cam.scroll_max = maxScroll; sceneCamera.transform.localPosition = new Vector3(x, y, sceneCamera.transform.localPosition.z); } }
// Use this for initialization void Start() { Vector3 angles = transform.eulerAngles; x = angles.y; y = angles.x; rigidbody = GetComponent <Rigidbody>(); // Make the rigid body not change rotation if (rigidbody != null) { rigidbody.freezeRotation = true; } CameraStrollInstance = MainCamera.GetComponent <CameraScroll>(); }
/// <summary> /// move the camera /// </summary> private void moveCamera() { CameraScroll cam = sceneCamera.GetComponent <CameraScroll>(); cam.scroll_min = minScroll; cam.scroll_max = maxScroll; sceneCamera.transform.localPosition = new Vector3(x, y, sceneCamera.transform.localPosition.z); if (throwMyDialog) { ThrowDialog t = this.gameObject.GetComponent <ThrowDialog>(); if (t) { t.ThrowDialogNow(); } } }
void Start() { BannerText = GameObject.Find("TextWarining"); Mcam = GameObject.Find("MapCamera"); Scam = GameObject.Find("ShipCamera"); Ecam = GameObject.Find("SearchCamera"); Acam = GameObject.Find("AnomalyCamera"); cameraScroll = Mcam.GetComponent <CameraScroll>(); PlayerAsteroids = GameObject.Find("PlayerAsteroids"); PlayerSearch = GameObject.Find("PlayerSearch"); Adgc = GameObject.Find("AGameController").GetComponent <Done_GameController>(); Sdgc = GameObject.Find("SgameController").GetComponent <SgameController>(); ReturnToSpace(); Search(); }
// Use this for initialization void Start() { prefabs = Resources.LoadAll <GameObject>("Prefabs"); cameraScroll = Camera.main.GetComponent <CameraScroll>(); levelGeneratorPlatform = environment01.GetComponent <LevelGeneratorPlatform>(); }
// Use this for initialization void Start() { cameraScroll = cam.GetComponent <CameraScroll>(); pauseLevel = UIManager.GetComponent <PauseLevel>(); }
void Awake() { main = this; }
void Awake() { main = this; currentVelocity = defaultVelocity; transform.rotation = Quaternion.Euler(pitch, yaw, 0); }
// Use this for initialization void Start() { cameraScroll = FindObjectOfType <CameraScroll>(); }
private void Start() { cameraSpeed = GetComponentInParent <CameraScroll>(); }
// Use this for initialization void Start() { cameraScroll = cam.GetComponent <CameraScroll>(); music = player.GetComponent <AudioSource>(); playerScript = player.GetComponent <PlayerScript>(); }
void LoadGUI(Scene scene, LoadSceneMode mode) { cameraScroll = GameObject.Find("Main Camera").GetComponent <CameraScroll>(); DialogController = GameObject.Find("DialogController"); MagicMeter = GameObject.Find("MagicMeter").GetComponent <MagicMeter>(); }
void Awake() { example = this; }