コード例 #1
0
    void Start()
    {
        stackCont = GameObject.FindGameObjectWithTag("BrickStackController").GetComponent <BrickStackController> ();
        cellDist  = stackCont.GetCellDistance;

        Quaternion newRotation = Quaternion.Euler(45, 0, 45);

        this.transform.rotation = Quaternion.Slerp(this.transform.rotation, newRotation, rotationSpeed * Time.timeScale);

        int tempRows = stackCont.GetTotalRows;

        yPos = new float[tempRows];
        for (int i = 0; i < tempRows; i++)         // Y-loc for each row
        {
            yPos [i] = stackCont.GetBrickYPos(i);
        }

        int tempColumns = stackCont.GetTotalColumns;

        for (int i = 0; i < tempColumns; i++)         // X-loc for each column
        {
            if (stackCont.GetBrickXPos(i) == this.transform.position.x)
            {
                SetColumn = i;
                break;
            }
        }
    }
コード例 #2
0
    void FindComponents()
    {
        // Finds scripts.
        timeScaleControllerScript  = GameObject.FindGameObjectWithTag("TimeScaleController").GetComponent <TimescaleController> ();
        playerControllerScript     = GameObject.Find("Player").GetComponent <PlayerController> ();
        brickStackControllerScript = GameObject.FindGameObjectWithTag("BrickStackController").GetComponent <BrickStackController> ();
        MouseScript = GameObject.FindGameObjectWithTag("GlobalMouseController").GetComponent <GlobalMouseVisibility>();

        // Finds Player transform.
        Player = GameObject.FindGameObjectWithTag("Player").transform;
    }
コード例 #3
0
    void Start()
    {
        stackCont = GameObject.FindGameObjectWithTag ("BrickStackController").GetComponent <BrickStackController> ();
        cellDist = stackCont.GetCellDistance;

        Quaternion newRotation = Quaternion.Euler (45, 0, 45);
        this.transform.rotation = Quaternion.Slerp (this.transform.rotation, newRotation, rotationSpeed * Time.timeScale);

        int tempRows = stackCont.GetTotalRows;
        yPos = new float[tempRows];
        for (int i = 0; i < tempRows; i++) // Y-loc for each row
            yPos [i] = stackCont.GetBrickYPos (i);

        int tempColumns = stackCont.GetTotalColumns;
        for (int i = 0; i < tempColumns; i++) // X-loc for each column
            if (stackCont.GetBrickXPos (i) == this.transform.position.x)
            {
                SetColumn = i;
                break;
            }
    }
コード例 #4
0
    void FindComponents()
    {
        // Finds scripts.
        timeScaleControllerScript = GameObject.FindGameObjectWithTag ("TimeScaleController").GetComponent<TimescaleController> ();
        playerControllerScript = GameObject.Find ("Player").GetComponent<PlayerController> ();
        brickStackControllerScript = GameObject.FindGameObjectWithTag ("BrickStackController").GetComponent<BrickStackController> ();
        MouseScript = GameObject.FindGameObjectWithTag ("GlobalMouseController").GetComponent<GlobalMouseVisibility>();

        // Finds Player transform.
        Player = GameObject.FindGameObjectWithTag ("Player").transform;
    }