Esempio n. 1
0
 void ResetMatrixManager()
 {
     tileDmgMask                = LayerMask.GetMask("Windows", "Walls");
     Instance.spaceMatrix       = null;
     Instance.mainStationMatrix = null;
     MovableMatrices.Clear();
     ActiveMatrices.Clear();
     movingMatrices.Clear();
     wallsTileMaps.Clear();
     trackedIntersections.Clear();
 }
Esempio n. 2
0
    private void RegisterMatrix(Matrix matrix)
    {
        var matrixInfo = CreateMatrixInfoFromMatrix(matrix, matrix.NetworkedMatrix.MatrixSync.matrixID);

        ActiveMatrices.Add(matrixInfo.Id, matrixInfo);

        if (matrixInfo.MatrixMove != null)
        {
            MovableMatrices.Add(matrixInfo);
        }

        matrix.Id = matrixInfo.Id;

        if (matrix.IsSpaceMatrix)
        {
            if (spaceMatrix == null)
            {
                spaceMatrix = matrix;
            }
            else
            {
                Logger.Log("There is already a space matrix registered", Category.Matrix);
            }
        }

        if (matrix.IsMainStation)
        {
            if (mainStationMatrix == null)
            {
                mainStationMatrix = matrix;
            }
            else
            {
                Logger.Log("There is already a main station matrix registered", Category.Matrix);
            }
        }

        if (matrix.IsLavaLand)
        {
            if (lavaLandMatrix == null)
            {
                lavaLandMatrix = matrix;
            }
            else
            {
                Logger.Log("There is already a lava land matrix registered", Category.Matrix);
            }
        }

        matrix.ConfigureMatrixInfo(matrixInfo);
        InitCollisions(matrixInfo);
    }