예제 #1
0
    public void OnEnable()
    {
        if (Player.curRegion == null)
        {
            return;
        }
        data = Player.curRegion.data;

        image.sprite = SpriteHandler.GetBuilding(BuildIndex, (int)Player.curPlayer.fraction);

        UpdateState();
        Player.curPlayer.TreasureChange += UpdateState;
        CurBuildAction = data.BuildingAction[BuildIndex];
        if (CurBuildAction != null)
        {
            CurBuildAction.onAction += UpdateState;
        }
    }