public BucketPage(MainCamera camera, KiiGroup group, string bucketName) : base(camera) { this.group = group; this.bucketName = bucketName; this.bucket = group.Bucket(bucketName); }
// Private Functions // Awake(): is called at the start of the program void Awake() { // Singleton if (m_Instance == null) m_Instance = this; else Destroy(this.gameObject); }
private MainCamera Camera_SetUp() { camera = MainCamera.m_MainCamera; camera.SetTransfromControl(this); camera.SetCameraControl(this); camera.SetScreenCenter(new Vector2(0, 0)); camera.SetDefaultDeadZone(); return camera; }
private void OnEnable() { // Set Up Camera controller = MainCamera.m_MainCamera; controller.SetMoveControl(this); controller.SetTransfromControl(this); controller.SetCameraControl(this); controller.SetScreenCenter(new Vector2(Screen.width / 2, Screen.height / 2)); controller.SetDefaultDeadZone(); m_transform = this.GetComponent<Transform>(); m_camera = this.GetComponentInChildren<Camera>(); }
bool GetDragPos_Plane(out Vector3 pos) { pos = Vector3.zero; if (xdragging && ydragging) { Ray ray = MainCamera.ScreenPointToRay(mousePosition); Plane p = new Plane(GizmoGroup.forward, begin_tar_pos); float enter = 0; if (p.Raycast(ray, out enter)) { pos = ray.GetPoint(enter); return(true); } } else if (ydragging && zdragging) { Ray ray = MainCamera.ScreenPointToRay(mousePosition); Plane p = new Plane(GizmoGroup.right, begin_tar_pos); float enter = 0; if (p.Raycast(ray, out enter)) { pos = ray.GetPoint(enter); return(true); } } else if (zdragging && xdragging) { Ray ray = MainCamera.ScreenPointToRay(mousePosition); Plane p = new Plane(GizmoGroup.up, begin_tar_pos); float enter = 0; if (p.Raycast(ray, out enter)) { pos = ray.GetPoint(enter); return(true); } } return(false); }
/// <summary> /// 对设置摄像头方向进行旋转 /// </summary> public static void SetCameraRotation(DisplayOrientations orientations) { var cameraRotation = VideoRotation.None; switch (orientations) { case DisplayOrientations.Landscape: cameraRotation = VideoRotation.None; break; case DisplayOrientations.Portrait: cameraRotation = ReversePreviewRotation == true ? VideoRotation.Clockwise270Degrees : VideoRotation.Clockwise90Degrees; break; case DisplayOrientations.LandscapeFlipped: cameraRotation = VideoRotation.Clockwise180Degrees; break; case DisplayOrientations.PortraitFlipped: cameraRotation = ReversePreviewRotation == true ? VideoRotation.Clockwise90Degrees : VideoRotation.Clockwise270Degrees; break; default: cameraRotation = VideoRotation.None; break; } try { LogHelper.AddString(cameraRotation.ToString()); MainCamera.SetPreviewRotation(cameraRotation); } catch (Exception ex) { } try { //MainCamera.SetRecordRotation(cameraRotation); } catch (Exception ex) { } }
void Awake() { if (instance != null && instance != this) { Destroy(gameObject); return; } else { instance = this; } DontDestroyOnLoad(gameObject); bgColor.r = Random.value; bgColor.g = Random.value; bgColor.b = Random.value; bgColor.a = Random.value; var camera = GetComponent <Camera>(); camera.backgroundColor = bgColor; }
protected void Update() { if (!paused) { //update the collider position pos = (Vector2)transform.position + offset; bounds = new Rect(pos.x + area.x, pos.y + area.y, area.width, area.height); if (Items.Count > slotNum) { //set the width targetWidth = bounds.Contains((Vector2)MainCamera.GetComponent <Camera>().ScreenToWorldPoint(Input.mousePosition)) ? maxWidth : hiddenWidth; } else { targetWidth = 0.0f; } render.size = new Vector2(Mathf.Lerp(render.size.x, targetWidth, 0.3f), render.size.y); underlayRender.size = render.size; } }
private void Update() { if (MainCamera.ScreenPointRaycast(GameInput.position, out hitInfo, 1 << layer)) { if (GameInput.BeginTouch()) { Draggable drag = hitInfo.collider.GetComponent <Draggable>(); if (drag) { dragStart = hitInfo.point; joint = gameObject.AddComponent <ConfigurableJoint>(); joint.xMotion = ConfigurableJointMotion.Locked; joint.yMotion = ConfigurableJointMotion.Locked; joint.zMotion = ConfigurableJointMotion.Locked; joint.connectedBody = drag.rigid; } } } if (GameInput.EndTouch()) { Destroy(joint); } }
protected virtual void Update() { if (menuPaused || !requiresPause) { OnActive(); //update the collider position pos = (Vector2)transform.position + offset; bounds = new Rect(pos.x + area.x, pos.y + area.y, area.width, area.height); //check if the mouse is withing the collider space if ((!JoystickMouse.Active && bounds.Contains((Vector2)MainCamera.GetComponent <Camera>().ScreenToWorldPoint(Input.mousePosition))) || (JoystickMouse.Active && bounds.Contains(JoystickMouse.Pos))) { OnEnter(); //check if clicking (left mouse button) if (Input.GetMouseButtonDown(0) || Input.GetButtonDown("Interact")) { audioPlayer.PlaySound(0); OnClick(); } } } }
// Mouse click selection // Mouse click checking void CheckMouseClick() { if (Input.GetMouseButtonDown(0)) { // Debug.Log("Mouse is down"); RaycastHit hitInfo = new RaycastHit(); // Note: mTarget is in a layer not rayCast!! bool hit = Physics.Raycast(MainCamera.ScreenPointToRay(Input.mousePosition), out hitInfo, Mathf.Infinity, 1); // 1 is the mask for default layer if (hit) { TheWorld.SelectObjectAt(hitInfo.transform.gameObject, hitInfo.point); // Main controller SHOULD NOT know anything about what // user wants to do with mouse click } else { Debug.Log("No hit"); } } }
protected override void Awake() { base.Awake(); //find the physics object somewhere in the hierarchy of object myPhysObj = GetComponent <PhysicsObject>(); if (myPhysObj == null) { myPhysObj = GetComponentInParent <PhysicsObject>(); } if (myPhysObj == null) { myPhysObj = GetComponentInChildren <PhysicsObject>(); } if (!dialogueBox) { dialogueBox = MainCamera.GetComponentInChildren <DialogueBox>(); Debug.Log(gameObject.name + "'s dialogue trigger needs manual assignment"); } dialogueBox.GetComponent <TextboxEvent>().AddEvTrig(this); }
protected override void Start() { base.Start(); m_Animator = GetComponent <Animator>(); m_PlayerController = GetComponent <PlayerController>(); m_WeaponController = GetComponent <WeaponController>(); // Get the camera follow component and set its target to the transform of the player m_CameraFollow = MainCamera.GetComponent <CameraFollow>(); m_CameraFollow.SetTarget(transform); // Find the player health bar and damage image objects m_PlayerHealthBar = GameObject.Find("PlayerHealthBar").GetComponent <Image>(); m_DamageImage = GameObject.Find("DamageImage").GetComponent <Image>(); m_CurrentHealth = m_MaxHealth; m_PlayerHealthBarText = m_PlayerHealthBar.GetComponentInChildren <Text>(); UpdatePlayerHealthBar(); // Start the coroutine responsible for gradually regenerating health over time m_RegenerateHealthCoroutine = StartCoroutine(RegenerateHealth()); }
public static void CameraChange(string onCamera, string offCamera) { switch (onCamera) { case "Main": MainCamera.SetActive(true); break; case "Battle": BattleCamera.SetActive(true); break; } switch (offCamera) { case "Main": MainCamera.SetActive(false); break; case "Battle": BattleCamera.SetActive(false); break; } }
protected override void FireWeapon() { if (WeaponStats.BulletsInClip > 0 && !Reloading && !WeaponHolder.Controller.IsRunning) { base.FireWeapon(); if (!FiringEffect) { FiringEffect = Instantiate(FiringAnimation, ParticleSpawnLocation).GetComponent <ParticleSystem>();; } Ray screenRay = MainCamera.ScreenPointToRay(new Vector3(CrosshoarComponent.CurrentAimPosition.x, CrosshoarComponent.CurrentAimPosition.y, 0)); if (!Physics.Raycast(screenRay, out RaycastHit hit, WeaponStats.FireDistance, WeaponStats.WeaponHitLayer)) { return; } HitLocation = hit.point; TakeDamage(hit); Vector3 hitDirection = hit.point - MainCamera.transform.position; Debug.DrawRay(MainCamera.transform.position, hitDirection.normalized * WeaponStats.FireDistance, Color.red, 1.0f); } else if (WeaponStats.BulletsInClip <= 0) { if (!WeaponHolder) { return; } WeaponHolder.StartReloading(); } }
private void SetVantage(bool topDown, CameraFeel cameraFeel, bool reset, bool keepFocus, Vector3 focus) { MainCamera mainCamera = Service.Get <CameraManager>().MainCamera; float num = 200f; float num2 = -num; float num3 = -num; if (topDown) { num2 *= 0.6f; num3 *= 0.6f; } this.SetYToHypotenuse(Mathf.Sqrt(1f + (num2 * num2 + num3 * num3) / (num * num))); num = Mathf.Sqrt(3f * num * num - num2 * num2 - num3 * num3); if (!reset) { num2 += mainCamera.CurrentLookatAnchor.x; num3 += mainCamera.CurrentLookatAnchor.z; } mainCamera.AnchorCamera(new Vector3(num2, num, num3)); if (cameraFeel != CameraFeel.NoChange) { mainCamera.SetCameraFeel(cameraFeel); } if (reset) { mainCamera.AnchorLookat(Vector3.zero); } if (keepFocus) { mainCamera.KeepFocus(focus); } if (this.mapManipulator != null) { this.mapManipulator.OnVantageSwitch(topDown); } }
// Mouse click selection // Copied from: http://answers.unity3d.com/questions/411793/selecting-a-game-object-with-a-mouse-click-on-it.html void LMBSelect() { if (Input.GetMouseButtonDown(0)) { Debug.Log("Mouse is down"); RaycastHit hitInfo = new RaycastHit(); bool hit = Physics.Raycast(MainCamera.ScreenPointToRay(Input.mousePosition), out hitInfo); if (hit) { if (mSelectedObject != null) { SetSelectedColor(1f); } mSelectedObject = hitInfo.transform.gameObject; Debug.Log("Hit " + mSelectedObject.name); SetSelectedColor(0f); } else { Debug.Log("No hit"); } } }
void Start() { mainCamera = Camera.main.GetComponent <MainCamera>(); trackInfo = GetComponent <TrackInfo>(); if (onCarVizType == OnCarVizType.SuspensionTravel) { graphAnchor.SetActive(true); tractionCircleAnchor.SetActive(false); } else if (onCarVizType == OnCarVizType.TractionCircle) { graphAnchor.SetActive(false); tractionCircleAnchor.SetActive(true); } else { graphAnchor.SetActive(false); tractionCircleAnchor.SetActive(false); } FLPointer = FLCircle.transform.GetChild(0).GetComponent <LineRenderer>(); FRPointer = FRCircle.transform.GetChild(0).GetComponent <LineRenderer>(); RLPointer = RLCircle.transform.GetChild(0).GetComponent <LineRenderer>(); RRPointer = RRCircle.transform.GetChild(0).GetComponent <LineRenderer>(); FLDataPointsRoot = FLCircle.transform.parent.GetChild(1); FRDataPointsRoot = FRCircle.transform.parent.GetChild(1); RLDataPointsRoot = RLCircle.transform.parent.GetChild(1); RRDataPointsRoot = RRCircle.transform.parent.GetChild(1); FLTractionLine = FLDataPointsRoot.GetComponent <LineRenderer>(); FRTractionLine = FRDataPointsRoot.GetComponent <LineRenderer>(); RLTractionLine = RLDataPointsRoot.GetComponent <LineRenderer>(); RRTractionLine = RRDataPointsRoot.GetComponent <LineRenderer>(); }
protected override void FireWeapon() { //Debug.Log("Firing"); if (WeaponStats.BulletsInClip > 0 && !WeaponHolder.PlayerController.IsReloading && !WeaponHolder.PlayerController.IsRunning) { base.FireWeapon(); Ray screenRay = MainCamera.ScreenPointToRay(new Vector3(Crosshair.CurrentMousePosition.x, Crosshair.CurrentMousePosition.y, 0)); if (!Physics.Raycast(screenRay, out RaycastHit hit, WeaponStats.FireDistance, WeaponStats.WeaponHitLayer)) { return; } Entity hitEntity = hit.transform.GetComponent <Entity>(); if (hitEntity != null) { CombatManager.Attack(this.GetComponentInParent <Entity>(), hitEntity, this); } HitLocation = hit.point; Vector3 hitDirection = hit.point - MainCamera.transform.position; //Debug.DrawRay(MainCamera.transform.position, hitDirection * WeaponStats.FireDistance, Color.red); Debug.DrawLine(MainCamera.transform.position, HitLocation, Color.red, WeaponStats.FireRate); } else if (WeaponStats.BulletsInClip <= 0) { if (!WeaponHolder) { return; } WeaponHolder.StartReloading(); } }
private void StopStage() { if (_CurStage != MoveStage.NONE) { if (_CurStage != MoveStage.LOOKING_AT) { if (_CameraTrans) { _CameraTrans.DOKill(); } if (MainCamera != null) { MainCamera.DOKill(); } } if (MainCamera != null) { MainCamera.fieldOfView = _OriginalFOV; } _CurStage = MoveStage.NONE; } }
private bool CanSufferHitch() { if (this.IsGameReloading()) { return(true); } if (Service.Get <GameStateMachine>().CurrentState is ApplicationLoadState) { return(true); } WipeCamera wipeCamera = Service.Get <CameraManager>().WipeCamera; if (wipeCamera != null && wipeCamera.IsRendering()) { return(false); } if (Service.IsSet <WorldTransitioner>() && Service.Get <WorldTransitioner>().IsTransitioning()) { return(true); } MainCamera mainCamera = Service.Get <CameraManager>().MainCamera; return((mainCamera == null || (!mainCamera.IsStillMoving() && !mainCamera.IsStillRotating())) && (!Service.IsSet <UXController>() || Service.Get <UXController>().Intro == null) && (!Service.IsSet <UserInputManager>() || !Service.Get <UserInputManager>().IsPressed())); }
private void OnRest() { if (_pressedLayer == LayerMask.NameToLayer("GUI")) { //ignore the GUI layer return; } /* else if (_pressedLayer == BuildingManager3D.SELECTION_LAYER) * { * if (selectedObject != null) * { * selectedObject.SendMessage("OnDragEvent", Vector3.zero, SendMessageOptions.DontRequireReceiver); * } * else * { * MainCamera.GetInstance().Drag(Vector2.zero); * } * } */ else { MainCamera.GetInstance().Drag(Vector2.zero); } }
public ObjectBodyPage(MainCamera camera, KiiObject obj) : base(camera) { this.obj = obj; this.body = ""; this.upBodyContentType = ""; this.expireIn = ""; DateTime now = DateTime.Now; this.expireAtYear = "" + now.Year; this.expireAtMonth = "" + now.Month; this.expireAtDay = "" + now.Day; this.expireAtHour = "" + now.Hour; this.expireAtMinute = "" + now.Minute; this.expireAtSecond = "" + now.Second; }
public static void setMainCamer(MainCamera mainCamera) { GameManager.mainCamera = mainCamera; }
// Update is called once per frame void Update() { // Move Left if (Input.GetKeyDown(KeyCode.LeftArrow) || (touchManage.swipeL == true)) //GetKeyDown // Modify position { transform.position += moveVec3("LeftArrow"); // See if valid if (isValidGridPos()) { // Its valid. Update grid. updateGrid((int)transform.position.x, (int)transform.position.z); } else { // Its not valid. revert. transform.position -= moveVec3("LeftArrow"); } GameObject.FindGameObjectWithTag("TouchManager").GetComponent <touchManage> ().reset(); } // Move Right else if (Input.GetKeyDown(KeyCode.RightArrow) || (touchManage.swipeR == true)) { // Modify position transform.position += moveVec3("RightArrow"); // See if valid if (isValidGridPos()) { // It's valid. Update grid. updateGrid((int)transform.position.x, (int)transform.position.z); } else { // It's not valid. revert. transform.position -= moveVec3("RightArrow"); } GameObject.FindGameObjectWithTag("TouchManager").GetComponent <touchManage> ().reset(); } // Rotate else if ((Input.GetKeyDown(KeyCode.A)) || (Input.GetKeyDown(KeyCode.S)) || (touchManage.touch == true)) { if (Input.GetKeyDown(KeyCode.A)) { transform.Rotate(0, 0, 90); } else { transform.Rotate(0, 0, -90); } // See if valid if (isValidGridPos()) { // It's valid. Update grid. updateGrid((int)transform.position.x, (int)transform.position.z); } else { // Move left transform.position += moveVec3("LeftArrow"); if (isValidGridPos()) { updateGrid((int)transform.position.x, (int)transform.position.z); } else { transform.position -= moveVec3("LeftArrow"); // Move Right transform.position += moveVec3("RightArrow"); if (isValidGridPos()) { updateGrid((int)transform.position.x, (int)transform.position.z); } else { transform.position -= moveVec3("RightArrow"); // Move left transform.position += moveVec3("LeftArrow"); transform.position += moveVec3("LeftArrow"); if (isValidGridPos()) { updateGrid((int)transform.position.x, (int)transform.position.z); } else { transform.position -= moveVec3("LeftArrow"); transform.position -= moveVec3("LeftArrow"); // Move Right transform.position += moveVec3("RightArrow"); transform.position += moveVec3("RightArrow"); if (isValidGridPos()) { updateGrid((int)transform.position.x, (int)transform.position.z); } else { // It's not valid. revert. transform.position -= moveVec3("RightArrow"); transform.position -= moveVec3("RightArrow"); if (Input.GetKeyDown(KeyCode.A)) { transform.Rotate(0, 0, -90); } else { transform.Rotate(0, 0, 90); } } } } } } GameObject.FindGameObjectWithTag("TouchManager").GetComponent <touchManage> ().reset(); } // Move Downwards and Fall else if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.UpArrow) || FallManager.fallblock() == true || (touchManage.swipeD == true)) { if (Input.GetKeyDown(KeyCode.UpArrow)) { down_count = Grid.h; } else { down_count = 1; } for (int i = 0; i < down_count; i++) { // Modify position transform.position += new Vector3(0, -1, 0); // See if valid if (isValidGridPos()) { // It's valid. Update grid. updateGrid((int)transform.position.x, (int)transform.position.z); GameObject.FindGameObjectWithTag("TouchManager").GetComponent <touchManage> ().reset(); } else { // It's not valid. revert. transform.position += new Vector3(0, 1, 0); fall_cnt++; if (fall_cnt == 2) { sound.PlayOneShot(sound.clip); // Clear filled horizontal lines Grid.deleteFullRows(); count++; if (count == 7) { MainCamera.Rotate(); count = 0; } // Spawn next Group GameObject.FindGameObjectWithTag("Spawner").GetComponent <Spawner> ().spawnNext(NextBlock.nextGroupIdx); //GameObject.FindGameObjectWithTag ("Spawner").GetComponent<Spawner> ().spawnNext (0); GameObject.FindGameObjectWithTag("NextBlock").GetComponent <NextBlock> ().changeNextBlock(); Grid.deleteFullRows(); //回転後に消えていたら消す GameObject.FindGameObjectWithTag("TouchManager").GetComponent <touchManage> ().reset(); fall_cnt = 0; // Disable script enabled = false; break; } else { //無処理 } } FallManager.setLastfall(); } } }
void StartPreview(Vector2 touchPos) { activePreview = previewPool.GetNextAvailable(MainCamera.ScreenToWorldPoint(touchPos)); UpdateColor(activePreview); }
void Awake() { // MainCamera를 찾음 MainCam = GameObject.Find("MainCamera").GetComponent<MainCamera>(); }
public virtual void Start() { if (!GameObject.Find("[SaveModule]")) { var prefab = Resources.Load("[SaveModule]") as GameObject; Instantiate(prefab).GetComponent <SaveDataModule>(); } _camerarig = GameObject.Find("[CameraRig]").transform; MainCamera = _camerarig.Find("Camera (eye)"); if (MainCamera == null) { MainCamera = _camerarig.Find("Camera (head)").Find("Camera (eye)"); } VRDesk = MainCamera.Find("VRDesk"); VRWall = MainCamera.Find("VRWall"); var _gazeTrailGameObject = GameObject.Find("[VRGazeTrail]"); if (_gazeTrailGameObject != null) { gazeTrailGameObject = _gazeTrailGameObject; } SaveDataModule.Instance.WriteToTimeLine("==============================Keyboard Started=============================="); CreateMainKeys(); SetProperties(); LayoutKeys(); if (touchHandler != null) { touchHandler.TouchDataReceivedEvent += Pointer_PointerDataReceivedEvent; } if (_camerarig != null) { leftTrackpadHandler = _camerarig.transform.Find("Controller (left)").GetComponent <ViveTrackpad>(); } if (_camerarig != null) { rightTrackpadHandler = _camerarig.transform.Find("Controller (right)").GetComponent <ViveTrackpad>(); } if (leftTrackpadHandler != null) { leftTrackpadHandler.ViveDataReceived += ViveHandler_ViveDataReceived; } if (rightTrackpadHandler != null) { rightTrackpadHandler.ViveDataReceived += ViveHandler_ViveDataReceived; } _eyeTracker = VREyeTracker.Instance; _calibrationObject = VRCalibration.Instance; //transform.position = new Vector3( // Camera.main.transform.position.x, // Camera.main.transform.position.y, // Camera.main.transform.position.z + keyboardDistanceFromCamera); transform.position = new Vector3(0, 0, MainCamera.position.z + keyboardDistanceFromCamera); //transform.parent = MainCamera; //transform.localPosition = new Vector3(0, 0, keyboardDistanceFromCamera); FindTextArea(); //AddManipulationPoints(); }
public GroupMenuPage(MainCamera camera, KiiGroup group) : base(camera) { this.currentGroup = group; this.newName = group.Name; }
void Start() { mainCamera = Camera.main.GetComponent <MainCamera>(); }
public ObjectPage(MainCamera camera, KiiObject obj) : base(camera) { this.obj = obj; }
// Use this for initialization void Start() { myState = iDungIm; myBody2d = this.rigidbody2D; myAnimator = GetComponent<Animator> (); mainCamera = FindObjectOfType<MainCamera>(); ObGameOver = FindObjectOfType<GameOver>(); Time.timeScale = 1; }
public GroupPage(MainCamera camera) : base(camera) { }
public UserPage(MainCamera camera) : base(camera) { }
void Awake() { instance = this; animator = GetComponent <Animator>(); Screen.sleepTimeout = SleepTimeout.NeverSleep; }
//public GoogleAnalyticsV3 googleAnalytics; void Awake() { instance = this; }
void Start() { gameWorld = GameWorld.Instance; mainCamera = MainCamera.Instance; }
// Use this for initialization void Start() { _maincamera = GameObject.Find("Main Camera").GetComponent <MainCamera>(); enemyHPBar = GameObject.Find("enemyHPSlider").GetComponent <Slider>(); }
// Use this for initialization void Awake() { WhirlwindItem.InitializeItemSprites(); currentState = State.Idle; userInputTimer = new Timer(60f); draggedSearchItem = null; // establish enlarge and fullscreen game objects mainCamera = GameObject.Find("Main Camera").GetComponent<MainCamera>(); searchUI = GameObject.Find("SearchUI"); searchBar = GameObject.Find("SearchBar").GetComponent<SearchBar>(); enlargedSelectionUI = GameObject.Find("EnlargedSelectionUI"); enlargedSelectionUI.GetComponent<Canvas>().enabled = false; fullscreenSelectionUI = GameObject.Find("FullscreenSelectionUI"); fullscreenSelectionUI.GetComponent<Canvas>().enabled = false; // get the belts GameObject[] gl = GameObject.FindGameObjectsWithTag("WhirlwindBelt"); belts = new WhirlwindBelt[gl.Length]; for (int i = 0; i < gl.Length; i++) { belts[i] = gl[i].GetComponent<WhirlwindBelt>(); } Array.Sort(belts, delegate(WhirlwindBelt b1, WhirlwindBelt b2) { return b2.level.CompareTo(b1.level); }); // Log into the database databaseManager = GameObject.Find("DatabaseManager").GetComponent<DatabaseManager>(); databaseManager.Login(); //create the default whirlwind defaultBookinfos = databaseManager.GetDefaultBookInfos(belts.Length); }
private void Start() { mainCameraComponent = this.GetComponent <MainCamera>(); }
public BasePage(MainCamera camera) { this.camera = camera; this.buttonStyle.fontSize = 32; }
public MainCamera() { current = this; }
private void Spawn() { if (PrefabsToSpawn == null || PrefabsToSpawn.Length == 0) { Debug.LogWarning("No prefabs to spawn from " + gameObject.name + "!!"); return; } var spawnPos = UseSpawnerParent ? transform.localPosition : transform.position; _spawnObject = Instantiate(PrefabsToSpawn[_prefabIndex], spawnPos, PrefabsToSpawn[_prefabIndex].transform.rotation); _spawnObject.SetActive(true); // Increment or reset index if (_prefabIndex < PrefabsToSpawn.Length - 1) { _prefabIndex++; } else { _prefabIndex = 0; } _spawnCount++; // Destroy once well past camera bounds if (MainCamera.WorldToViewportPoint(transform.position).y < -1.2f) { Destroy(gameObject); } if (!MoveAfterSpawn) { Vector3 globalPos = MainCamera.transform.InverseTransformPoint(transform.position); globalPos.z = 0; transform.parent = null; transform.position = globalPos; MoveEnabled = false; SetupWaypoints(); } else { // Give spawn parent of spawner if enabled if (UseSpawnerParent) { _spawnObject.transform.SetParent(transform.parent, false); } } if (_spawnCount >= SpawnRepeatCount) { // Replace sprite? if (SpriteAfterSpawn != null) { GetComponent <SpriteRenderer>().sprite = SpriteAfterSpawn; _spriteReplaced = true; } CancelInvoke(); Destroy(gameObject); } }
public static void startListen() { SoundsControl.playAudio(MainCamera.GetComponent <PrefebCollector>().vocalstart); VocalListener.StartRecording(); }
public TitlePage(MainCamera camera) { this.camera = camera; }
// Use this for initialization void Start() { gameCam = gameCamObject.GetComponent <MainCamera>(); }
// Use this for initialization void Start () { current = this; cameraBoundaries = new float[4] {-319, -348, 310, 319}; //minx, miny, maxx, maxy }
void Awake() { main = this; }
public void Start() { MainCamera = new MainCamera(); }
void Start() { player = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<MainCamera> (); img = transform.GetChild(1).GetComponent<UnityEngine.UI.Image> (); }
void Start() { player = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<MainCamera> (); player.Loss += LossScreen; player.Win += WinScreen; }
void Awake() { instance = this; mainCamera = FindObjectOfType<MainCamera>(); onGainControl += OnGainControl; }
public ChangePage(MainCamera camera) : base(camera) { }
private static void OnUpdate(double ts) { MainCamera.Update((float)ts); }
public void Init() { camera = Camera_SetUp(); }