1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using System.Threading.Tasks;
public class newspawn_real : MonoBehaviour {
// Use this for initialization
void Start () {
int maxgeneration_in_csharp = 150;
int popsize_in_csharp = 50;
int genesize_in_csharp = 20;
int[,,] bam = new int[maxgeneration_in_csharp, popsize_in_csharp, genesize_in_csharp];
int[,,] pam = new int[maxgeneration_in_csharp, popsize_in_csharp, genesize_in_csharp];
unsafe
{
fixed (int * p = &bam[0, 0, 0])
{
CppWrapper.CppWrapperClass controlCpp = new CppWrapper.CppWrapperClass();
controlCpp.allocate_both();
controlCpp.fill_both();
controlCpp.fill_wrapper();
for (int i = 0; i<maxgeneration_in_csharp; i++)
for(int j = 0; j<popsize_in_csharp; j++)
for(int k = 0; k<genesize_in_csharp; k++)
bam[i, j, k] = controlCpp.ba_array_in_wrapper[i][j][k]; // mxolod bacteria
for (int i = 0; i<maxgeneration_in_csharp; i++)
for (int j = 0; j<popsize_in_csharp; j++)
for (int k = 0; k<genesize_in_csharp; k++)
pam[i, j, k] = controlCpp.pa_array_in_wrapper[i][j][k];
controlCpp.delete_both();
}
}
for (int i = 148; i< 149; i++)
for (int j = 0; j< 50; j++)
{
/*for (int k = 0; k< 20; k++)
Console.Write( bam[i, j, k]);
Console.WriteLine();
*/
}
for (int i = 148; i< 149; i++)
for (int j = 0; j< 50; j++)
{
/*
for (int k = 0; k< 20; k++)
Console.Write(pam[i, j, k]);
Console.WriteLine();
*/
}
}
// Update is called once per frame
void Update () {
}
}
|