Esempio n. 1
0
 public void HideSymbols()
 {
     if (!((Object)EntityPrefabs.Instance == (Object)null) && !isForeground)
     {
         KAnimFile[] animFiles = controller.AnimFiles;
         bool        flag      = IsAnimLayered(animFiles);
         if (flag && (Object)foregroundController == (Object)null && layer != Grid.SceneLayer.NoLayer)
         {
             GameObject gameObject = Util.KInstantiate(EntityPrefabs.Instance.ForegroundLayer, controller.gameObject, null);
             gameObject.name                = controller.name + "_fg";
             foregroundController           = gameObject.GetComponent <KAnimControllerBase>();
             foregroundController.AnimFiles = animFiles;
             foregroundController.GetLayering().SetIsForeground(true);
             foregroundController.initialAnim = controller.initialAnim;
             link = new KAnimLink(controller, foregroundController);
             Dirty();
             KAnimSynchronizer synchronizer = controller.GetSynchronizer();
             synchronizer.Add(foregroundController);
             synchronizer.Sync(foregroundController);
             float   layerZ    = Grid.GetLayerZ(layer);
             Vector3 position  = controller.gameObject.transform.GetPosition();
             Vector3 position2 = new Vector3(0f, 0f, layerZ - position.z - 0.1f);
             gameObject.transform.SetLocalPosition(position2);
             gameObject.SetActive(true);
         }
         else if (!flag && (Object)foregroundController != (Object)null)
         {
             controller.GetSynchronizer().Remove(foregroundController);
             foregroundController.gameObject.DeleteObject();
             link = null;
         }
         if ((Object)foregroundController != (Object)null)
         {
             HideSymbolsInternal();
             foregroundController.GetLayering()?.HideSymbolsInternal();
         }
     }
 }