Beispiel #1
0
    void Awake()
    {
        if (_inst != null)
        {
            Debug.LogError("Duplicated TownManager");
        }
        else
        {
            _inst = this;
        }
        _playersInTown  = new System.Collections.Generic.Dictionary <string, HeroInstance>();
        _friendBornSeed = 0;

        // TownPlayerManger itself is path manager as well.
        LevelManager.Singleton.PathManager = gameObject;

        // create root node for players.
        _charactersRoot = Utils.NewGameObjectWithParent("Characters");

        // disable camera before initialize completed.
        //_townCamera.gameObject.SetActive(false);
        DynamicAssetLoader daloader = InJoy.AssetBundles.AssetBundles.Load(_dynamicAssetPath, typeof(DynamicAssetLoader)) as DynamicAssetLoader;

        if (daloader != null)
        {
            daloader.LoadAllAssets(_dynamicAssetParent);
        }
    }
Beispiel #2
0
 void OnDestroy()
 {
     if (_inst == this)
     {
         _inst = null;
     }
     _playersInTown.Clear();
 }
Beispiel #3
0
 void OnEnable()
 {
     _myTarget  = target as TownPlayerManager;
     _pntlength = _myTarget._friendBornPoints == null ? 0 : _myTarget._friendBornPoints.Length;
 }