Exemple #1
0
        public IsometricMatrix(IsometricMatrixData isoData)
        {
            _isometricMatrix = _isometricReverseMatrix = float4x4.identity;
            _isometricData   = isoData;

            SetIsometricData(isoData);
        }
        /// <inheritdoc />
        protected override void OnCreateManager()
        {
            IsometricMatrixData.CreateSingleton(Resources.Load <IsometricMatrixData>("IsometricMatrixData"));
            RemoveUpdateComponent = false;

            base.OnCreateManager();
            _endSimulationBarrier = World.GetOrCreateSystem <EndSimulationEntityCommandBufferSystem>();
        }
Exemple #3
0
        public static IsometricMatrix CreateIsometricMatrix(IsometricMatrixData isoData)
        {
            var isoMatrix = new IsometricMatrix(new IsometricMatrix.IsometricMatrixData
            {
                OffsetWorldToIsometric = isoData._offsetWorldToIsometric,
                TileSize   = isoData._tileSize,
                TileRatio  = isoData._tileRatio,
                TileAngle  = isoData._tileAngle,
                TileHeight = isoData._tileHeight
            });

            return(isoMatrix);
        }
Exemple #4
0
        public static void CreateSingleton(IsometricMatrixData isoData)
        {
            if (World.Active == null)
            {
                World.Active = new World("Editor World");
            }

            var dstManager = World.Active.EntityManager;

            var singletonGroup = dstManager.CreateEntityQuery(typeof(IsometricMatrix));
            var matrix         = CreateIsometricMatrix(isoData);

            dstManager.AddComponentData(dstManager.CreateEntity(), matrix);
            singletonGroup.SetSingleton(matrix);
        }
Exemple #5
0
 public void SetIsometricData(IsometricMatrixData isoData)
 {
     _isometricData = isoData;
     CalculIsometricMatrix();
 }