Ejemplo n.º 1
0
	void Start(){
		ui = GameObject.Find ("UI Root").GetComponent<globalUIHandler> ();
		changePiece = GameObject.Find ("Main Camera").GetComponent<ChangePiece> ();
		infoTexte[0] = GameObject.Find ("UI Root/UI Components/Infowindow/1_text");
		infoTexte[1] = GameObject.Find ("UI Root/UI Components/Infowindow/2_text");
		infoTexte[2] = GameObject.Find ("UI Root/UI Components/Infowindow/3_text");
		infoTexte[3] = GameObject.Find ("UI Root/UI Components/Infowindow/4_text");
		level = GameObject.Find ("UI Root/UI Components/Infowindow/level").GetComponent<UILabel>();
		headline = GameObject.Find ("UI Root/UI Components/Infowindow/title").GetComponent<UILabel>();
	}
Ejemplo n.º 2
0
    ChangePiece GetChanged(PieceController p)
    {
        ChangePiece flip = null;

        for (int i = 0; i < changed.Count; i++)
        {
            if (changed[i].getOtherPiece(p) != null)
            {
                flip = changed[i];
                break;
            }
        }
        return(flip);
    }
Ejemplo n.º 3
0
	void Awake() {
		changePiece = Camera.main.GetComponent<ChangePiece> ();
	}
Ejemplo n.º 4
0
    void Update()
    {
        // Gravity Update
        if (bUpdateLogic)
        {
            //Debug.LogError("bUpdateLogic : " + update.Count);
            List <PieceController> finishedUpdating = new List <PieceController>();
            for (int i = 0; i < update.Count; i++)
            {
                PieceController piece = update[i];
                if (piece)
                {
                    piece.UpdatePiece();
                    if (!piece.UpdatePiece())
                    {
                        finishedUpdating.Add(piece);
                    }
                }
            }

            for (int i = 0; i < finishedUpdating.Count; i++)
            {
                PieceController piece = finishedUpdating[i];

                update.Remove(piece);
                updateClear();
            }
        }
        else // Picking Update
        {
            GameController.instance.ResultRogic();

            //Debug.LogError("Picking : " + update.Count);
            List <PieceController> finishedUpdating = new List <PieceController>();
            for (int i = 0; i < update.Count; i++)
            {
                PieceController piece = update[i];
                if (piece)
                {
                    if (!piece.UpdatePiece())
                    {
                        finishedUpdating.Add(piece);
                    }
                }
            }

            for (int i = 0; i < finishedUpdating.Count; i++)
            {
                PieceController piece        = finishedUpdating[i];
                ChangePiece     change       = GetChanged(piece);
                PieceController flippedPiece = null;

                // 바꾸는 조각체크
                if (IsConnectPoint(GetGridAtPoint(piece.point)))
                {
                    GameController.instance.MinusMoveCountvalue(1);
                    SearchAndDeleteConnectFull();
                }
                else
                {
                    if (change != null)
                    {
                        flippedPiece = change.getOtherPiece(piece);
                        // 바뀐 조각체크
                        if (IsConnectPoint(GetGridAtPoint(flippedPiece.point)))
                        {
                            GameController.instance.MinusMoveCountvalue(1);
                            SearchAndDeleteConnectFull();
                        }
                        else
                        {
                            FlipPieces(piece.point, flippedPiece.point, false);
                        }
                    }
                }

                changed.Remove(change);
                update.Remove(piece);
                updateClear();
            }
        }
    }
Ejemplo n.º 5
0
	void Start () {
		mainCameraHandler = gameObject.GetComponent<MainCameraHandler>();
		changePiece = gameObject.GetComponent<ChangePiece>();

		lastInputTime = Time.realtimeSinceStartup;
	}
Ejemplo n.º 6
0
	void Start() {
		mountainHandler = GameObject.Find ("Map").GetComponent<MountainHandler> ();
		mainCameraHandler = Camera.main.GetComponent<MainCameraHandler> ();
		changePiece = Camera.main.GetComponent<ChangePiece> ();
		ui = GameObject.Find ("UI Root").GetComponent<globalUIHandler> ();
	}
Ejemplo n.º 7
0
	void Start(){
		changePiece = GameObject.Find ("Main Camera").GetComponent<ChangePiece> ();

		if (label != null) state = 1;
	}
Ejemplo n.º 8
0
	void Start()
	{
		mountainHandler = GameObject.Find ("Map").GetComponent<MountainHandler> ();
		compassModel = GameObject.Find ("Compass").GetComponent<CompassModel> ();
		changePiece = gameObject.GetComponent<ChangePiece> ();
		rotationMiddle = GameObject.Find ("Main Camera").GetComponent<ChangePiece> ().rotationMiddlePositions;
		
		for (int n = 0; n<16; n++)
				for (int i = 0; i<3; i++) // calculate camera positions on leaving the compass mode
					leavingCameraPositions [n, i] = rotationMiddle [i] + (Quaternion.Euler (0, 22.5f * n, 0) * new Vector3(19.696f,3.473f,0));// x = Distance * sin(80) / sin(90); y = Distance * sin(10) / sin(90)

		Vector3 angles = transform.eulerAngles;
		rotationYAxis = angles.y;
		rotationXAxis = angles.x;
		
		// Make the rigid body not change rotation
		if(GetComponent<Rigidbody>())
		{
			GetComponent<Rigidbody>().freezeRotation = true;
		}
	}