void Start() { firstParent = transform.parent; firstPosition = transform.GetComponent <RectTransform> ().anchoredPosition; pieceConnector = GameObject.FindGameObjectWithTag("UsableSlots").GetComponent <PieceConnector> (); cameraScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <TouchCamera> (); cam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera> (); audioControl = GameObject.FindGameObjectWithTag("AudioControl").GetComponent <AudioControl> (); }
private void Awake() { mainCamera = Camera.main; touchCamera = mainCamera.GetComponent <TouchCamera>(); touchCamera.enabled = false; this.grid = FindObjectOfType <YellowBean.Grid>(); this.animBall = this.goBalloon.GetComponent <Animation>(); }
// Update is called once per frame void Update() { if (!salvageMode) { return; } float scale = 1 / (TouchCamera.getHeight() / 10); meshBuilder.GetComponent <MeshRenderer>().materials[0].SetTextureScale("_MainTex", new Vector2(scale, scale)); }
public static void SelectStateRandomly() { if (stateList.Count == 0) { // win condition SaveScore(); PlaySound(sound_victory); GameOver(); } else { stateIndex = Random.Range(0, stateList.Count); stateText.text = getCurrentRegionName(); TouchCamera.ResetCamera(); } }
public void StartTutorial(TouchCamera tc, ServerTeam team) { TCamera = tc; TCamera.enabled = false; m_team = team; instructionState = InstructionsState.confirmIfInstructionsNeeded; InstructionExecution(); //if (LoadEncodedFile() == textToWrite) //{ // StopInstructions(); //} //else //{ // Debug.Log("No File Founded"); // instructionState = InstructionsState.confirmIfInstructionsNeeded; // InstructionExecution(); //} }
private static void CreateTouchCameraInScene() { sceneCamera = FindObjectOfType <Camera>(); if (sceneCamera == null) { sceneCamera = new GameObject("TouchCamera").AddComponent <Camera>(); } touchCamera = sceneCamera.GetComponent <TouchCamera>(); if (touchCamera == null) { touchCamera = sceneCamera.gameObject.AddComponent <TouchCamera>(); } touchCamera.touchCamera = sceneCamera; if (!sceneCamera.gameObject.name.Contains(suffixName)) { sceneCamera.gameObject.name = sceneCamera.gameObject.name + suffixName; } Selection.activeGameObject = touchCamera.gameObject; }
public static void Miss() { missed++; missedIndex = stateIndex; missedFlag = true; resetMissDelay(); resetBlinkTimer(); SetMissedText(); HighlightRegion(missedIndex); TouchCamera.MoveCamera(stateList [missedIndex].gameObject); PlaySound(sound_miss); UpdateScore(); if (missed >= getAllowableMisses()) { SaveScore(); GameOver(); } }
void Start() { instance = this; Active = false; camera = GetComponent <Camera> (); }