Exemple #1
0
 //public Dictionary<GameObject, >
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(this);
     }
     instance = this;
 }
 private void OnEnable()
 {
     PlantingManager.RegisterPlantingSpace(this, true);
     mesh         = GetComponent <MeshFilter>().mesh;
     bounds       = mesh.bounds;
     planterTiles = new List <PlanterTile>();
     GeneratePlanterTiles();
 }
Exemple #3
0
 private void Awake()
 {
     Debug.Log("Initialize Plant Manager. Bow down to your plant god, peasant");
     if (plantGod == null)
     {
         plantGod = this;
     }
     else
     {
         Destroy(this);
     }
 }
Exemple #4
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (PlantCheck())
     {
         PlantingManager.PickPlant(this.gameObject);
     }
     else
     {
         parent = this.gameObject;
         print("Spot empty");
         UIManager.ShowUiElement("PlantPicker", "UI");
     }
 }
    private void Update()
    {
        previousPosition = PlayerPosition;
        if (Input.GetKeyDown(KeyCode.T))
        {
            //    this.SetValue("playerData.playerName", "Billy-Bob");
            // bool nestedEval = this.EvaluateValue("playerData.playerName", "Billy", true);
            //  if (nestedEval) { Debug.Log(playerData.playerName + ": " + nestedEval); }

            if (PlantingManager.NearestPlantingSpace != null)
            {
                PlantingSpace space = PlantingManager.NearestPlantingSpace;
                space.Plant(PlantingManager.GetRandomPlant());
            }
        }
    }
Exemple #6
0
 private void Start()
 {
     plantList = new List <GameObject>();
     instance  = this;
 }