47 lines
982 B
C#
47 lines
982 B
C#
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]
|
|
public long enterTime;
|
|
[BsonIgnore]
|
|
public Vector2 targetPos;
|
|
[BsonIgnore]
|
|
public bool isMoved;
|
|
|
|
[BsonIgnore]
|
|
public int sceneId => this.MapId / 100;
|
|
[BsonIgnore]
|
|
public int layerId => this.MapId %100;
|
|
[BsonIgnore]
|
|
public Vector2 Position {
|
|
|
|
get => new Vector2(X, Y);
|
|
set
|
|
{
|
|
X = value.x;
|
|
Y = value.y;
|
|
}
|
|
}
|
|
}
|
|
} |