Exemplo n.º 1
0
 public SectorStarTransform(Vector3 _StarPositionList, Vector3 _StarSystemSizeList, StarSystemType _StarSystemType, StarType _starType1, StarType _starType2, StarType _starType3)
 {
     StarPosition   = _StarPositionList;
     StarSystemSize = _StarSystemSizeList;
     StarSystemType = _StarSystemType;
     starType1      = _starType1;
     starType2      = _starType2;
     starType3      = _starType3;
 }
Exemplo n.º 2
0
 public StarSystem(StarType _starType1, StarType _starType2, StarType _starType3,
                   StarSystemType _starSystemType, Vector3 StarPosition, string StarSystemName, Sector Sector, GameObject StarSystemsObject, Galaxy Galaxy)
 {
     starType1         = _starType1;
     starType2         = _starType2;
     starType3         = _starType3;
     starSystemType    = _starSystemType;
     galaxy            = Galaxy;
     starPosition      = StarPosition;
     starSystemName    = StarSystemName;
     sector            = Sector;
     starSystemsObject = StarSystemsObject;
     starSystemsObject.GetComponent <MeshRenderer>().material = starType1.starColour;
 }
Exemplo n.º 3
0
        public void GenerateSectorStarPosition()
        {
            sectorType     = SectorTypeGeneration(sectorCoord);
            numSectorStars = GenerateSectorNumStars(sectorType);
            for (int i = 0; i < numSectorStars; i++)
            {
                float          fStarSystemSize = galaxy.randomNumber.Next(1, 10);
                StarType       starType1       = null;
                StarType       starType2       = null;
                StarType       starType3       = null;
                StarSystemType starSystemType  = (StarSystemType)galaxy.randomNumber.Next(0, (int)StarSystemType.COUNT);
                if (starSystemType == StarSystemType.SINGULAR_STAR_SYSTEM)
                {
                    int starType1int = galaxy.randomNumber.Next(0, galaxy.starTypeTable.Length);
                    starType1 = galaxy.starTypeTable[starType1int];
                }
                else if (starSystemType == StarSystemType.BINARY_STAR_SYSTEM)
                {
                    int starType1int = galaxy.randomNumber.Next(0, galaxy.starTypeTable.Length);
                    starType1 = galaxy.starTypeTable[starType1int];
                    int starType2int = galaxy.randomNumber.Next(0, galaxy.starTypeTable.Length);
                    starType2 = galaxy.starTypeTable[starType2int];
                }
                else if (starSystemType == StarSystemType.TRINARY_STAR_SYSTEM)
                {
                    int starType1int = galaxy.randomNumber.Next(0, galaxy.starTypeTable.Length);
                    starType1 = galaxy.starTypeTable[starType1int];
                    int starType2int = galaxy.randomNumber.Next(0, galaxy.starTypeTable.Length);
                    starType2 = galaxy.starTypeTable[starType2int];
                    int starType3int = galaxy.randomNumber.Next(0, galaxy.starTypeTable.Length);
                    starType3 = galaxy.starTypeTable[starType3int];
                }
                SectorStarTransform StarTransform = new SectorStarTransform(new Vector3(galaxy.randomNumber.Next(trueSectorCoord.x, Galaxy.SectorSize + trueSectorCoord.x + 1),
                                                                                        galaxy.randomNumber.Next(trueSectorCoord.y, Galaxy.SectorSize + trueSectorCoord.y + 1),
                                                                                        galaxy.randomNumber.Next(trueSectorCoord.z, Galaxy.SectorSize + trueSectorCoord.z + 1)),
                                                                            new Vector3(fStarSystemSize, fStarSystemSize, fStarSystemSize),
                                                                            starSystemType, starType1, starType2, starType3);

                StarTransformList.Enqueue(StarTransform);
            }
            IsSectorPopulated = true;
            //Debug.Log("Creating star positions");
        }