Exemplo n.º 1
0
    public void DebugCreateVillage(Vector3 targetPosition)
    {
        float maxRadius = villageGeneratorData.spawnRadius.RandomSample();

        GameObject dummyObj = new GameObject("dummy object");

        dummyObj.transform.position = targetPosition;
        UtilityFunctions.PutObjectOnGround(dummyObj.transform);
        targetPosition = dummyObj.transform.position;
        Destroy(dummyObj);

        var newVillage = villageGenerator.GenerateVillage(targetPosition, maxRadius, "DebugVillage");

        Regions.Add(newVillage);
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        VillagerAlert = Instantiate(new GameObject()) as GameObject;
        VillagerAlert.AddComponent <SpriteRenderer>();
        VillagerAlert.GetComponent <SpriteRenderer> ().sprite          = Resources.Load <Sprite> ("Sprites/People/Man_Alert");
        VillagerAlert.GetComponent <SpriteRenderer>().sortingLayerName = "AlertMessage";

        VillagerAlert.transform.localScale = new Vector3(-0.5f, 0.5f, 0.5f);
        VillagerAlert.transform.position   = new Vector3(-11, -5, 0);
        VillagerAlert.SetActive(false);

        population = 3;

        villagerImporter = new VillagerImporter();

        VillageGenRef.GenerateVillage((int)population);

        foodSupply  = 100;
        waterSupply = 100;

        foodGain  = 3;
        waterGain = 3;

        happiness = 50;

        sickness = 0;

        Villagers = new List <GameObject>();
        //If the new Population is greater then create more
        for (int i = 0; i < population; i++)
        {
            AddVillager();
            // Debug.Log("DRAWING VILLAGER");
        }

        for (int i = 0; i < foodSupply; i += 20)
        {
            AddCow();
        }
    }