//    public AudioClip sfxRespawn;
 //    public AudioClip sfxBotExplo;
 // declare instance
 void OnEnable()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad (this);
     }
 }
    public void Init(GameObject menu, GameObject scroll)
    {
        baseManager = GetComponent <BaseManager>();

        questPanel  = (GameObject)Resources.Load("UI/QuestPanel");
        questMenu   = menu;
        questScroll = scroll;

        for (int i = 0; i < 3; i++)
        {
            AddQuest();
        }
    }
 public void InitBuilding(BaseManager manager, GameObject uniquePanel)
 {
     SetBaseManager(manager);
     meshFilterReference = GetComponent <MeshFilter> ();
     if (uniquePanel != null)
     {
         infoPanel = uniquePanel;
     }
     else
     {
         infoPanel = baseManager.GetBuildingDisplay().uniquePanels[(int)buildingType];
     }
 }
        internal HashSet <DSSRackController> GetData()
        {
            if (!_isContructed)
            {
                return(null);
            }

            FindSubRoot();

            Manager = Manager ?? BaseManager.FindManager(SubRoot);

            return(Manager.BaseRacks);
        }
Exemple #5
0
        /// <summary>
        /// Реализует управление базой
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public string BaseAction(BaseAction obj)
        {
            var result = Tools.CheckAuthedInput(obj);

            if (result != "passed")
            {
                return(result);
            }

            var mapobj = Tools.SmartMapper <BaseAction, gamelogic.Models.BaseAction>(obj);

            try
            {
                switch (mapobj.action)
                {
                case "upgrade":
                    result = BaseManager.UpgradeBase(mapobj);
                    break;

                case "repair":
                    result = BaseManager.RepairBase(mapobj);
                    break;

                case "build":
                    result = BaseManager.BuildStructure(mapobj);
                    break;

                case "upgradestructure":
                    result = BaseManager.UpgradeStructure(mapobj);
                    break;

                case "makeunit":
                    result = BaseManager.MakeUnit(mapobj);
                    break;

                default:
                    result = "wrongaction";
                    break;
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine($"Исключение: {ex.Message}");
                System.Diagnostics.Debug.WriteLine($"Метод: {ex.TargetSite}");
                System.Diagnostics.Debug.WriteLine($"Трассировка стека: {ex.StackTrace}");
                result = ex.Message;
                ProceedActions.Log("Exception", $"Исключение: {ex.Message}, функция BaseAction");
            }
            return(result);
        }
    // Start is called before the first frame update
    void Start()
    {
        gamemanager             = FindObjectOfType <GameManager>();
        paladinShieldMaxTime    = gamemanager.SkillTree["enemypaladin"];
        assassinMultiplierSkill = gamemanager.SkillTree["enemyassassin"];
        succubusHealPercent     = gamemanager.SkillTree["enemysuccubus"];
        monkSlowPercent         = gamemanager.SkillTree["enemymonk"];
        armorerBonusDamage      = gamemanager.SkillTree["enemyarmorer"];
        warlockNegateThreshhold = gamemanager.SkillTree["enemywarlock"];

        tileI = 0;

        killWorth = health;
        attack    = health / 3;

        currency = GameObject.FindGameObjectWithTag("money").GetComponent <CurrencyManager>();
        //Debug.LogError(currency);
        playerBase = GameObject.FindGameObjectWithTag("base").GetComponent <BaseManager>();

        healthBarParent     = transform.GetChild(0);
        healthBarSprite     = healthBarParent.GetChild(0).GetComponent <SpriteRenderer>();
        healthBarBackground = transform.GetChild(1).GetComponent <SpriteRenderer>();
        ishealthShown       = false;
        healthShowTimer     = 0;

        slowed     = false;
        stunned    = false;
        slowTimer  = 0;
        stunTimer  = 0;
        slowAmount = 1;

        challengeManager = FindObjectOfType <ChallengeManager>();
        //chaos_challenge = !challengeManager.ChallengeDictionary["chaosskill"];
        //fire_challenge = !challengeManager.ChallengeDictionary["fireskill"];
        //nature_challenge = !challengeManager.ChallengeDictionary["natureskill"];
        //earth_challenge = !challengeManager.ChallengeDictionary["earthskill"];

        //enemypedia
        cur_found      = challengeManager.Enemypedia["cur"];
        knight_found   = challengeManager.Enemypedia["knight"];
        monk_found     = challengeManager.Enemypedia["monk"];
        assassin_found = challengeManager.Enemypedia["assassin"];
        paladin_found  = challengeManager.Enemypedia["paladin"];
        armorer_found  = challengeManager.Enemypedia["armorer"];
        succubus_found = challengeManager.Enemypedia["succubus"];
        warlock_found  = challengeManager.Enemypedia["warlock"];

        //sound
        deathSoundVolume = gamemanager.sfxVolume;
    }
        public ActionResult RoleRemove(int id)
        {
            BaseManager baseManager = new BaseManager();

            try
            {
                baseManager.RoleRemove(id);
                return(Json(new { code = 200 }));
            }
            catch (Exception e)
            {
                return(Json(new { code = 500, msg = e.Message }));
            }
        }
Exemple #8
0
        private void ToButtonClick()
        {
            if (_toDevice == null)
            {
                //Add Message
                return;
            }

            BaseManager.AddOperation(new FCSOperation {
                FromDevice = _fromDevice, ToDevice = _toDevice, TechType = _itemTechType, Manager = _mono.Manager
            });

            GoToPage(OperatorPages.Operations);
        }
Exemple #9
0
    public void Init(BaseManager baseManager, Scrollbar scrollbar)
    {
        manager       = baseManager;
        displayScroll = scrollbar;

        characterPanel = (GameObject)Resources.Load("UI/CharacterPanel");
        panelPortrait  = characterPanel.GetComponentInChildren <Image>();
        panelName      = characterPanel.GetComponentsInChildren <Text>()[0];
        panelLevel     = characterPanel.GetComponentsInChildren <Text>()[1];

        panelParent = GetComponentInChildren <VerticalLayoutGroup>().gameObject;
        parentStart = panelParent.transform.position;
        parentEnd   = parentStart;
    }
Exemple #10
0
        public ActionResult Login(AccountLoginVm model)
        {
            BaseManager manager = new BaseManager();

            if (manager.UserManagerLogin(model.LoginName, model.LoginPwd))
            {
                Session["username"] = model.LoginName;
                return(Json(new { code = 200 }));
            }
            else
            {
                return(Json(new { code = 500 }));
            }
        }
        public World CreateWorld(PersistedWorldData pWorldData, ServerGameMode gameMode)
        {
            string seed = pWorldData.WorldData.Seed;

            if (string.IsNullOrWhiteSpace(seed))
            {
                seed = StringHelper.GenerateRandomString(10);
            }

            Log.Info($"Loading world with seed {seed}");

            World world = new()
            {
                SimulationOwnershipData = new SimulationOwnershipData(),
                PlayerManager           = new PlayerManager(pWorldData.PlayerData.GetPlayers(), config),

                BaseManager = new BaseManager(pWorldData.BaseData.PartiallyConstructedPieces, pWorldData.BaseData.CompletedBasePieceHistory),

                InventoryManager = new InventoryManager(pWorldData.WorldData.InventoryData.InventoryItems, pWorldData.WorldData.InventoryData.StorageSlotItems, pWorldData.WorldData.InventoryData.Modules),

                EscapePodManager = new EscapePodManager(pWorldData.WorldData.EscapePodData.EscapePods, randomStart, seed),

                GameData = pWorldData.WorldData.GameData,
                GameMode = gameMode,
                Seed     = seed
            };

            world.EventTriggerer = new EventTriggerer(world.PlayerManager, seed, pWorldData.WorldData.GameData.StoryTiming.ElapsedTime, pWorldData.WorldData.GameData.StoryTiming.AuroraExplosionTime);
            world.VehicleManager = new VehicleManager(pWorldData.WorldData.VehicleData.Vehicles, world.InventoryManager);
            world.ScheduleKeeper = new ScheduleKeeper(pWorldData.WorldData.GameData.PDAState, pWorldData.WorldData.GameData.StoryGoals, world.EventTriggerer, world.PlayerManager);

            world.BatchEntitySpawner = new BatchEntitySpawner(
                NitroxServiceLocator.LocateService <EntitySpawnPointFactory>(),
                NitroxServiceLocator.LocateService <UweWorldEntityFactory>(),
                NitroxServiceLocator.LocateService <UwePrefabFactory>(),
                pWorldData.WorldData.ParsedBatchCells,
                protoBufSerializer,
                NitroxServiceLocator.LocateService <Dictionary <NitroxTechType, IEntityBootstrapper> >(),
                NitroxServiceLocator.LocateService <Dictionary <string, PrefabPlaceholdersGroupAsset> >(),
                world.Seed
                );

            world.EntityManager = new EntityManager(pWorldData.EntityData.Entities, world.BatchEntitySpawner);

            HashSet <NitroxTechType> serverSpawnedSimulationWhiteList = NitroxServiceLocator.LocateService <HashSet <NitroxTechType> >();

            world.EntitySimulation = new EntitySimulation(world.EntityManager, world.SimulationOwnershipData, world.PlayerManager, serverSpawnedSimulationWhiteList);

            return(world);
        }
Exemple #12
0
        public ActionResult RloginResult(string phone, string pwd)
        {
            BaseManager Bm = new BaseManager();

            if (Bm.UserAdminLogin(phone, pwd))
            {
                Session["username"] = phone;
                return(Redirect("/MEIZU/Html/Index.html"));
            }
            else
            {
                return(Json(new { code = 500 }));
            }
        }
Exemple #13
0
        /// <summary>
        /// 模糊查询
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public IEnumerable <BaseManager> Search(BaseManager user)
        {
            var obj = _shopMallContext.BaseManager.Where(a => a.Id > 0);

            if (!string.IsNullOrWhiteSpace(user.UserName))
            {
                obj = obj.Where(a => a.UserName.Contains(user.UserName));
            }
            if (!string.IsNullOrWhiteSpace(user.RealName))
            {
                obj = obj.Where(a => a.RealName.Contains(user.RealName));
            }
            return(obj);
        }
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult RoleCreate(RoleCreateVm model)
        {
            BaseManager baseManager = new BaseManager();

            try
            {
                baseManager.RoleCreate(model.RoleName);
                return(Json(new { code = 200 }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception e)
            {
                return(Json(new { code = 500, msg = e.Message }, JsonRequestBehavior.AllowGet));
            }
        }
    UIPoint jumpToSence;           //跳转到游戏开始场景
    private void Start()
    {
        IOMgr = BaseManager <IOMgr> .GetInstance();

        WSC         = GameObject.Find("WordsView").GetComponentInChildren <WordScrollContral>();
        USC         = GameObject.Find("UsedView").GetComponentInChildren <UsedScrollContral>();
        tipsText    = GameObject.Find("TipsText").GetComponentInChildren <Text>();
        jumpToSence = GetComponent <UIPoint>();
        LoadThesaurusls(inputWord);
        LoadChooseWord();
        //监听输入框输入
        inputField = GameObject.Find("InputField").GetComponent <InputField>();
        inputField.GetComponent <InputField>().onEndEdit.AddListener(EndEdit);
    }
Exemple #16
0
        public static HtmlString PearSelectByDictionary(this HtmlHelper helper, string title, string selectName, string val, string dicGroupName, string @class = "layui-input-block")
        {
            BaseManager baseMgr = new BaseManager();
            var         vals    = baseMgr.GetDictionariesByGroupName(dicGroupName);

            var items = "";

            foreach (var VARIABLE in vals)
            {
                items += $"<option {(VARIABLE.Value == val ? "selected" : String.Empty)}  value='{VARIABLE.Value}'>{VARIABLE.GroupName}</option>";
            }
            var html = $@" <div class='layui-form-item'><label class='layui-form-label'>{title}</label><div  class='{@class}'><select id='{selectName}' name='{selectName}'>{items}</select></div></div>";

            return(new HtmlString(html));
        }
        public ActionResult MenuData()
        {
            BaseManager baseManager = new BaseManager();

            return(Json(new { code = 0, data = baseManager.GetAllMenus().Select(m => new
                {
                    m.Id,
                    m.Order,
                    m.Url,
                    m.MenuTypeId,
                    ParentMenuId = m.ParentMenuId ?? 0,
                    m.IconString,
                    m.MenuText
                }).ToList() }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult MenuRemove(long id, long?parentId)
        {
            BaseManager baseMgr = new BaseManager();

            if (parentId != 0)
            {
                baseMgr.MenuRemoveByChild(id);
            }
            else
            {
                baseMgr.MenuRemoveByParent(id);
            }

            return(Json(new { code = 200 }, JsonRequestBehavior.AllowGet));
        }
Exemple #19
0
        /// <summary>
        /// Возвращает список всех отрядов на базе
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public IEnumerable <UnitsData> GetBaseUnitsList(BaseAction obj)
        {
            var result = Tools.CheckAuthedInput(obj);

            if (result != "passed")
            {
                return(null);
            }

            var acc = AccountManager.GetAccountByToken(obj.token);

            var curbase = BaseManager.GetBaseInfo(acc);

            return(Tools.EnumSmartMapper <gamelogic.Unit, UnitsData>(BaseManager.GetBaseUnits(curbase.BaseID)));
        }
Exemple #20
0
    private void DoRemove(Type type)
    {
        BaseManager manager = type2ManagerDic[type];

        manager.Dispose();
        managerList.Remove(manager);
        type2ManagerDic.Remove(type);

        Component component = rootGo.GetComponent(type);

        if (component != null)
        {
            GameObject.Destroy(component);
        }
    }
Exemple #21
0
        protected static void ListJoin()
        {
            var l1 = new BaseManager <Book>().Query(n => n.Id > 3);
            var l2 = new List <Sheet1>()
            {
                new Sheet1()
                {
                    A = "9", B = "SFB"
                }
            };

            //var l3 = (from a in l1
            //    join b in l2 on new {d1 = a.Id, d2 = a.Name} equals new {d1 = b.A.ToInt(), d2 = b.B}
            //    select a).ToList();
        }
Exemple #22
0
        public void MailProcessTwoMailFromSubInbox()
        {
            BaseManager.WriteToLog("ProcessTwoMailFromSubInbox");
            MailManager bLManager = new MailManager();

            bLManager.Process(EmailActionType.Removed, InboxType.Subinbox, Now);
            bLManager.Process(EmailActionType.Removed, InboxType.Subinbox, Now);
            var x = bLManager.GetLastCalculationDay(Now);

            Assert.AreEqual(0, x.MailCountAdd, MailCountAdd);
            Assert.AreEqual(2, x.MailCountProcessed, MailCountProcessed);
            Assert.AreEqual(0, x.MailCountSent, Sent);
            Assert.AreEqual(0, x.TaskCountAdded, TaskCountAdded);
            Assert.AreEqual(0, x.TaskCountFinished, TaskCountFinished);
            Assert.AreEqual(0, x.TaskCountRemoved, TaskCountRemoved);
        }
        private bool FindManager()
        {
            SubRoot = GetComponent <SubRoot>() ?? GetComponentInParent <SubRoot>();

            if (SubRoot == null)
            {
                return(false);
            }

            if (Manager == null)
            {
                Manager = BaseManager.FindManager(SubRoot);
            }

            return(Manager != null);
        }
 private void DoInitManagers()
 {
     if (nextInitManages.Count > 0)
     {
         BaseManager m = nextInitManages[0];
         if (!m.initialized)
         {
             InitManager(m);
         }
         nextInitManages.RemoveAt(0);
     }
     else
     {
         initManagers = false;
     }
 }
        public ActionResult EditDictionary(DictionaryEditVm model)
        {
            if (ModelState.IsValid)
            {
                BaseManager baseManager = new BaseManager();
                baseManager.EditDictionary(new Dictionary
                {
                    Id        = model.Id,
                    GroupName = model.GroupName,
                    Value     = model.Value
                });
                return(Json(new { code = 200 }));
            }

            return(Json(new { code = 500, msg = "数据不合法" }));
        }
Exemple #26
0
        public BaseRace2(SSPlayerManager PlayerManager, BaseManager BaseManager, ShortChat msg, MyGame myGame)
        {
            this.m_Players      = PlayerManager;
            this.msg            = msg;
            this.m_BaseManager  = BaseManager;
            this.psyGame        = myGame;
            this.m_BaseRaceFreq = 1337;
            this.m_BlockedList  = new List <string>();
            this.m_CustomStaff  = new List <string>();

            this.loadNextBase();

            m_Timer          = new Timer();
            m_Timer.Elapsed += new ElapsedEventHandler(MyTimer);
            m_Timer.Interval = 1000;
        }
Exemple #27
0
    // Start is called before the first frame update
    void Start()
    {
        m_Base = FindObjectOfType <BaseManager>();
        switch (m_Base.GetState())
        {
        case BaseManager.AppState.INITIALIZE:
            Initializations();
            break;

        case BaseManager.AppState.STANDBY:
            break;

        case BaseManager.AppState.REGISTRATION:
            break;
        }
    }
Exemple #28
0
            public void Login()
            {
                Console.WriteLine("Connected!");
                Console.WriteLine("Please login to server.");
                Console.Write("ID :");
                string id = Console.ReadLine();

                Console.Write("Password : ");
                string password = Console.ReadLine();

                BaseManager.Login(id, password);
                while (BaseManager.Status != (int)ClientSocketStatus.LoggedIn)
                {
                    ;
                }
            }
        public ActionResult ManagerEdit(int id)
        {
            BaseManager sve  = new BaseManager();
            var         item = sve.ManagerGetOne(id);

            return(View(new ManagerUpdataVm
            {
                Id = item.Id,
                LoginName = item.LoginName,
                LoginPwd = item.LoginPwd,
                FaceImage = item.FaceImagePath,
                CreateTime = item.CreateTime,
                LastLoginTime = item.LastLoginTime,
                IsEnable = item.IsEnable
            }));
        }
Exemple #30
0
 public void toggleInventory()
 {
     if (InventoryGUI.isShown)
     {
         InventoryGUI.setInventoryShown(false);
     }
     else
     {
         GameObject basee = (GameObject)GameObject.Find("Base");
         if (basee != null)
         {
             BaseManager bm = basee.GetComponent <BaseManager>();
             bm.setInventory(character);
         }
         InventoryGUI.setInventoryShown(true);
     }
 }
        public ActionResult EditMenu(long id)
        {
            var svc = new BaseManager();
            var obj = svc.MenuGetOneById(id);

            ViewBag.ParentMenus = new SelectList(svc.MenusGetAllByWhere($"ParentMenuId is null")
                                                 , "Id", "MenuText", obj.ParentMenuId);


            ViewBag.MenuTypes = new SelectList(svc.MenuTypesGetAll(), "Id", "TypeName", obj.MenuTypeId.ToString());

            return(View(new MenuEditVm()
            {
                Id = obj.Id, MenuName = obj.MenuText,
                ParentId = obj.ParentMenuId, Order = obj.Order, Icon = obj.IconString, Url = obj.Url
            }));
        }
    public void StartGame()
    {
        if (_gameManager == null)
        {
            _gameManager = BaseManager.Instance;
        }

        if (_player != null)
        {
            Destroy(_player.gameObject);
        }

        _player = (Instantiate(PlayerObject, _gameManager.GameMap.GetTile(Vector2.zero).transform.position, Quaternion.identity) as GameObject).GetComponent<Player>();
        _player.MovementSpeed = MovementSpeed;
        _player.RotationSpeed = RotationSpeed;
        _player.IsDead = false;

        GameCamera.GetComponent<CameraSpringZoom>().PlayerTransform = _player.transform;
        _enableSwipe = PlayerPrefs.GetInt("Swiping") == 0 ? false : true;
    }
Exemple #33
0
        public void SetMap(Map map, GamePlayState _state)
        {
            currentGameMode = _state.CurrentGameMode;
            flags = _state.Flags;
            utilities = _state.Utilities;
            bases = _state.Bases;
            try
            {
                GraphicsDevice device = Renderer.GraphicOptions.graphics.GraphicsDevice;
                PresentationParameters pp = device.PresentationParameters;
                renderTarget = new RenderTarget2D(device, (int)map.Width * miniMapScaleFactor + 2 * miniMapBorderBuffer,
                             (int)map.Height * miniMapScaleFactor + 2 * miniMapBorderBuffer, 1, SurfaceFormat.Color,
                             pp.MultiSampleType,
                             pp.MultiSampleQuality, RenderTargetUsage.PreserveContents);

                DepthStencilBuffer previousDepth = device.DepthStencilBuffer;
                device.DepthStencilBuffer = null;
                device.SetRenderTarget(0, renderTarget);
                device.Clear(Color.Black);
                ServiceManager.Game.Batch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.None);
                Texture2D miniMapDrawer = ServiceManager.Resources.GetTexture2D("textures\\misc\\MiniMap\\wallandbackground");

                for (uint x = 0; x < map.Width; x++)
                {
                    for (uint y = 0; y < map.Height; y++)
                    {
                        Tile tmpTile = map.GetTile(x, y);

                        if (!tmpTile.IsPassable)
                            ServiceManager.Game.Batch.Draw(miniMapDrawer,
                                new Vector2(x * miniMapScaleFactor + miniMapBorderBuffer, y * miniMapScaleFactor + miniMapBorderBuffer),
                                new Rectangle(0, 0, miniMapScaleFactor, miniMapScaleFactor), Color.White);
                    }
                }

                ServiceManager.Game.Batch.End();
                device.DepthStencilBuffer = previousDepth;
                device.SetRenderTarget(0, null);
                texture = renderTarget.GetTexture();

                renderTarget = new RenderTarget2D(device, 235, 235,
                     1, SurfaceFormat.Color,
                     pp.MultiSampleType,
                     pp.MultiSampleQuality, RenderTargetUsage.PreserveContents);
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex);
            }
        }
Exemple #34
0
        /// <summary>
        /// Ensures all references are released.
        /// </summary>
        public void Dispose()
        {
            players = null;
            flags = null;
            bases = null;
            utilities = null;
            localPlayer = null;
            renderTarget = null;
            texture = null;
            mapObjectTexture = null;

            IsDisposed = true;
        }
 public void SetupCanvas()
 {
     if (GameObject.Find("Canvas(Clone)") != null)
     {
         Debug.Log("Yay found the Canvas...[SERVER]...(Clone)");
         cs = GameObject.Find("Canvas(Clone)");//The Host will search for this....
         if (cs != null)
         {
             string name = base.gameObject.name.Substring(0, 9);
             //Debug.Log(name);// UnitSpot names
             panel = GameObject.Find("BuildPanelfor" + name);
             //GameObject player = GameObject.FindWithTag("MainCamera");
             panel.SetActive(false);
             hpbar = GameObject.Find("HealthBarfor" + name + "(Clone)");
             hpbar.SetActive(false);
             //GameObject temp = GameObject.Find("Base");
             GameObject temp = GameObject.Find("Base(Clone)");
             BaseUnit = temp.GetComponent<BaseManager>();
         }
     }
     else if (GameObject.Find("CanvasClient(Clone)") != null)
     {
         Debug.Log("Yay found the Canvas...[CLIENT]...(Clone)");
         cs = GameObject.Find("CanvasClient(Clone)");//The Host will search for this....
         if (cs != null)
         {
             string name = this.gameObject.name.Substring(0, 9);
             Debug.Log(name);// UnitSpot names
             panel = GameObject.Find("BuildPanelfor" + name);
             Debug.Log("panel name : " + panel.name);
             //GameObject player = GameObject.FindWithTag("MainCamera");
             panel.SetActive(false);
             hpbar = GameObject.Find("HealthBarfor" + name + "(Clone)");
             Debug.Log("hpbar name : " + hpbar.name);
             hpbar.SetActive(false);
             //GameObject temp = GameObject.Find("Base");
             GameObject temp = GameObject.Find("Base(Clone)");
             BaseUnit = temp.GetComponent<BaseManager>();
         }
     }
     else
     {
         Debug.Log("T_T.... no canvas!");
     }
 }
        // PUBLIC
        // PUBLIC STATIC
        // PRIVATE
        // PRIVATE STATIC
        // PRIVATE COROUTINE
        // PRIVATE INVOKE
        //--------------------------------------
        //  Events
        //--------------------------------------
        public override void onReset(BaseManager aBaseManager)
        {
            //JUST RE-GET THIS OFTEN
            _gameManager = UMOM.Instance.getManager<GameManager>();

            //
            if (_gameManager != null) {

                if (!_gameManager.hasEventListener (GameManager.SCORE_CHANGED, _onScoreChanged) ) {
                    _gameManager.addEventListener (GameManager.SCORE_CHANGED, _onScoreChanged);
                } else {
                    _gameManager.removeEventListener (GameManager.SCORE_CHANGED, _onScoreChanged);
                }
            }
        }
Exemple #37
0
 void Awake()
 {
     instance = this;
     bases = FindObjectsOfType (typeof(Base)) as Base[];
 }
 void Awake()
 {
     _instance = gameObject.GetComponent<BaseManager>();
 }
 public override void onReset(BaseManager aBaseManager)
 {
     //JUST RE-GET THIS OFTEN
     if (!hasEventListener (GameManager.SCORE_CHANGED, _onScoreChanged) ) {
         addEventListener (GameManager.SCORE_CHANGED, _onScoreChanged);
     } else {
         removeEventListener (GameManager.SCORE_CHANGED, _onScoreChanged);
     }
 }
 public override void onReset(BaseManager aBaseManager)
 {
     //Debug.Log ("	onReset(): " + this);
 }
 void Start()
 {
     _thisManager = BaseManager.Instance;
 }