Beispiel #1
0
        public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
        {
            if (chunk.Has(addOneTypeHandle))
            {
                var addOneChunk = chunk.GetNativeArray(addOneTypeHandle);

                for (var i = 0; i < addOneChunk.Length; i++)
                {
                    var addOneComp = addOneChunk[i];
                    addOneChunk[i] = new AddOne {
                        Value = (int)math.asin(math.exp(math.sin(math.sqrt(addOneComp.Value)) + 1))
                    };
                }
            }

            if (chunk.Has(addTwoTypeHandle))
            {
                var addTwoChunk = chunk.GetNativeArray(addTwoTypeHandle);

                for (var i = 0; i < addTwoChunk.Length; i++)
                {
                    var addTwoComp = addTwoChunk[i];
                    addTwoChunk[i] = new AddTwo {
                        Value = (int)math.asin(math.exp(math.sin(math.sqrt(addTwoComp.Value)) + 2))
                    };
                }
            }

            if (chunk.Has(addThreeTypeHandle))
            {
                var addThreeChunk = chunk.GetNativeArray(addThreeTypeHandle);

                for (var i = 0; i < addThreeChunk.Length; i++)
                {
                    var addThreeComp = addThreeChunk[i];
                    addThreeChunk[i] = new AddThree {
                        Value = (int)math.asin(math.exp(math.sin(math.sqrt(addThreeComp.Value)) + 3))
                    };
                }
            }

            if (chunk.Has(addFourTypeHandle))
            {
                var addFourChunk = chunk.GetNativeArray(addFourTypeHandle);

                for (var i = 0; i < addFourChunk.Length; i++)
                {
                    var addFourComp = addFourChunk[i];
                    addFourChunk[i] = new AddFour {
                        Value = (int)math.asin(math.exp(math.sin(math.sqrt(addFourComp.Value)) + 4))
                    };
                }
            }
        }
        public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
        {
            var addTwoChunk = chunk.GetNativeArray(addTwoTypeHandle);

            for (var i = 0; i < addTwoChunk.Length; i++)
            {
                var addTwoComp = addTwoChunk[i];
                addTwoChunk[i] = new AddTwo {
                    Value = (int)math.asin(math.exp(math.sin(math.sqrt(addTwoComp.Value)) + 2))
                };
            }
        }