예제 #1
0
 // Called before first frame. Prepares the displays and loads cameras.
 private void Awake()
 {
     // Things here should only ever happen once.
     if (instance == null)
     {
         viewpoint = GetComponentInChildren <CameraViewpoint>();
     }
 }
예제 #2
0
    // Called before first frame. Prepares the displays and loads cameras.
    private void Awake()
    {
        // Things here should only ever happen once.
        if (instance != null)
        {
            GameObject.Destroy(instance.gameObject);
        }

        instance      = this;
        CAVEViewpoint = GetComponentInChildren <CameraViewpoint>();
    }
예제 #3
0
    // Initialization
    void Start()
    {
        gameManager     = GetComponentInParent <GameManager>();
        cameraViewpoint = gameManager.cameraRig.viewpoint;

        if (photoPrefab == null)
        {
            photoPrefab      = new GameObject();
            photoPrefab.name = "Photo Template";
            ((GameObject)photoPrefab).transform.parent = this.transform;
            ((GameObject)photoPrefab).AddComponent <CatalystPhoto>();
            ((GameObject)photoPrefab).AddComponent <SpriteRenderer>();
            ((GameObject)photoPrefab).AddComponent <BoxCollider>();
            ((GameObject)photoPrefab).SetActive(false);
        }
    }
예제 #4
0
    public void CheckIfPOISelected()
    {
        if (selectedPOI == null && GamepadInput.GetDown(GamepadInput.InputOption.A_BUTTON))
        {
            RaycastHit cameraRaycast = CameraViewpoint.GetRaycast();

            if (cameraRaycast.collider != null)
            {
                POI hitPOI = cameraRaycast.collider.GetComponent <POI>();

                if (hitPOI != null)
                {
                    hitPOI.Toggle(gameManager);
                }
            }
        }
    }