Ejemplo n.º 1
0
    public GameObject[] pre;              // 프리팹


    private void Start()
    {
        objectToSpawn      = FindObjectOfType <ObjectSpawner>(); // ObjectToSpawn 컴포넌트(스크립트) 활성 비활성에 쓰일 게임오브젝트
        placementIndicator = FindObjectOfType <PlacementIndicator>();
        checkedButton.SetActive(false);
        objectSpawner.GetComponent <ObjectSpawner>().enabled = true;
    }
Ejemplo n.º 2
0
    void Start()
    {
        githubApi = new Api.Github();
        sendGithubApi();

        placementIndicator = GetComponent <PlacementIndicator>();
    }
Ejemplo n.º 3
0
 void Start()
 {
     rayManager         = FindObjectOfType <ARRaycastManager> ();
     placementIndicator = FindObjectOfType <PlacementIndicator> ();
     audioData          = GetComponents <AudioSource> ();
     iter = 0;
 }
Ejemplo n.º 4
0
 private void OnDisable()
 {
     if (PlacementIndicator != null)
     {
         PlacementIndicator.SetActive(false);
     }
 }
Ejemplo n.º 5
0
 void Awake()
 {
     instance       = this;
     raycastManager = FindObjectOfType <ARRaycastManager>();
     visual         = transform.GetChild(0).gameObject;
     cam            = Camera.main;
 }
 // Start is called before the first frame update
 void Start()
 {
     objectPlaced       = false;
     numLines           = 0;
     lineRend           = GetComponent <LineRenderer>();
     placementIndicator = FindObjectOfType <PlacementIndicator>();
 }
Ejemplo n.º 7
0
    void Start()
    {
        cam = Camera.main;
        core.SetActive(false);

        placementIndicator = FindObjectOfType <PlacementIndicator>();
    }
Ejemplo n.º 8
0
 void Start()
 {
     placementIndicator = FindObjectOfType <PlacementIndicator>();
 #if !UNITY_EDITOR
     fingerID = 0;
 #endif
 }
Ejemplo n.º 9
0
    public GameObject menuButton;                                     // UI Panel

    void OnEnable()                                                   // 오브젝트 스포너 스크립트가 활성화가 되면
    {
        placementIndicator = FindObjectOfType <PlacementIndicator>(); // 스크립트 찾아서 컴포넌트 속성값 넣어줌.

        if (placementIndicator != null)                               // 평면 감지 되었으면
        {
            objectToSpawns[MenuButton.menuNum].SetActive(true);       // 오브젝트 비주얼 활성화
        }
    }
Ejemplo n.º 10
0
    void Start()
    {
        placementIndicator = FindObjectOfType <PlacementIndicator>();
        obj = Instantiate(objectToSpawn);
        //obj.SetActive(false);

        Button btn = button.GetComponent <Button>();

        btn.onClick.AddListener(TaskOnClick);
    }
Ejemplo n.º 11
0
        private void Update()
        {
#if UNITY_EDITOR
            var screenCenter = Camera.ViewportToWorldPoint(new Vector3(0.5f, 0.65f, 30));
            OnScreenCenter.Invoke(screenCenter);
            #else
            var screenCenter = Camera.ViewportToScreenPoint(new Vector3(0.5f, 0.65f));

            if (Raycast(screenCenter, out var planePoint, out var planeRotation))
            {
                PlacementIndicator.SetActive(true);
                PlacementIndicator.transform.SetPositionAndRotation(planePoint, planeRotation);

                OnScreenCenter.Invoke(planePoint);
            }
    // Use this for initialization
    void Awake()
    {
        indicator = placementIndicator.GetComponent<PlacementIndicator>();
        twrPlacementScript = inputManager.GetComponent<TowerPlacement>();

        curAvailableUnit1s = maxUnit1Number;
        curAvailableUnit2s = maxUnit2Number;
        curAvailableUnit3s = maxUnit3Number;

        unit1availableText.text = curAvailableUnit1s + " Unit 1 available";
        unit2availableText.text = curAvailableUnit2s + " Unit 2 available";
        unit3availableText.text = curAvailableUnit3s + " Unit 3 available";

        lookAtPathPoint = Vector3.zero;
    }
Ejemplo n.º 13
0
    public void CheckForPortal()
    {
        myCheckForPortal = Physics.BoxCast(gameObject.transform.position, transform.localScale / 2, transform.up, out myPortalHit, Quaternion.identity, 1f, myPortalMask);

        if (myCheckForPortal == true)
        {
            PathManager pathManager = FindObjectOfType <PathManager>();

            List <Portals> portals = pathManager.GetPortals;

            for (int i = 0; i < portals.Count; i++)
            {
                if (portals[i].name == myPortalHit.collider.gameObject.name)
                {
                    myPlacement = FindObjectOfType <Placement>();
                    myPlacement.SetValidPlacement(i);
                    myPlacementIndicator = FindObjectOfType <PlacementIndicator>();
                    myPlacementIndicator.transform.position = portals[i].GetExit() + gameObject.transform.position;
                    myPlacementIndicator.CheckPlacementIndicators();
                    break;
                }
            }
        }
    }
 void Start()
 {
     spawnNum           = 1;
     placementIndicator = FindObjectOfType <PlacementIndicator>();
 }
Ejemplo n.º 15
0
 void Start()
 {
     rayManager         = FindObjectOfType <ARRaycastManager>();
     placementIndicator = FindObjectOfType <PlacementIndicator>();
 }
Ejemplo n.º 16
0
 void Awake()
 {
     indicator = placementIndicator.GetComponent<PlacementIndicator>();
 }
Ejemplo n.º 17
0
 void Start()
 {
     placementIndicator = FindObjectOfType <PlacementIndicator>();
     canSpawnModel      = true;
 }
Ejemplo n.º 18
0
 void Start()
 {
     placementIndicator = FindObjectOfType <PlacementIndicator>();
     hasSpawned         = false;
 }
Ejemplo n.º 19
0
 void Start()
 {
     placementIndicator = FindObjectOfType <PlacementIndicator>();
     obj = Instantiate(objectToSpawn);
     obj.SetActive(false);
 }
Ejemplo n.º 20
0
 void Awake()
 {
     placementIndicator = FindObjectOfType <PlacementIndicator>();
 }
Ejemplo n.º 21
0
 void Start()
 {
     placementIndicator = FindObjectOfType <PlacementIndicator>();
 }
Ejemplo n.º 22
0
 public void Start()
 {
     allowSpawn         = true;
     placementIndicator = FindObjectOfType <PlacementIndicator>();
 }
    private void Start()
    {
        placementIndicator = FindObjectOfType <PlacementIndicator>();


        string[] lines = System.IO.File.ReadAllLines(path);
        //Debug.Log("Contents of ARMolecules.txt = ");
        int i         = 0;
        int num_atoms = 0;

        foreach (string line in lines)
        {
            if (i < 14)
            {
                i++;
                continue;
            }
            if (i == 14)
            {
                num_atoms = Int32.Parse(line);
                Debug.Log(num_atoms);
                i++;
                continue;
            }
            //here means i>14
            string[] atom = line.Split(' ');
            foreach (string el in atom)
            {
                //Debug.Log(el);
                switch (el)
                {
                case "Br":
                    Debug.Log("It is Br");
                    break;

                case "H":
                    Debug.Log("It is H");
                    break;

                case "O":
                    Debug.Log("It is O");
                    break;

                case "C":
                    Debug.Log("It is C");
                    break;

                case "N":
                    Debug.Log("It is N");
                    break;

                default:
                    Debug.Log("Nothing");
                    break;
                }
            }
            Debug.Log("\n");
            i++;
            if (i == (15 + num_atoms))
            {
                i = 0;
                //continue;
                break;
            }
            //GameObject obj = Instantiate(objectToSpawn, placementIndicator.transform.position, placementIndicator.transform.rotation);
        }
    }