Esempio n. 1
0
    public void gardenDecorBuildConfirmed()
    {
        string longLat = VectorExtensions.GetGeoPosition(
            tweakedGardenDecor.transform.position,
            Map.GetComponent <BasicMap>().CenterMercator,
            Map.GetComponent <BasicMap>().WorldRelativeScale
            ).ToString();

        BaseGardenDecor newDecor = new BaseGardenDecor(gardenDecorToBuild.gardenDecorType, longLat, 0);

        newDecor.yRotation = tweakedGardenDecor.transform.rotation.eulerAngles.y;
        newDecor.scale     = tweakedGardenDecor.transform.localScale.x;
        newDecor.variation = tweakedGardenDecor.GetComponent <GardenDecorWorld>().representedDecor.variation;
        newDecor.yOffset   = tweakedGardenDecor.transform.localPosition.y - 0.2f;
        PetKeeper.pet.Base.baseGardenDecors.Add(newDecor);

        tweakedGardenDecor.GetComponent <GardenDecorWorld>().init(newDecor);

        PetKeeper.pet.buildingMaterials -= gardenDecorToBuild.bmCost;
        PetKeeper.pet.inventory.gardenDecorCounts[(int)gardenDecorToBuild.gardenDecorType] -= 1;

        queueRewardText("Built Decor!", new Color(0.7f, 0.7f, 0.7f, 1));

        isTweakingGardenDecor = false;

        PetKeeper.pet.Save(false);

        exitModePressed();
    }
Esempio n. 2
0
    public virtual void init(BaseGardenDecor representedDecor)
    {
        this.representedDecor = representedDecor;

        delayedSpawnTime = UnityEngine.Random.Range(0.5f, 1.5f);

        updateVisual();
    }