Exemple #1
0
	// Use this for initialization
	void Start () {
		game = GameObject.Find("Game").GetComponent<Game>();
		
		if (!game.isTutorial){
			medals = new Medal[5];
			medals[0] = transform.FindChild("MedalsArray").FindChild("Medal0").GetComponent<Medal>();
			medals[1] = transform.FindChild("MedalsArray").FindChild("Medal1").GetComponent<Medal>();
			medals[2] = transform.FindChild("MedalsArray").FindChild("Medal2").GetComponent<Medal>();
			medals[3] = transform.FindChild("MedalsArray").FindChild("Medal3").GetComponent<Medal>();
			medals[4] = transform.FindChild("MedalsArray").FindChild("Medal4").GetComponent<Medal>();
			hintText = transform.FindChild("HintText");
			if (!game.isQuickGame){
				heartPiece = transform.FindChild("HeartPieceCube").GetComponent<HeartPiece>();
				heartPiece.hide();
				extraChanceText = transform.FindChild("ExtraChanceText").GetComponent<ExtraChanceText>();
				extraChanceText.hide();
				livesArray = transform.FindChild("GameSummaryLivesArray").GetComponent<LivesArray>();
			}
		}
		
		gameSummaryLight = transform.FindChild("GameSummaryLight").GetComponent<Light>();
		gameSummaryLight.range = 0;
		
		title = transform.FindChild("Title");
		nextButton = transform.FindChild("NextStackButton");
		
	}
Exemple #2
0
	void Start (){
		if (!isTutorial) {
			resetButton = GameObject.Find ("ResetButton").transform;
			skipButton = GameObject.Find ("SkipButton").transform;
		}
		if (isTutorial) {
			toggleBeacon ();
			tutorialText1 = GameObject.Find ("TutorialText1").transform;
			tutorialText2 = GameObject.Find ("TutorialText2").transform;
		}
		
		redParticle = transform.FindChild ("RedPart");
		greenParticle = transform.FindChild ("GreenPart");
		blueParticle = transform.FindChild ("BluePart");
		
		rgbState = new float[3, 3];
		rgbState [0, 0] = 1.0f;
		rgbState [0, 1] = 0.0f;
		rgbState [0, 2] = 0.5f;
		
		rgbState [1, 0] = 0.0f;
		rgbState [1, 1] = 0.9f;
		rgbState [1, 2] = 0.18f;
		
		rgbState [2, 0] = 0.0f;
		rgbState [2, 1] = 0.5f;
		rgbState [2, 2] = 1.0f;
		
		livesArray = GameObject.Find("LivesArray").GetComponent<LivesArray>();
		
		if (isQuickGame) {
			tilesArray = new Transform[2];
			livesLeft = Global.quickGameLives;
		} else {
			tilesArray = new Transform[10];
			livesLeft = Global.getGameLives();
		}
		
		tilesArray [0] = transform.Find ("TilesArrayA");
		tilesArray [1] = transform.Find ("TilesArrayB");
		if (!isQuickGame) {
			tilesArray [2] = transform.Find ("TilesArrayC");
			tilesArray [3] = transform.Find ("TilesArrayD");
			tilesArray [4] = transform.Find ("TilesArrayE");
			tilesArray [5] = transform.Find ("TilesArrayF");
			tilesArray [6] = transform.Find ("TilesArrayG");
			tilesArray [7] = transform.Find ("TilesArrayH");
			tilesArray [8] = transform.Find ("TilesArrayI");
			tilesArray [9] = transform.Find ("TilesArrayJ");
		}
		
		activeTilesArray = tilesArray [0].GetComponent<TilesArray> ();
		
		stack0 = GameObject.Find ("Stack0").transform.FindChild ("Text");
		stack1 = GameObject.Find ("Stack1").transform.FindChild ("Text");
		stack2 = GameObject.Find ("Stack2").transform.FindChild ("Text");
		
		stackOrderTiles = new Transform[10];
		stackOrderTiles [0] = GameObject.Find ("StackOrder0").transform;
		stackOrderTiles [1] = GameObject.Find ("StackOrder1").transform;
		stackOrderTiles [2] = GameObject.Find ("StackOrder2").transform;
		stackOrderTiles [3] = GameObject.Find ("StackOrder3").transform;
		stackOrderTiles [4] = GameObject.Find ("StackOrder4").transform;
		stackOrderTiles [5] = GameObject.Find ("StackOrder5").transform;
		stackOrderTiles [6] = GameObject.Find ("StackOrder6").transform;
		stackOrderTiles [7] = GameObject.Find ("StackOrder7").transform;
		stackOrderTiles [8] = GameObject.Find ("StackOrder8").transform;
		stackOrderTiles [9] = GameObject.Find ("StackOrder9").transform;
		
		if (isQuickGame) {
			levelIndicators = new Transform[5];
			levelIndicators [0] = GameObject.Find ("LevelIndicator0").transform;
			levelIndicators [1] = GameObject.Find ("LevelIndicator1").transform;
			levelIndicators [2] = GameObject.Find ("LevelIndicator2").transform;
			levelIndicators [3] = GameObject.Find ("LevelIndicator3").transform;
			levelIndicators [4] = GameObject.Find ("LevelIndicator4").transform;
			levelIndicators [0].localPosition = new Vector3 (0, 0, 32);
			levelIndicators [1].localPosition = new Vector3 (0, 0, 16);
			levelIndicators [2].localPosition = new Vector3 (0, 0, 0);
			levelIndicators [3].localPosition = new Vector3 (0, 0, -16);
			levelIndicators [4].localPosition = new Vector3 (0, 0, -32);
			GameObject.Find ("LevelIndicator5").transform.localScale = new Vector3 (0, 0, 0);
			GameObject.Find ("LevelIndicator6").transform.localScale = new Vector3 (0, 0, 0);
			GameObject.Find ("LevelIndicator7").transform.localScale = new Vector3 (0, 0, 0);
			GameObject.Find ("LevelIndicator8").transform.localScale = new Vector3 (0, 0, 0);
			GameObject.Find ("LevelIndicator9").transform.localScale = new Vector3 (0, 0, 0);
		} else {
			levelIndicators = new Transform[10];
			levelStars = 0;
			levelIndicators [0] = GameObject.Find ("LevelIndicator0").transform;
			levelIndicators [1] = GameObject.Find ("LevelIndicator1").transform;
			levelIndicators [2] = GameObject.Find ("LevelIndicator2").transform;
			levelIndicators [3] = GameObject.Find ("LevelIndicator3").transform;
			levelIndicators [4] = GameObject.Find ("LevelIndicator4").transform;
			levelIndicators [5] = GameObject.Find ("LevelIndicator5").transform;
			levelIndicators [6] = GameObject.Find ("LevelIndicator6").transform;
			levelIndicators [7] = GameObject.Find ("LevelIndicator7").transform;
			levelIndicators [8] = GameObject.Find ("LevelIndicator8").transform;
			levelIndicators [9] = GameObject.Find ("LevelIndicator9").transform;
			
			if (!isTutorial){
				summaryLevelIndicators = new Transform[10];
				summaryLevelIndicators [0] = GameObject.Find ("StateLevelIndicator0").transform;
				summaryLevelIndicators [1] = GameObject.Find ("StateLevelIndicator1").transform;
				summaryLevelIndicators [2] = GameObject.Find ("StateLevelIndicator2").transform;
				summaryLevelIndicators [3] = GameObject.Find ("StateLevelIndicator3").transform;
				summaryLevelIndicators [4] = GameObject.Find ("StateLevelIndicator4").transform;
				summaryLevelIndicators [5] = GameObject.Find ("StateLevelIndicator5").transform;
				summaryLevelIndicators [6] = GameObject.Find ("StateLevelIndicator6").transform;
				summaryLevelIndicators [7] = GameObject.Find ("StateLevelIndicator7").transform;
				summaryLevelIndicators [8] = GameObject.Find ("StateLevelIndicator8").transform;
				summaryLevelIndicators [9] = GameObject.Find ("StateLevelIndicator9").transform;
			}
		}
		
		stacks = GameObject.Find ("Stacks").transform;
		stackOrder = GameObject.Find ("StackOrder").transform;
		
		cameraArray = GameObject.Find ("CameraArray");
		upperLight = cameraArray.transform.FindChild ("UpperLight");
		supportingTilesArray = cameraArray.transform.FindChild ("SupportingTilesArray");
		guiLeftPanel = GameObject.Find ("GUILeftPanel");
		guiRightPanel = GameObject.Find ("GUIRightPanel");
		
		gameSummary = GameObject.Find ("GameSummary");
		pauseScreen = GameObject.Find ("PauseScreen");
		gameEndedScreen = GameObject.Find ("GameEndedScreen");
		
		if (isQuickGame) {
			quickGameScoreNumber = GameObject.Find ("QuickGameScore");
			gameSummaryQuickGameScoreNumber = GameObject.Find ("GameSummaryQuickGameScore");
			quickGameScoreNumber.GetComponent<TextMesh> ().text = quickGameScore.ToString ();
			gameSummaryNewRecord = GameObject.Find ("NewRecord");
		} else {
			if (!isTutorial && !isQuickGame){
				medals = new Medal[5];
				medals[0] = guiLeftPanel.transform.FindChild("MedalsArray").FindChild("Medal0").GetComponent<Medal>();
				medals[1] = guiLeftPanel.transform.FindChild("MedalsArray").FindChild("Medal1").GetComponent<Medal>();
				medals[2] = guiLeftPanel.transform.FindChild("MedalsArray").FindChild("Medal2").GetComponent<Medal>();
				medals[3] = guiLeftPanel.transform.FindChild("MedalsArray").FindChild("Medal3").GetComponent<Medal>();
				medals[4] = guiLeftPanel.transform.FindChild("MedalsArray").FindChild("Medal4").GetComponent<Medal>();
			}	
		}
		
		puzzleStack = new int[3];
		
		effectsLightArray = GameObject.Find ("EffectsLightArray");
	}