示例#1
0
    public void Initialize(int widthNum, int heightNum, float widthDistance, float heightDistance, bool isStartModule, MapManager mapManager)
    {
        this.widthNum       = widthNum;
        this.heightNum      = heightNum;
        this.widthDistance  = widthDistance;
        this.heightDistance = heightDistance;
        this.isStartModule  = isStartModule;
        if (isStartModule == true)
        {
            MaskOff();
            EndWave();
        }

        if (boxcollider2D != null)
        {
            boxcollider2D.size   = new Vector2((widthNum + 2) * widthDistance, (heightNum + 2) * heightDistance);
            boxcollider2D.offset = new Vector2(-widthDistance / 2, -heightDistance / 2);
            SetMaskSize(boxcollider2D.offset, new Vector2((widthNum - 2) * widthDistance, (heightNum - 2) * heightDistance));
        }

        this.mapManager = mapManager;

        if (mapManager != null)
        {
            mapManager.AddToModuleList(this);
        }
    }
示例#2
0
 public void AddToMapManager(MapManager manager)
 {
     manager.AddToModuleList(this);
 }