예제 #1
0
 private void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
     }
 }
예제 #2
0
 public void CreateProgressBar()
 {
     ProgressBar = Instantiate(ProgressBarPreFab) as TileUI;
     if (ProgressBar != null)
     {
         ProgressBar.SetPosition(this);
     }
 }
예제 #3
0
 public void RemoveProgressBar()
 {
     if (ProgressBar != null)
     {
         Destroy(ProgressBar.gameObject);
         ProgressBar = null;
     }
 }
예제 #4
0
파일: Tile.cs 프로젝트: RZNewman/Conflict
 // Start is called before the first frame update
 void Start()
 {
     col        = GetComponent <Collider>();
     tileHeight = col.bounds.extents.y;
     unitUI     = transform.GetChild(0).GetComponent <TileUI>();
     //Debug.Log(unitUI);
     fillPresets();
     colorSelf();
 }
예제 #5
0
    void UpdateUI()
    {
        if (currentTileUI == null)
        {
            TileUICanvas = GameObject.FindGameObjectWithTag("TileUICanvas").transform;
            GameObject tileUIObj = Instantiate <GameObject>(MainController.TileUIPrefab, transform.localPosition, Quaternion.identity, TileUICanvas);
            currentTileUI = tileUIObj.GetComponent <TileUI>();
        }

        TileItem item = null;

        if (currentTile != null && currentTile.Type != TileType.NONE && currentTile.Item != null && currentTile.Item.ItemType != TileItemType.NONE)
        {
            item = TileItemInfo.Get(currentTile.Item.ItemType);
        }

        currentTileUI.UpdateDisplay(item);
    }