Ejemplo n.º 1
0
 public Player(int anID, string aName, float playerHealth, float aSpeed, Vector3 aPos, Quaternion aRot) :
     base(aName, anID, aSpeed)
 {
     health   = playerHealth;
     vect3Ser = vect3Ser.returnVector3Ser(aPos);
     quatSer  = quatSer.returnQuaternionSer(aRot);
 }
Ejemplo n.º 2
0
    public void Encode()
    {
        Road Rd = Road.Instance;

        StartingLineSegIdx = Rd.StartingLineSegIdx;
        BuilderPos         = new Vector3Serial(Rd.BuilderPos);
        BuilderRot         = new QuaternionSerial(Rd.BuilderRot);
        IsCircular         = Rd.IsCircular;
        XSecs = new XSecSerial[Rd.XSecs.Count];
        for (int Idx = 0; Idx < Rd.XSecs.Count; Idx++)
        {
            XSecSerial XS = new XSecSerial();
            XS.Encode(Rd.XSecs[Idx]);
            XSecs[Idx] = XS;
        }

        Sectns = new RoadSectionSerial[Rd.Sectns.Count];
        for (int Idx = 0; Idx < Rd.Sectns.Count; Idx++)
        {
            RoadSectionSerial RSS = new RoadSectionSerial();
            RSS.Encode(Rd.Sectns[Idx]);
            Sectns[Idx] = RSS;
        }

        Segs = new RoadSegmentSerial[Rd.Segments.Count];
        for (int Idx = 0; Idx < Rd.Segments.Count; Idx++)
        {
            RoadSegmentSerial SegS = new RoadSegmentSerial();
            SegS.Encode(Rd.Segments[Idx]);
            Segs[Idx] = SegS;
        }
    }
Ejemplo n.º 3
0
 public Player()
 {
     base.setID(0);
     base.setName("unnamed");
     health   = 100.0f;
     vect3Ser = vect3Ser.returnVector3Ser(Vector3.zero);
     quatSer  = quatSer.returnQuaternionSer(new Quaternion(0, 0, 0, 0));
     base.setSpeed(0);
 }
Ejemplo n.º 4
0
 public void Encode(PlaceableObject Obj)
 {
     Type        = Obj.GetType().ToString();
     prefab      = Obj.prefab;
     name        = Obj.name;
     pos         = new Vector3Serial(Obj.Pos);
     Scale       = new Vector3Serial(Obj.Scale);
     rot         = new QuaternionSerial(Obj.Rot);
     Addressable = Obj.Addressable;
 }
Ejemplo n.º 5
0
 //rotation set to the QuaternionSerial
 public void setRotation(QuaternionSerial aRot)
 {
     rotation = quatSer.setQuaternion(aRot.x,aRot.y,aRot.z,aRot.w);
 }
Ejemplo n.º 6
0
 //rotation set to the QuaternionSerial
 public void setRotation(QuaternionSerial aRot)
 {
     rotation = quatSer.setQuaternion(aRot.x, aRot.y, aRot.z, aRot.w);
 }