zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Server/Model/Game/Entity/UnitScene.cs

47 lines
982 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace ET
{
public class UnitSceneAwakeSystem : AwakeSystem<UnitScene,int>
{
public override void Awake(UnitScene self,int mappId)
{
self.MapId = mappId;
}
}
[BsonIgnoreExtraElements]
public partial class UnitScene: Entity,ISerializeToEntity
{
[BsonRepresentation(BsonType.Double, AllowTruncation = true)]
public float X;
[BsonRepresentation(BsonType.Double, AllowTruncation = true)]
public float Y;
[BsonIgnore]
2021-04-10 19:49:32 +08:00
public long enterTime;
[BsonIgnore]
public Vector2 targetPos;
2021-04-08 20:09:59 +08:00
[BsonIgnore]
2021-04-10 19:49:32 +08:00
public bool isMoved;
2021-05-01 11:27:41 +08:00
[BsonIgnore]
public int sceneId => this.MapId / 100;
[BsonIgnore]
public int layerId => this.MapId %100;
2021-04-10 19:49:32 +08:00
[BsonIgnore]
2021-04-08 20:09:59 +08:00
public Vector2 Position {
get => new Vector2(X, Y);
set
{
X = value.x;
Y = value.y;
}
}
}
}