Ejemplo n.º 1
0
    private void ResetTurnFunction()
    {
        ResetSimulation();
        OrganSettlementManager MyMan      = gameObject.GetComponent <OrganSettlementManager>();
        List <GameObject>      Obj2Unlist = new List <GameObject>();

        foreach (GameObject orgObj in MyMan.GetInstantiatedOrgans())
        {
            Organ org = orgObj.GetComponent <Organ>();
            org.OnResetTurn();
            if (org.GetBuildTurn() == roundCount)
            {
                Refund(org.resourcesType);
                LineDrawer.ClearOrganRelations(org.GetBuildTurn());
                Obj2Unlist.Add(orgObj);
                Destroy(orgObj);
            }
            else
            {
                org.OnSimulateReward();
            }
        }
        foreach (GameObject orgObj in Obj2Unlist)
        {
            MyMan.GetInstantiatedOrgans().Remove(orgObj);
        }
        MyMan.OnResetTurn();
    }