// Use this for initialization void Awake() { rb = transform.parent.GetComponent <Rigidbody>(); myAnimator = transform.parent.GetComponent <Animator>(); direction = transform.GetComponent <cameraFollow> (); rb.useGravity = true; }
void Start() { SoundManager.instance.changeMusic(beginSong); fillArea = GameObject.Find("Canvas/Fill Area"); //groundObj = GameObject.Find ("floorObj"); //groundObj.GetComponent<cameraFollow> ().enabled = false; //scope.GetComponent<SpriteRenderer> ().color = new Color(0.0f, 0.0f, 0.0f, 1.0f); slider = gameObject.GetComponent <Slider>(); //scope = GameObject.Find ("scope"); maxHeight = (int)slider.maxValue; minHeight = (int)slider.minValue; // Set penguin spawn location xSpawnPos = (int)Camera.main.ViewportToWorldPoint(new Vector3(1.0f, 0, 0.0f)).x; ySpawnPos = (int)Camera.main.ViewportToWorldPoint(new Vector3(0.0f, 1.0f, 0.0f)).y; //Debug.Log(xSpawnPos); //Debug.Log(ySpawnPos); sliderActive = true; batActive = false; followScript = Camera.main.GetComponent <cameraFollow>(); followScript.enabled = false; SpawnPenguin(); }
// Start is called before the first frame update void Start() { managerBox = GetComponent <BoxCollider2D>(); player = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>(); GameObject camera = GameObject.Find("Main Camera"); cam = camera.GetComponent <cameraFollow>(); }
void Awake() { _use = this; cam = GetComponent <Camera>(); cam.orthographic = true; FindPlayer(); CalculateBounds(); }
void Awake() { S = this; cam = GetComponent <Camera>(); // Initially position the camera exactly over the poi - JB }
// Use this for initialization void Start() { earlyOrLateText = GameObject.Find("Canvas/earlyOrLate"); followScript = Camera.main.GetComponent <cameraFollow>(); followScript.enabled = false; // baseball = this.gameObject; baseballAnim = baseball.gameObject.GetComponent <Animator>(); //Debug.Log(baseballAnim.GetCurrentAnimatorStateInfo(0).normalizedTime); }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != null) { Destroy(gameObject); } }
//public ParticleSystem jumpParticles; void Awake() { privateSpeed = speed; privateJumpHehight = jumpHeight; rb = transform.parent.GetComponent <Rigidbody>(); myAnimator = transform.parent.GetComponent <Animator>(); direction = transform.GetComponent <cameraFollow> (); player = transform.parent.gameObject; _speed = speed; isRotating = false; rb.freezeRotation = true; rb.useGravity = false; isInvulnerable = false; isJumping = false; _isMoving = false; }
public override void OnInspectorGUI() { //draw regular inspector DrawDefaultInspector(); cameraFollow cf = (cameraFollow)target; //draw button to set the min cam pos to the current camera position if (GUILayout.Button("Set Min Cam Pos")) { //call min cam pos method cf.setMinCamPos(); } //draw button to set the max cam pos to the current camera position if (GUILayout.Button("Set Max Cam Pos")) { //call max cam pos method cf.setMaxCamPos(); } }
void Start() { cam = Camera.main.GetComponent <cameraFollow>(); generateMaze(); drawMaze(); for (int i = 0; i < height; ++i) { foreach (GameObject wall in wallArray[i]) { wall.SetActive(false); } foreach (GameObject floor in floorArray[i]) { floor.SetActive(false); } } for (int i = 0; i < height; ++i) { foreach (GameObject wall in wallArray[i]) { wall.SetActive(false); } foreach (GameObject floor in floorArray[i]) { floor.SetActive(false); } } StartCoroutine(tileMaze()); }
// Use this for initialization void Start() { //startingSpawnPoint = GameObject.Find ("StartingSpawnPoint"); anim = GetComponent<Animator> (); myCam = FindObjectOfType<cameraFollow> (); currentCheckpoint = new Vector2 (startingSpawnPoint.transform.position.x, startingSpawnPoint.transform.position.y); //throwingKnife = GameObject.Find ("throwingKnife"); }
private void checkCamera() { if(_mainCameraFollow == null) { _mainCameraFollow = _mainCameraObject.GetComponent<cameraFollow>() as cameraFollow; } }
private void OnTriggerEnter2D(Collider2D collision) { //Debug.Log(baseballAnim.GetCurrentAnimatorStateInfo(0).normalizedTime); if (baseballAnim.GetCurrentAnimatorStateInfo(0).normalizedTime <= 0.39) { //Debug.Log("Too Early!"); followScript = Camera.main.GetComponent <cameraFollow> (); followScript.enabled = false; Camera.main.transform.position = new Vector3(4.39f, 0f, -10.76f); earlyOrLateText.GetComponent <Text> ().text = "Swing Later..."; StartCoroutine(restartRound()); //miss // Too early } else if (baseballAnim.GetCurrentAnimatorStateInfo(0).normalizedTime > 0.39 && baseballAnim.GetCurrentAnimatorStateInfo(0).normalizedTime <= 0.5625) { SoundManager.instance.playSingle(clip); SoundManager.instance.changeMusic(musicSwitch); player.GetComponent <test> ().fire((int)slider.value, 15.0f); player.GetComponent <CircleCollider2D> ().isTrigger = false; gameObject.GetComponent <BoxCollider2D> ().enabled = false; } else if (baseballAnim.GetCurrentAnimatorStateInfo(0).normalizedTime > 0.5625 && baseballAnim.GetCurrentAnimatorStateInfo(0).normalizedTime <= 0.625) { SoundManager.instance.playSingle(clip); SoundManager.instance.changeMusic(musicSwitch); player.GetComponent <test> ().fire((int)slider.value, 45.0f); player.GetComponent <CircleCollider2D> ().isTrigger = false; gameObject.GetComponent <BoxCollider2D> ().enabled = false; } else if (baseballAnim.GetCurrentAnimatorStateInfo(0).normalizedTime > 0.625 && baseballAnim.GetCurrentAnimatorStateInfo(0).normalizedTime <= 0.98) { SoundManager.instance.playSingle(clip); SoundManager.instance.changeMusic(musicSwitch); player.GetComponent <test> ().fire((int)slider.value, 70.0f); player.GetComponent <CircleCollider2D> ().isTrigger = false; gameObject.GetComponent <BoxCollider2D> ().enabled = false; } else if (baseballAnim.GetCurrentAnimatorStateInfo(0).normalizedTime > 0.98) { Debug.Log("Too Late!"); //miss // Too late followScript = Camera.main.GetComponent <cameraFollow> (); followScript.enabled = false; Camera.main.transform.position = new Vector3(4.39f, 0f, -10.76f); earlyOrLateText.GetComponent <Text> ().text = "Swing Earlier..."; StartCoroutine(restartRound()); } else { followScript = Camera.main.GetComponent <cameraFollow> (); followScript.enabled = false; Camera.main.transform.position = new Vector3(4.39f, 0f, -10.76f); earlyOrLateText.GetComponent <Text> ().text = "Swing Later..."; StartCoroutine(restartRound()); } }
void Start() { thisTrans = transform; Static = this; }
// Start is called before the first frame update void Start() { // Get cameraFollows script from cameraObject. _my_cameraFollow_script = cameraObject.GetComponent <cameraFollow>(); }