Example #1
0
    public int GetBirthCost()
    {
        PrefabLoaderWrapper_script pl = PrefabLoaderWrapper_script.GetPL();
        List <Gene> Genes             = GetGenes();

        int sum = 0;

        foreach (Gene gene in Genes)
        {
            string type = gene.GetCellType().ToString();

            if (type == "None")
            {
                continue;
            }

            GameObject cell = pl.Load(type, "cells");
            if (cell == null)
            {
                continue;
            }
            sum += cell.GetComponent <Cell_script>().GetStartCost();
        }
        return(sum);
    }
    // Use this for initialization
    void Start()
    {
        pl   = PrefabLoaderWrapper_script.GetPL();
        Seed = pl.Load("Seed");

        CreateOrganisms();
    }
Example #3
0
    void Awake()
    {
        pl = PrefabLoaderWrapper_script.GetPL();
        if (customDNA != null)
        {
            DNA = new DNA(DNAU.GeneEntries2GeneList(customDNA));
        }

        OrganismPrefab = pl.Load("Organism");
    }
    public int CalcBirthReq(PrefabLoaderWrapper_script pl)
    {
        int ret = 0;
        List <IDictionary <string, int> > parsedDNA = ParseDNA();

        foreach (IDictionary <string, int> e in parsedDNA)
        {
            string type = GetCellById(e["type"]);

            GameObject cell = pl.Load(type, "cells");
            if (cell == null)
            {
                continue;
            }
            ret += cell.GetComponent <Cell_script>().GetStartCost();
        }
        return(ret);
    }
    public void Awake()
    {
        pl = PrefabLoaderWrapper_script.GetPL();

        FiveSecondLooper.Add(CheckBirth);
    }
Example #6
0
 private void Awake()
 {
     pl = PrefabLoaderWrapper_script.GetPL();
 }