示例#1
0
 void UpdateClock()
 {
     TimeCheck        = Time.time;
     PreviousPosition = NetworkInstance.Position;
     PreviousRotation = NetworkInstance.RotationEuler;
     PreviousVelocity = NetworkInstance.Velocity;
 }
    public static SerialVector3[] ToVector2Array(UnityEngine.Vector3[] vects)
    {
        if (null == vects)
        {
            return(null);
        }

        SerialVector3[] temp =
            new SerialVector3[vects.Length];

        for (int index = vects.Length - 1; index >= 0; --index)
        {
            temp[index] = vects[index];
        }

        return(temp);
    }
示例#3
0
    public bool ServerOwned; //True implies the server owns this object, else implies the client controls this e.g. their own player

    // Start is called before the first frame update
    void Start()
    {
        NetworkInstance.Position      = transform.position;
        NetworkInstance.Velocity      = new SerialVector3(0, 0, 0);
        NetworkInstance.RotationEuler = transform.rotation.eulerAngles;
        NetworkInstance.ObjectID      = ID;
        NetworkInstance.Player        = Player;
        NetworkInstance.ServerOwned   = ServerOwned;

        PreviousPosition = transform.position;
        PreviousVelocity = new SerialVector3(0, 0, 0);
        PreviousRotation = transform.rotation.eulerAngles;

        if (Player)
        {
            PlayerAccess = GetComponent <PlayerController>();
        }

        rigid = GetComponent <Rigidbody>();
    }
示例#4
0
 public GameObjects(SerialVector3 pos, int objectID, SerialVector3 V, SerialVector3 RotationE)
 {
     Position      = pos;
     Velocity      = V;
     RotationEuler = RotationE;
 }
示例#5
0
 public GameObjects(SerialVector3 pos, int objectID)
 {
     Position = pos;
 }
示例#6
0
 public EnemyInfo(SerialVector3 spawnPos, int type, float percHealth)
 {
     this.spawnPos = spawnPos; this.type = type; this.percHealth = percHealth;
 }
示例#7
0
 public WorldInfo(float[] seeds, SerialVector3 playerPos)
 {
     this.seeds     = seeds;
     this.playerPos = playerPos;
 }