public virtual void Init(int id, int roomId, string name, float positionx, float positiony, float positionz, int zorder, string imageFile) { this.id = id; this.roomId = roomId; this.name = name; this.state = GameConst.ObjectState.Deactivate; gameObject.name = name; SpriteRenderer render = GetComponent <SpriteRenderer>(); render.sortingOrder = zorder; position = new Vector3(positionx, positiony, GameConst.MapElementZ); imageName = imageFile; gameObject.transform.position = new Vector3(positionx, positiony, positionz); }
void Awake() { state = GameConst.ObjectState.None; }