Ejemplo n.º 1
0
 void Start()
 {
     MeshBuffer  = gameObject.GetComponent <MeshFilter>().mesh;
     bm          = BuildManager.BuildManagerInstance;
     eo          = EventsObject.EventsObjectInstance;
     gp          = GamePlay.GamePlayInstance;
     NativeColor = gameObject.GetComponent <Renderer>().material.color;
 }
Ejemplo n.º 2
0
    void Awake()
    {
        if (EventsObjectInstance != null)
        {
            Debug.LogError("More than one EventsObject in the scene!");
            return;
        }

        EventsObjectInstance = this;
        bm = BuildManager.BuildManagerInstance;
    }
Ejemplo n.º 3
0
        public MappedEvents Map(EventsObject obj)
        {
            var mappedEvents = new MappedEvents
            {
                events = obj.Events.Select(eventObj => Map(eventObj)).ToList()
            };

            _logger.LogInformation("Events mapped successfully");

            return(mappedEvents);
        }
Ejemplo n.º 4
0
    public bool DestroyPoolGameObject(GameObject delGO)
    {
        if (delGO == null)
        {
            return(false);
        }
        if (string.IsNullOrEmpty(delGO.name))
        {
            return(false);
        }

        //TEST
        if (delGO.tag == "Portal")
        {
            Debug.Log("Delete portal");
        }
        //....

        EventsObject   evenObj  = delGO.GetComponent <EventsObject>();
        PoolGameObject itemPool = evenObj.PoolCase;

        if (itemPool != null)
        {
            //itemPool.Deactivate(delGO.name);
            itemPool.Deactivate();
            //return true;
        }
        else
        {
            Debug.Log("########### PoolCase IS NULL");
            return(false);
        }


        if (IsStack)
        {
            if (itemPool != null)
            {
                //itemPool.Deactivate(delGO.name);
                PoolGamesObjectsStack[itemPool.Tag].Push(itemPool);
            }
        }

        return(true);
    }
Ejemplo n.º 5
0
        public async Task StartService()
        {
            while (true)
            {
                try
                {
                    _apiEvents = await _eventDataHandler.LoadAndSaveData();

                    _mappedEvents = _eventMapping.Map(_apiEvents);

                    await _distributionService.Distribute(_mappedEvents);

                    _logger.LogInformation("EventsSevice successfully run");
                }

                catch (Exception ex)
                {
                    _logger.LogError("EventsService  " + ex.StackTrace);
                    throw;
                }

                Thread.Sleep(5000);
            }
        }
Ejemplo n.º 6
0
    public GameObject GetPoolGameObject(string nameObject, string tagPool, Vector3 pos)
    {
        GameObject findGO = null;

        PoolGameObject findPoolGO      = null;
        int            contUnlockPools = 0;

        if (PoolGamesObjectsStack.ContainsKey(tagPool))
        {
            contUnlockPools = PoolGamesObjectsStack[tagPool].Count;
            if (contUnlockPools > 0)
            {
                //#TEST
                int countInPool = PoolGamesObjectsStack[tagPool].Count;


                if (countInPool == 1)
                {
                    AddPoolNewTypeObject(tagPool, false);
                }

                findPoolGO     = PoolGamesObjectsStack[tagPool].Pop();
                findPoolGO.Tag = tagPool;//$$$$ //#FIX ELKA

                if (findPoolGO == null)
                {
                    Debug.Log("######## findPoolGO==null");
                }
                if (findPoolGO.GameObjectNext == null)
                {
                    Debug.Log("######## findPoolGO.GameObjectNext==null");
                }
            }
        }

        if (findPoolGO == null)
        {
            //---------------------------- TEST UNLOCk
            if (contUnlockPools > limitPoolOnRemoved)
            {
                if (IsTestingDestroy)
                {
                    Debug.Log("?????? NOT POOL ME:" + nameObject);
                }

                #region test pool limit
                //Debug.Log("%%%%%%%%%%%%%% LIMIT " + PoolGamesObjects.Count + " > " + limitPoolOnRemoved + " " + nameObject);

                //if (tag == "PrefabBoss")
                //{
                //-----------------
                //%%% CREANER %%%%

                //if (IsTestingDestroy)
                //{
                //    int countBoss = PoolGamesObjects.Where(p => p.Tag == "PrefabBoss").Count();
                //    Debug.Log("COUNT POOL BOSS: " + countBoss + @" \ " + limitPoolOnRemovedBoss + "     ME:" + nameObject);
                //    if (countBoss > limitPoolOnRemovedBoss)
                //    {
                //        //var destroyedBoss = PoolGamesObjects.Where(p => p.Tag == "PrefabBoss" && p.IsLock && p.GameObjectNext == null).ToList();
                //        //if (destroyedBoss.Count != 0)
                //        //    Debug.Log("COUNT POOL BOSS DESTROYED >>>> : " + destroyedBoss.Count());
                //        var destroyedPrefabs = PoolGamesObjects.Where(p => p.IsLock && p.GameObjectNext == null).ToList();
                //        //if (destroyedPrefabs.Count != 0 && destroyedBoss.Count != destroyedPrefabs.Count)
                //        if (destroyedPrefabs.Count != 0)
                //            Debug.Log("COUNT POOL DESTROYED >>>> : " + destroyedPrefabs.Count());

                //        //foreach (var item in destroyedPrefabs)
                //        for (int ind = 0; ind < destroyedPrefabs.Count; ind++)
                //        {
                //            PoolGamesObjects.RemoveAt(ind);
                //        }
                //    }
                //}
                //-----------------
                //}
                #endregion
            }
            //----------------------------

            findPoolGO = AddPoolNewTypeObject(tagPool);
        }

        //#FIX ELKA
        //findPoolGO.Tag = tagPool;

        findPoolGO.Activate(nameObject, tagPool, pos);
        findGO = findPoolGO.GameObjectNext;

        //---------------
        EventsObject evenObj = findGO.GetComponent <EventsObject>();
        if (evenObj != null)
        {
            if (findPoolGO == null)
            {
                Debug.Log("#######  GetPoolGameObject   findPoolGO is null " + findGO.name);
            }
            evenObj.PoolCase = findPoolGO;
        }
        else
        {
            Debug.Log("#######  GetPoolGameObject   NOT EventsObject " + findGO.name);
        }

        if (IsTestingDestroy)
        {
            if (findGO == null)
            {
                Debug.Log("###########///////////// Pool contrains null object");
            }
        }

        return(findGO);
    }