Beispiel #1
0
        public WorldBase()
        {
#if Client
            TickSystem.AddTick(this);
#elif Server
            Server.Tick += Tick;
#endif
        }
Beispiel #2
0
        public Entity()
        {
#if Client
            TickSystem.AddTick(this);
#elif Server
            Server.Tick += Tick;
#endif

            transform = new Transform();
            OnConstruc();

            Debug.Log("Entity Creator1");
        }
Beispiel #3
0
        /// <summary>
        /// this is for network, instance entity and setup netview
        /// </summary>
        /// <param name="entity"></param>
        public Entity(NetViewSerializer entity)
        {
#if Client
            TickSystem.AddTick(this);
#elif Server
            Server.Tick += Tick;
#endif

            transform = new Transform();

            transform.Position = new Vector3(entity.p_x, entity.p_y, entity.p_z);
            transform.Rotation = new Quaternion(entity.r_x, entity.r_y, entity.r_z, 0);

            SetUpNet(entity.ViewID, entity.Owner, NetDeliveryMethod.Unreliable);
            OnConstruc();
            Debug.Log("Entity Creator2");
        }
        public Chunk(Vector3 position)
        {
            transform = new Transform();
            System.Random rand = new System.Random();

            transform.Position = position;

            blocks = new Block[MidleWorld.ChunkSize, MidleWorld.ChunkSize];

            LockActionUpdateMEsh = new object();

            FirstChunkPopulation = true;

            double a = rand.NextDouble();
            double b = rand.NextDouble();

            ChunkSeed = transform.Position.X * a + transform.Position.Z * b + 0;

            TickSystem.AddTick(this);

            PopulateVoxel();
        }