コード例 #1
0
 //public Dictionary<GameObject, >
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(this);
     }
     instance = this;
 }
コード例 #2
0
 private void OnEnable()
 {
     PlantingManager.RegisterPlantingSpace(this, true);
     mesh         = GetComponent <MeshFilter>().mesh;
     bounds       = mesh.bounds;
     planterTiles = new List <PlanterTile>();
     GeneratePlanterTiles();
 }
コード例 #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);
     }
 }
コード例 #4
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (PlantCheck())
     {
         PlantingManager.PickPlant(this.gameObject);
     }
     else
     {
         parent = this.gameObject;
         print("Spot empty");
         UIManager.ShowUiElement("PlantPicker", "UI");
     }
 }
コード例 #5
0
    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());
            }
        }
    }
コード例 #6
0
 private void Start()
 {
     plantList = new List <GameObject>();
     instance  = this;
 }