HelloARController script;   //HelloARControllerが入る変数
 // Start is called before the first frame update
 void Start()
 {
     this.distance = GameObject.Find("Distance");
     this.AR       = GameObject.Find("HelloAR Controller");
     script        = AR.GetComponent <HelloARController>();
     //GameObjectのHelloAR Controllerの中にあるHelloARController.csを取得して変数に格納
 }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        _ARController       = FindObjectOfType <HelloARController>();
        _listItemController = FindObjectOfType <ObjectsListController>();
        _objectsManager     = FindObjectOfType <ObjectsManager>();


        _listItemController.ListItemSelected += (id) =>
        {
            var dataModel = _objectsManager.GetBundleData(id);

            if (dataModel != null)
            {
                _ARController.CurrentDataModel = dataModel;
            }
            else
            {
                Debug.LogError("Can't find datamodel: " + id);
            }
        };

        _listItemController.ClearSceneButtonPressed += () =>
        {
            _ARController.DestroyAllAssets();
        };
    }
Exemplo n.º 3
0
    // Start moving the player in the given directions. Y should always be 0
    public void MovePlayer(Queue <Vector3> directions)
    {
        GameObject sceneController = GameObject.Find("SceneController");

        arCon           = sceneController.GetComponent <HelloARController>();
        boardItemsArray = arCon.boardItemsArray;

        for (int x = 0; x < boardItemsArray.GetLength(0); x++)
        {
            for (int z = 0; z < boardItemsArray.GetLength(1); z++)
            {
                if (boardItemsArray[x, z] == 3)
                {
                    goalX = x;
                    goalZ = z;
                }
            }
        }
        _treasure = GameObject.FindGameObjectWithTag("Treasure");

        //float turnAngle = 90;
        //transform.rotation = Quaternion.Euler(0.0f, transform.rotation.eulerAngles.y + turnAngle, transform.rotation.z);
        // Copy the stack to _directions. Looks silly, but is neccesary to keep the order
        _directions = new Queue <Vector3>(new Queue <Vector3>(directions));
        IsExecuting = true;
    }
Exemplo n.º 4
0
    void Update()
    {
        player = GameObject.Find("Example Controller").GetComponent <HelloARController>();

        if (currentHealth <= -100)
        {
            Destroy(gameObject);
        }

        try{
            if (currentHealth == 0)
            {
                gameObject.GetComponent <Animator>().ResetTrigger("Start");
                gameObject.GetComponent <Animator>().ResetTrigger("Attack");
                gameObject.GetComponent <Animator>().SetTrigger("Die");
                audio.Stop();
                player.zkills += 1;
                currentHealth -= 1;
            }
        } catch (Exception e) {
            player.zkills += 1;
            Destroy(gameObject);
            Debug.LogException(e, this);
        }

        if (currentHealth < 0)
        {
            currentHealth -= 1;
        }

        float dist = Vector3.Distance(Camera.main.transform.position, transform.position);

        if (dist > 1.3)
        {
            m_Animator.ResetTrigger("Attack");
            m_Animator.SetTrigger("Start");
            audio.clip = zombieAudio;
            transform.LookAt(Camera.main.transform.position);
            transform.eulerAngles = new Vector3(0, transform.eulerAngles.y, 0);
        }
        else
        {
            audio.Play();
            m_Animator.ResetTrigger("Start");
            m_Animator.SetTrigger("Attack");
            audio.clip        = attackAudio;
            player.curHealth -= 0.25;
        }
    }
Exemplo n.º 5
0
    public void chooseModel(int dropdown)
    {
        HelloARController arController = gameObject.GetComponent <HelloARController> ();

        switch (dropdown)
        {
        case 0:
            arController.robotObject.SetActive(false);
            arController.andyObject.SetActive(true);
            break;

        case 1:
            arController.robotObject.SetActive(true);
            arController.andyObject.SetActive(false);
            break;
        }
    }
Exemplo n.º 6
0
 void Initialize()
 {
     if (null == ArController)
     {
         ArController = FindObjectOfType(typeof(HelloARController)) as HelloARController;
     }
     if (null == orderText)
     {
         orderText   = GameObject.Find("Canvas").transform.Find("Text_order").gameObject;
         orderTextSc = orderText.transform.GetComponent <Text>();
     }
     if (null == tableButton)
     {
         tableButton   = GameObject.Find("Canvas").transform.Find("Button_Table").gameObject;
         tableButtonSc = tableButton.transform.GetComponent <Button>();
     }
     if (null == curryButton)
     {
         //curryButton = GameObject.Find("Button_Curry") as GameObject;
         curryButton   = GameObject.Find("Canvas").transform.Find("Button_Curry").gameObject;
         CurryButtonSc = curryButton.transform.GetComponent <Button>();
     }
     if (null == riceNoodleButton)
     {
         riceNoodleButton   = GameObject.Find("Canvas").transform.Find("Button_Rice_Noodle").gameObject;
         RiceNoodleButtonSc = riceNoodleButton.transform.GetComponent <Button>();
     }
     if (null == ChinaNoodleButtonSc)
     {
         chinaNoodleButton   = GameObject.Find("Canvas").transform.Find("Button_China_Noodle").gameObject;
         ChinaNoodleButtonSc = chinaNoodleButton.transform.GetComponent <Button>();
     }
     if (null == misoSoupButton)
     {
         misoSoupButton   = GameObject.Find("Canvas").transform.Find("Button_Miso_Soup").gameObject;
         MisoSoupButtonSc = misoSoupButton.transform.GetComponent <Button>();
     }
     if (null == resetButton)
     {
         resetButton   = GameObject.Find("Canvas").transform.Find("Button_Reset").gameObject;
         ResetButtonSc = resetButton.transform.GetComponent <Button>();
     }
 }
 private void Start()
 {
     mainController = GetComponent <HelloARController>();
     //Setting a default value for the prefab
     mainController.ClickPrefab(SmallSpidersPrefab);
 }
Exemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     controller = GetComponent <HelloARController>();
     PopulateList();
 }
 private void Start()
 {
     playerTransform   = GameObject.FindGameObjectWithTag("Player").transform;
     mainControlCenter = GameObject.FindGameObjectWithTag("MainController").GetComponent <HelloARController>();
 }
Exemplo n.º 10
0
 // Start is called before the first frame update
 void Start()
 {
     bSetting   = true;
     mesnRender = this.transform.GetComponent <MeshRenderer>();
     helloAr    = FindObjectOfType(typeof(HelloARController)) as HelloARController;
 }
Exemplo n.º 11
0
 private void Start()
 {
     _scriptController = Controller.GetComponent <HelloARController>();
     _scriptController.virtualObject     = null;
     GetComponent <Button>().image.color = Color.white;
 }