Esempio n. 1
0
 private void Awake()
 {
     instance = this;
     if (textTextObj == null)
     {
         textTextObj = textObj.transform.Find("TextUI-text").gameObject;
     }
     if (textEndObj == null)
     {
         textEndObj = textObj.transform.Find("TextUI-end").gameObject;
     }
     nowText = textTextObj.GetComponent <Text>();
     nowName = textCharaNameObj.GetComponent <Text>();
 }
Esempio n. 2
0
        protected override void LoadContent()
        {
            Error       = Content.Load <Model>("Error");
            spriteBatch = new SpriteBatch(GraphicsDevice);
            for (int i = 0; i < _3DRadSpaceGame.MAX_OBJECTS; i++)
            {
                string obj = project[i].ToString();
                switch (obj.Split(' ')[0])
                {
                case "Camera":
                {
                    Vector3 pos = new Vector3(Convert.ToSingle(obj.Split(' ')[3]), Convert.ToSingle(obj.Split(' ')[4]), Convert.ToSingle(obj.Split(' ')[5]));
                    Objects[i] = new Camera(
                        obj.Split(' ')[1],
                        Convert.ToBoolean(obj.Split(' ')[2]),
                        pos,
                        Vector3.Zero,             //Vector3.Transform(pos, Matrix.CreateFromYawPitchRoll(MathHelper.ToRadians(Convert.ToSingle(obj.Split(' ')[7])),MathHelper.ToRadians( Convert.ToSingle(obj.Split(' ')[6])), MathHelper.ToRadians(Convert.ToSingle(obj.Split(' ')[8])))),
                        MathHelper.ToRadians(Convert.ToSingle(obj.Split(' ')[9])),
                        Convert.ToSingle(obj.Split(' ')[11])
                        );
                    break;
                }

                case "SkyColor":
                {
                    Color color = new Color(Convert.ToUInt32(obj.Split(' ')[3]), Convert.ToUInt32(obj.Split(' ')[4]), Convert.ToUInt32(obj.Split(' ')[5]));
                    Objects[i] = new SkyColor(
                        obj.Split(' ')[1],
                        Convert.ToBoolean(obj.Split(' ')[2]),
                        color
                        );
                    break;
                }

                case "Skinmesh":
                {
                    Vector3 pos    = new Vector3(Convert.ToSingle(obj.Split(' ')[3]), Convert.ToSingle(obj.Split(' ')[4]), Convert.ToSingle(obj.Split(' ')[5]));
                    Vector3 rot    = new Vector3(Convert.ToSingle(obj.Split(' ')[6]), Convert.ToSingle(obj.Split(' ')[7]), Convert.ToSingle(obj.Split(' ')[8]));
                    string  res    = "";
                    int     length = obj.Split(' ').Length;
                    for (int j = 10; j < length; j++)
                    {
                        res += obj.Split(' ')[j];
                        if (j != length - 1)
                        {
                            res += " ";
                        }
                    }
                    Objects[i] = new SkinMesh(obj.Split(' ')[1],
                                              Convert.ToBoolean(obj.Split(' ')[2]),
                                              res, pos, rot);
                    break;
                }

                case "TextPrint":
                {
                    Color clr = new Color(Convert.ToInt32(obj.Split(' ')[5]),
                                          Convert.ToInt32(obj.Split(' ')[6])
                                          , Convert.ToInt32(obj.Split(' ')[7])
                                          );
                    string text = "";
                    for (int j = 8; j < obj.Split(' ').Length; j++)
                    {
                        text += obj.Split(' ')[j];
                    }
                    Vector3 loc = new Vector3(Convert.ToInt32(obj.Split(' ')[4]),
                                              Convert.ToInt32(obj.Split(' ')[5]), 0);

                    Objects[i] = new TextPrint(obj.Split(' ')[1], Convert.ToBoolean(obj.Split(' ')[2]), Content, loc, text, clr);
                    break;
                }

                case "Fog":
                {
                    Vector3 clr = new Vector3(Convert.ToInt32(obj.Split(' ')[3]),
                                              Convert.ToInt32(obj.Split(' ')[4])
                                              , Convert.ToInt32(obj.Split(' ')[5])
                                              );
                    Objects[i] = new Fog(obj.Split(' ')[1], Convert.ToBoolean(obj.Split(' ')[2])
                                         , clr, Convert.ToSingle(obj.Split(' ')[6]), Convert.ToSingle(obj.Split(' ')[7]));
                    break;
                }

                default: break;
                }
                AllObjectsInitialize();
            }
        }