コード例 #1
0
ファイル: GhostBricks.cs プロジェクト: NCSUMobiles/AR-Tetris
 public void generateGhost()
 {
     myGhostBrick = (Transform) Instantiate(ghostBrickPrefab, new Vector3(0, 0, 0), Quaternion.identity);
     wrapUpScript = GameObject.Find("ImageTarget").GetComponent("WrapUp") as WrapUp;
     drawMe();
 }
コード例 #2
0
ファイル: GamePlay.cs プロジェクト: NCSUMobiles/AR-Tetris
    IEnumerator Start()
    {
        isMoving = false;
        numTouching = 0;
        quartile = 0;
        //ARCamera = transform.parent;
        //ARCamera = ARCamera.GetComponent("ARCamera");
        //ARCamera = GameObject.Find("Camera").transform;

        if(GameObject.Find("ARCamera") != null){
            ARCamera = GameObject.Find("ARCamera").transform;
        }
        else{
            ARCamera = GameObject.Find("Camera").transform;
        }
        transform.Find("PhysicalPart").gameObject.SetActiveRecursively(false);
        testTimer = 0;
        numFingers = 0;
        //finger1Id = -1;
        nextMove = 0.0f;
        movementMutex = new Mutex(false);
        //collisionMutex = new Mutex(false);
        wrapUpScript = GameObject.Find("ImageTarget").GetComponent("WrapUp") as WrapUp;
        collision = false;
        physicalPart = transform.Find("PhysicalPart").transform;
        generateGhosts();
        //Act as a constructor
        //while it is not colliding
        while(true){
            if(!collision){
                StartCoroutine(drop());
            }
            //call the drop method every 1 second
            yield return new WaitForSeconds(1.5f);
        }
    }