예제 #1
0
 // Use this for initialization
 void Start()
 {
     gl                = GameObject.FindObjectOfType(typeof(CsGlobals)) as CsGlobals;
     playingField      = GameObject.Find("GamingField");
     background        = GameObject.Find("FieldBack");
     figureSpawner     = GameObject.Find("FigureSpawner");
     widthPF           = playingField.renderer.bounds.size.x;
     heightPF          = playingField.renderer.bounds.size.y;
     cubePrefab        = (GameObject)Resources.Load("Cube", typeof(GameObject));        //loading prefab of cube
     cubePrefabColored = (GameObject)Resources.Load("CubeColored", typeof(GameObject)); //loading colored part of cube, its doing for acces to any colored part of cube for changing color
     gl.currentFigure  = new Figure(gl.model);
     gl.nextFigure     = new Figure(gl.model);
 }
	// Use this for initialization
	void Start () 
	{
		gl=GameObject.FindObjectOfType(typeof(CsGlobals)) as CsGlobals;
		playingField = GameObject.Find ("GamingField");
		background = GameObject.Find ("FieldBack");
		figureSpawner = GameObject.Find ("FigureSpawner");
		widthPF = playingField.renderer.bounds.size.x;
		heightPF = playingField.renderer.bounds.size.y;
		cubePrefab = (GameObject)Resources.Load("Cube", typeof(GameObject));  //loading prefab of cube
		cubePrefabColored = (GameObject)Resources.Load("CubeColored", typeof(GameObject)); //loading colored part of cube, its doing for acces to any colored part of cube for changing color		
		gl.currentFigure = new Figure (gl.model);
		gl.nextFigure = new Figure (gl.model);	
	}
예제 #3
0
    void Start()
    {
        Time.timeScale = 1;

        gl = GameObject.FindObjectOfType(typeof(CsGlobals)) as CsGlobals;
        gl.isPlayingGame = false;
        gl.menu          = true;
        //cubesArray = new CubeInfo[gl.model.cells.GetLength(0), gl.model.cells.GetLength(1)]; //array of cubes, that changes by cubesVisibility function
        gl.figureColor = new Color(Random.Range(0.35f, 0.7f), Random.Range(0.35f, 0.7f), Random.Range(0.35f, 0.7f));

        //gl.cubeInfo = cubePrefab.gameObject.GetComponent<CubeInfo>();  //getting info about cube (color, size...)
        OnChanged += cubesVisibility;           //adding new subscriber to event of playfield changing

        decreasedLines = new ArrayList();
        effectBlowGO   = GameObject.Find("clearLineEffect");
        effectBlow     = effectBlowGO.gameObject.GetComponent <effectClearLineSpawner> ();

        timeMove = timeMoveMax;

        gl.Score = 0;
    }
예제 #4
0
	void Start () 
	{
		Time.timeScale = 1;

		gl=GameObject.FindObjectOfType(typeof(CsGlobals)) as CsGlobals;
		gl.isPlayingGame = false;
		gl.menu = true;
		//cubesArray = new CubeInfo[gl.model.cells.GetLength(0), gl.model.cells.GetLength(1)]; //array of cubes, that changes by cubesVisibility function
		gl.figureColor =new Color (Random.Range(0.35f, 0.7f), Random.Range(0.35f, 0.7f), Random.Range(0.35f, 0.7f));

		//gl.cubeInfo = cubePrefab.gameObject.GetComponent<CubeInfo>();  //getting info about cube (color, size...)
		OnChanged += cubesVisibility;	//adding new subscriber to event of playfield changing

		decreasedLines = new ArrayList ();
		effectBlowGO = GameObject.Find ("clearLineEffect");
		effectBlow = effectBlowGO.gameObject.GetComponent<effectClearLineSpawner> ();

		timeMove = timeMoveMax;

		gl.Score = 0;
	}
예제 #5
0
	void Start () 
	{
		gl=GameObject.FindObjectOfType(typeof(CsGlobals)) as CsGlobals;
		placed = false;
	}
예제 #6
0
    // Use this for initialization

    void Start()
    {
        gl = GameObject.FindObjectOfType(typeof(CsGlobals)) as CsGlobals;
    }
 void Awake()
 {
     controller =  GetComponent <CharacterController>() ;
     aniPlay = GetComponent ( "Sprite" ) as Sprite ;
     gl = GameObject.FindObjectOfType(typeof(CsGlobals)) as CsGlobals;
 }