示例#1
0
        private void CreateListView(PointStorage pointStorage)
        {
            listView1.Clear();

            if (pointStorage == null)
            {
                return;
            }

            listView1.Columns.Add("Dimension", 75, HorizontalAlignment.Left);
            listView1.Columns.Add("Axis", 75, HorizontalAlignment.Left);
            listView1.Columns.Add("Position", 100, HorizontalAlignment.Left);

            for (int dimension = 0; dimension < pointStorage.Dimension; dimension++)
            {
                string dimensionName = pointStorage.DimensionName[dimension];

                ListViewItem item = new ListViewItem(dimensionName);
                if (axisMap.Contains(dimensionName))
                {
                    item.Tag = axisMap[dimensionName];                       // axis object
                    item.SubItems.Add(((IAxis)axisMap[dimensionName]).Name); // axis name
                    item.SubItems.Add("");
                }
                else
                {
                    item.Tag = null;                      // axis object
                    item.SubItems.Add("unassigned axis"); // axis name
                    item.SubItems.Add("");
                }
                listView1.Items.Add(item);
            }
        }
 // Start is called before the first frame update
 void Start()
 {
     pointStorage = GetComponent <PointStorage>();
     if (drawVoxels)
     {
         pointStorage.voxelSet.UpdateEvent += DrawVoxels;
     }
 }
        public void FillFrom(NamelessRogue.Engine.Components.Physical.Position component)
        {
            this.Point = component.Point;

            this.Id = component.Id == null ? null : component.Id.ToString();

            this.ParentEntityId = component.ParentEntityId == null ? null : component.ParentEntityId.ToString();
        }
        public void FillFrom(NamelessRogue.Engine.Components.Rendering.ConsoleCamera component)
        {
            this.Position = component.Position;

            this.Id = component.Id == null ? null : component.Id.ToString();

            this.ParentEntityId = component.ParentEntityId == null ? null : component.ParentEntityId.ToString();
        }
    // Start is called before the first frame update
    void Start()
    {
        pointStorage = GetComponent <PointStorage>();
        pointStorage.voxelSet.UpdateEvent += VoxelSet_UpdateEvent;

        particleSystem = GetComponent <ParticleSystem>();
        var main = particleSystem.main;

        main.startSize  = ParticleSize;
        main.startColor = ParticleColor;
    }
        public void FillFrom(NamelessRogue.Engine.Components.AI.NonPlayerCharacter.BasicAi component)
        {
            this.Route = new List <PointStorage>(component.Route.Select(x => (PointStorage)x));

            this.State = (BasicAiStatesStorage)component.State;

            this.DestinationPoint = component.DestinationPoint;

            this.Id = component.Id == null ? null : component.Id.ToString();

            this.ParentEntityId = component.ParentEntityId == null ? null : component.ParentEntityId.ToString();
        }
示例#7
0
    // Start is called before the first frame update
    void Start()
    {
        pointStorage = GetComponent <PointStorage>();

        if (drawMesh)
        {
            pointStorage.voxelSet.NewActivePointsEvent += VoxelSet_NewActivePointsEvent;
        }

        smartUpdate = pointStorage.smartUpdate;

        IPDMeshCreator = new IPDMeshCreator(pointStorage.voxelSet, smartUpdate, influenceRegion2, energyFunction2, regionAngle);

        ReadFle();
        //AddRandomPoints(500000);
    }
        public void FillFrom(NamelessRogue.Engine.Generation.World.WorldTile component)
        {
            this.Terrain = (TerrainTypesStorage)component.Terrain;

            this.Biome = (BiomesStorage)component.Biome;

            this.Building = component.Building;

            this.Artifact = component.Artifact;

            this.Affinity = component.Affinity;

            this.Owner = component.Owner;

            this.Continent = component.Continent;

            this.LandmarkRegion = component.LandmarkRegion;

            this.Settlement = component.Settlement;

            this.WorldBoardPosiiton = component.WorldBoardPosiiton;
        }
示例#9
0
 void Start()
 {
     Screen.sleepTimeout = SleepTimeout.NeverSleep;
     rayManager          = FindObjectOfType <ARRaycastManager>();
     objects             = new List <GameObject>();
     storage             = new PointStorage();
     enabled             = false;
     can_add             = true;
     models     = modelsManager.GetModels();
     modelIndex = 0;
     SetUpArrows(false);
     if (PlayerPrefs.HasKey("rooms"))
     {
         string jsonString = PlayerPrefs.GetString("rooms");
         Debug.Log("\n\nRooms" + jsonString + "\n\n");
         rooms = JsonUtility.FromJson <Rooms>(jsonString);
     }
     else
     {
         Debug.Log("\n\nRooms are empty\n\n");
         rooms          = new Rooms();
         rooms.Storages = new List <PointStorage>();
     }
 }
示例#10
0
 public void FillFrom(NamelessRogue.Engine.Generation.World.ConcreteSettlement component)
 {
     this.Center = component.Center;
 }
示例#11
0
 public void Enable(int index)
 {
     storage = rooms.Storages[index];
     StartCoroutine(SetImage());
     menuInstance.SetActive(true);
 }
示例#12
0
    void Update()
    {
        if (current != null)
        {
            Destroy(current);
        }
        if (!can_add)
        {
            return;
        }
        if (Input.touchCount > 0 && Input.touches[0].phase == TouchPhase.Began)
        {
            if (Input.GetTouch(0).position.x < Screen.width * 0.1)
            {
                OnLeft();
                return;
            }
            if (Input.GetTouch(0).position.x > Screen.width * 0.9)
            {
                OnRight();
                return;
            }
            if (Input.GetTouch(0).position.y < Screen.height * 0.2)
            {
                return;
            }
            List <ARRaycastHit> hits = new List <ARRaycastHit>();

            // Vector2 pos = Input.GetTouch(0).position;
            Vector2 pos = new Vector2(Screen.width / 2, Screen.height / 2);

            rayManager.Raycast(pos, hits, TrackableType.PlaneWithinPolygon);
            if (hits.Count == 0)
            {
                return;
            }
            GameObject currentObject = Instantiate(models[modelIndex], hits[0].pose.position, hits[0].pose.rotation);
            editor.EditObject(currentObject, (GameObject obj) => {
                can_add = true;
                SetUpArrows(true);
                if (storage == null)
                {
                    storage = new PointStorage();
                }
                storage.AddPoint(obj, modelIndex);
            });
            SetUpArrows(false);
            can_add = false;
        }
        else
        {
            Vector2 pos = new Vector2(Screen.width / 2, Screen.height / 2);

            List <ARRaycastHit> hits = new List <ARRaycastHit>();
            rayManager.Raycast(pos, hits, TrackableType.PlaneWithinPolygon);
            if (hits.Count == 0)
            {
                info.text = "Move your device to scan planes";
                return;
            }

            info.text = "Tap on the center of the screen to put object";
            current   = Instantiate(models[modelIndex], hits[0].pose.position, hits[0].pose.rotation);
        }
    }