Hello Guest

Author Topic: 2D Toolkit and Git  (Read 21477 times)

piscopo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: 2D Toolkit and Git
« Reply #15 on: January 02, 2018, 05:46:21 pm »
Thank you for the clarification. :)

danmerey

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: 2D Toolkit and Git
« Reply #16 on: January 08, 2018, 04:32:33 pm »
So you say I should "Rebuild Index" every time I push something related to tk2d?

What should I do if I need to auto-build my project (for example I use Unity Cloud Build for fast iOS builds)? I get a lot of "broken builds" sometimes and can't do anything with it (some atlases just corrupted, sprites a sliced and messed up).

Can this "Rebuild Index" happen by itself without manual pressing button? Or at least every time before build or something like that?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: 2D Toolkit and Git
« Reply #17 on: January 17, 2018, 10:38:59 pm »
Hi,

It should pick up and rebuild the index when it detects changes - but I have seen this fail occasionally due to dates not propagating thru, etc. In this case however, you could try making it Rebuild automatically. For example, just before a build is started...

Code: [Select]
using UnityEditor;
using UnityEditor.Build;
using UnityEngine;

class tk2dRebuildIndexPreprocessor : IPreprocessBuild
{
    public int callbackOrder { get { return 0; } }
    public void OnPreprocessBuild(BuildTarget target, string path)
    {
          tk2dEditorUtility.RebuildIndex();
    }
}