Esempio n. 1
0
        public GlowPoint AddGlowPoint()
        {
            GlowPoint glowPoint = new GlowPoint();

            m_glowPoints.Add(glowPoint, value: true);
            return(glowPoint);
        }
        public override void OnAdded()
        {
            m_glowPoint = m_subsystemGlow.AddGlowPoint();
            CellFace cellFace     = base.CellFaces[0];
            int      mountingFace = MulticoloredLedBlock.GetMountingFace(Terrain.ExtractData(base.SubsystemElectricity.SubsystemTerrain.Terrain.GetCellValue(cellFace.X, cellFace.Y, cellFace.Z)));
            Vector3  v            = new Vector3((float)cellFace.X + 0.5f, (float)cellFace.Y + 0.5f, (float)cellFace.Z + 0.5f);

            m_glowPoint.Position    = v - 0.4375f * CellFace.FaceToVector3(mountingFace);
            m_glowPoint.Forward     = CellFace.FaceToVector3(mountingFace);
            m_glowPoint.Up          = ((mountingFace < 4) ? Vector3.UnitY : Vector3.UnitX);
            m_glowPoint.Right       = Vector3.Cross(m_glowPoint.Forward, m_glowPoint.Up);
            m_glowPoint.Color       = Color.Transparent;
            m_glowPoint.Size        = 0.0324f;
            m_glowPoint.FarSize     = 0.0324f;
            m_glowPoint.FarDistance = 0f;
            m_glowPoint.Type        = GlowPointType.Square;
        }
        public override void OnAdded()
        {
            CellFace cellFace     = base.CellFaces[0];
            int      data         = Terrain.ExtractData(base.SubsystemElectricity.SubsystemTerrain.Terrain.GetCellValue(cellFace.X, cellFace.Y, cellFace.Z));
            int      mountingFace = FourLedBlock.GetMountingFace(data);

            m_color = LedBlock.LedColors[FourLedBlock.GetColor(data)];
            Vector3 v       = new Vector3((float)cellFace.X + 0.5f, (float)cellFace.Y + 0.5f, (float)cellFace.Z + 0.5f);
            Vector3 vector  = CellFace.FaceToVector3(mountingFace);
            Vector3 vector2 = (mountingFace < 4) ? Vector3.UnitY : Vector3.UnitX;
            Vector3 right   = Vector3.Cross(vector, vector2);

            m_glowPoint             = m_subsystemGlow.AddGlowPoint();
            m_glowPoint.Position    = v - 0.4375f * CellFace.FaceToVector3(mountingFace);
            m_glowPoint.Forward     = vector;
            m_glowPoint.Up          = vector2;
            m_glowPoint.Right       = right;
            m_glowPoint.Color       = Color.Transparent;
            m_glowPoint.Size        = 0.52f;
            m_glowPoint.FarSize     = 0.52f;
            m_glowPoint.FarDistance = 1f;
            m_glowPoint.Type        = GlowPointType.Square;
        }
Esempio n. 4
0
 public void RemoveGlowPoint(GlowPoint glowPoint)
 {
     m_glowPoints.Remove(glowPoint);
 }