Inheritance: MonoBehaviour
Ejemplo n.º 1
0
    public void init(EnemyBase enemy, int type, string imaPath, float count)
    {
        mType = type;
        List <float> list = enemy.resourceData.getTargetBorder();

        if (list != null && list.Count == 3)
        {
            mHight = list[2] / 2;
        }
        mUpTarget = GameManager.getIntance().uiManager.mgetTarget(type);
        Vector3 v1 = PointUtils.worldTransToScreen(new Vector3(enemy.mLocalBean.mCurrentX + enemy.resourceData.getHurtOffset().x,
                                                               enemy.mLocalBean.mCurrentY + enemy.resourceData.getHurtOffset().y, 0));
        Vector3 v2 = PointUtils.worldTransToScreen(new Vector3(enemy.mLocalBean.mCurrentX + enemy.resourceData.getHurtOffset().x,
                                                               enemy.mLocalBean.mCurrentY + enemy.resourceData.getHurtOffset().y - mHight, 0));

        mHight = v1.y - v2.y;
//        Debug.Log("mHight = " + mHight);
        Vector2 v = v1;

        transform.position = v;

        if (type == SHUIJI_DIAOLUO_TYPE)
        {
            imaPath = "UI_yellow/zhujiemian/03";
        }
//        Debug.Log("DiaoluoDonghuaControl imaPath = " + imaPath);
        GetComponent <Image>().sprite = Resources.Load(imaPath, typeof(Sprite)) as Sprite;
        mBackManager = enemy.mBackManager;
        isInit       = true;
    }
Ejemplo n.º 2
0
        /// <inheritdoc />
        /// <summary>
        ///     Allows the game to run logic such as updating the world,
        ///     checking for collisions, gathering input, and playing audio.
        /// </summary>
        protected override void Update(GameTime gameTime)
        {
            if (!IsReadyToUpdate)
            {
                return;
            }

            base.Update(gameTime);

            if (SteamManager.IsInitialized)
            {
                SteamAPI.RunCallbacks();
            }

            // Run scheduled background tasks
            CommonTaskScheduler.Run();

            BackgroundManager.Update(gameTime);
            BackgroundHelper.Update(gameTime);
            NotificationManager.Update(gameTime);
            ChatManager.Update(gameTime);
            DialogManager.Update(gameTime);

            HandleGlobalInput(gameTime);

            QuaverScreenManager.Update(gameTime);
            Transitioner.Update(gameTime);

            SkinManager.HandleSkinReloading();
            LimitFpsOnInactiveWindow();
        }
Ejemplo n.º 3
0
        public Prepare()
        {
            myBackground      = new BackgroundManager(ContentManager.Background[0]);
            this.myButtons    = new List <Button>();
            this.myWindow     = Game1.mySelf.Window;
            myButtons         = new List <Button>();
            this.myFont       = ContentManager.Font[0];
            Colour            = Color.White;
            this.myPlayerShip = ContentManager.Player[0];

            #region CreateButton

            //Buttons
            CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2(50, 30), "BACK", 0.35f); //Back Button.

            CreateButton(ContentManager.Button[1], ContentManager.Font[0], new Vector2(145, 300), "-", 0.35f, "#RED-");
            CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2(215, 300), "RED", 0.35f);
            CreateButton(ContentManager.Button[1], ContentManager.Font[0], new Vector2(285, 300), "+", 0.35f, "#RED+");

            CreateButton(ContentManager.Button[1], ContentManager.Font[0], new Vector2(145, 360), "-", 0.35f, "#GREEN-");
            CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2(215, 360), "GREEN", 0.35f);
            CreateButton(ContentManager.Button[1], ContentManager.Font[0], new Vector2(285, 360), "+", 0.35f, "#GREEN+");

            CreateButton(ContentManager.Button[1], ContentManager.Font[0], new Vector2(145, 420), "-", 0.35f, "#BLUE-");
            CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2(215, 420), "BLUE", 0.35f);
            CreateButton(ContentManager.Button[1], ContentManager.Font[0], new Vector2(285, 420), "+", 0.35f, "#BLUE+");

            //Map Buttons
            CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2((Game1.mySelf.Window.ClientBounds.Width / 2) - 80, (Game1.mySelf.Window.ClientBounds.Height / 2) - 250), "MAP01", 0.5f);
            CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2((Game1.mySelf.Window.ClientBounds.Width / 2) + 80, (Game1.mySelf.Window.ClientBounds.Height / 2) - 250), "MAP02", 0.5f);
            CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2((Game1.mySelf.Window.ClientBounds.Width / 2), (Game1.mySelf.Window.ClientBounds.Height / 2) + 250), "START", 0.5f);

            #endregion
        }
Ejemplo n.º 4
0
    /*FUNCTION: ResetCameraPosition()
     * CALLED BY: FlyBird()/BirdController.cs
     * Whenever the bird out of camera view, update the camera position
     */
    void ResetCameraPosition()
    {
        float fChangeCamPos = transform.position.x - mainCam.gameObject.transform.position.x;

        mainCam.gameObject.transform.position += Vector3.right * fChangeCamPos * 2f;
        BackgroundManager.Instance().MoveBGMountains();
    }
Ejemplo n.º 5
0
    private void Start()
    {
        scoreUI = GameObject.Find("UI/Panel/Image");
        scoreUI.SetActive(false);
        resultUI = GameObject.Find("ResultUI/Panel/Image");
        resultUI.SetActive(false);
        tapObject            = GameObject.Find("Tap_Fields/Player");
        tapObjectInverse     = GameObject.Find("Tap_Fields/Player_Inverse");
        playerManager        = GameObject.Find("Players/Player").GetComponent <PlayerManager>();
        playerManagerInverse = GameObject.Find("Players/Player_Inverse").GetComponent <PlayerManager>();
        effectManager        = GameObject.Find("EffectPoint/Player").GetComponent <EffectManager>();
        effectManagerInverse = GameObject.Find("EffectPoint/Player_Inverse").GetComponent <EffectManager>();
        mainCamera           = GameObject.Find("Main Camera");
        transform.position   = mainCamera.transform.position;
        //blockCreater = GameObject.Find("Field/Blocks").GetComponent<BlockCreater>();
        tapUIManager        = GameObject.Find("TapSpace").GetComponent <TapUIManager>();
        tapUIManagerInverse = GameObject.Find("TapSpaceInverse").GetComponent <TapUIManager>();
        backgroundManager   = GameObject.Find("Background_Change").GetComponent <BackgroundManager>();
        audioSource         = GetComponents <AudioSource>();
        logo = GameObject.Find("Logo");

        foreach (GameObject m in GameObject.FindGameObjectsWithTag("Mob"))
        {
            mobManagers.Add(m.GetComponent <MobManager>());
        }
    }
Ejemplo n.º 6
0
        public BaconManager(bool isBackgroundTask)
        {
            // Set background task flag
            IsBackgroundTask = isBackgroundTask;

            // Init managers
            UserMan       = new UserManager(this);
            CacheMan      = new CacheManager(this);
            ImageMan      = new ImageManager(this);
            SubredditMan  = new SubredditManager(this);
            SettingsMan   = new SettingsManager(this);
            NetworkMan    = new NetworkManager(this);
            MessageMan    = new MessageManager(this);
            UiSettingsMan = new UiSettingManager(this);
            TelemetryMan  = new TelemetryManager();
            BackgroundMan = new BackgroundManager(this);
            MotdMan       = new MessageOfTheDayManager(this);

            // Don't do this if we are a background task; it will
            // call this when it is ready.
            if (!isBackgroundTask)
            {
                FireOffUpdate();
            }
        }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     if (transform.parent != null)
     {
         manager = transform.parent.GetComponent <BackgroundManager>();
     }
 }
Ejemplo n.º 8
0
        protected override void LoadContent()
        {
            // Adds services to global container, easy access
            serviceContainer.AddService(GraphicsDevice);
            serviceContainer.AddService(Content);

            // New BackgroundManager
            bm = new BackgroundManager();

            // New Random
            Random r = new Random();

            // Generates tiles with a random meta on the entire game screen
            for (byte x = 0; x < (GraphicsDevice.Viewport.Width / 32); x++)
            {
                for (byte y = 0; y < (GraphicsDevice.Viewport.Height / 32); y++)
                {
                    bm.AddTile(x, y, r.Next(0, 4));
                }
            }

            // New Entity Manager
            em = new EntityManager();
            em.SpawnPlayer(new Vector2(10, 10), 2.5f);


            spriteBatch = new SpriteBatch(GraphicsDevice);
        }
Ejemplo n.º 9
0
        private void FoldersTreeView_Drop(object sender, DragEventArgs e)
        {
            TreeViewItem targetItem = GetNearestContainer(e.OriginalSource as UIElement);
            Folder       folder     = targetItem.Tag as Folder;

            if (folder == null && folder.CanUpload() == false)
            {
                MessageBox.Show(Languages.Translate("Please drop into a folder or a library or a list(attachment enabled)"));
                return;
            }

            bool canUpdateItemInGrid = false;

            if (this.ConnectorExplorer.ContentExplorer.SelectedFolder != null && this.ConnectorExplorer.ContentExplorer.SelectedFolder.GetUrl() == folder.GetUrl())
            {
                canUpdateItemInGrid = true;
            }

            List <IItem> emailItems = new List <IItem>();

            ISiteSetting      siteSetting = ConfigurationManager.GetInstance().GetSiteSetting(folder.SiteSettingID);
            List <UploadItem> uploadItems = ApplicationContext.Current.GetUploadItems(folder.GetWebUrl(), siteSetting, folder, e, getFieldMappings);

            if (uploadItems == null)
            {
                return;
            }

            WorkItem workItem = new WorkItem(Languages.Translate("Uploading emails"));

            workItem.CallbackFunction = new WorkRequestDelegate(UploadEmails_Callback);
            workItem.CallbackData     = new object[] { siteSetting, folder, uploadItems, this.ConnectorExplorer, canUpdateItemInGrid };
            workItem.WorkItemType     = WorkItem.WorkItemTypeEnum.NonCriticalWorkItem;
            BackgroundManager.GetInstance().AddWorkItem(workItem);
        }
    public void Init(BackgroundManager backgroundManager)
    {
        this.backgroundManager = backgroundManager;
        int ID = backgroundManager.LevelManager.LevelStats.LevelDefinition.BackgroundID;

        SpriteRenderer.sprite = backgroundManager.ResourceManager.GetGameSprite(ID);
    }
Ejemplo n.º 11
0
        /// <summary>
        /// Create a new BaconManager.
        /// </summary>
        /// <param name="isBackgroundTask">If this Manager should be run in the background.</param>
        public BaconManager(bool isBackgroundTask)
        {
            // Set background task flag
            IsBackgroundTask = isBackgroundTask;

            // Init managers
            UserMan       = new UserManager(this);
            ImageMan      = new ImageManager(this);
            SubredditMan  = new SubredditManager(this);
            SettingsMan   = new SettingsManager(this);
            NetworkMan    = new NetworkManager(this);
            MessageMan    = new MessageManager(this);
            UiSettingsMan = new UiSettingManager(this);
            BackgroundMan = new BackgroundManager(this);
            TileMan       = new TileManager(this);
            DraftMan      = new DraftManager(this);
            MemoryMan     = new MemoryManager(this);

            // Don't do this if we are a background task; it will
            // call this when it is ready.
            if (!isBackgroundTask)
            {
                FireOffUpdate();
            }

            // Setup the in between invoke handler for the onBackButton event. This will allow us to stop
            // calling the handlers when one returns true.
            m_onBackButton.SetInBetweenInvokesAction(new Func <EventArgs, bool>(InBetweenInvokeHandlerForOnBackButton));
        }
Ejemplo n.º 12
0
    public void Init()
    {
        // 游戏本体边界
        Global.GameLBBorderPos = new Vector2(-Consts.GameWidth / 2, -Consts.GameHeight / 2);
        Global.GameRTBorderPos = new Vector2(Consts.GameWidth / 2, Consts.GameHeight / 2);
        // 弹幕边界
        Global.BulletLBBorderPos = new Vector2(Global.GameLBBorderPos.x - 100, Global.GameLBBorderPos.y - 100);
        Global.BulletRTBorderPos = new Vector2(Global.GameRTBorderPos.x + 100, Global.GameRTBorderPos.y + 100);
        // 玩家坐标边界
        Global.PlayerLBBorderPos = new Vector2(Global.GameLBBorderPos.x + 10, Global.GameLBBorderPos.y + 10);
        Global.PlayerRTBorderPos = new Vector2(Global.GameRTBorderPos.x - 10, Global.GameRTBorderPos.y - 10);

        InterpreterManager.GetInstance().Init();
        STGStageManager.GetInstance().Init();
        AnimationManager.GetInstance().Init();
        BulletsManager.GetInstance().Init();
        EnemyManager.GetInstance().Init();
        ItemManager.GetInstance().Init();
        ColliderManager.GetInstance().Init();

        ExtraTaskManager.GetInstance().Init();

        EffectsManager.GetInstance().Init();
        STGEliminateEffectManager.GetInstance().Init();
        BackgroundManager.GetInstance().Init();
#if ShowCollisionViewer
        CollisionViewer.Instance.Init();
#endif
    }
Ejemplo n.º 13
0
    void StartBackgroundRemoval()
    {
        int hr = 0;

        try
        {
            // initialize Kinect sensor as needed
            hr = BackgroundWrapper.InitKinectSensor((int)BackgroundWrapper.Constants.ColorImageResolution, (int)BackgroundWrapper.Constants.DepthImageResolution, BackgroundWrapper.Constants.IsNearMode);
            if (hr != 0)
            {
                throw new Exception("Initialization of Kinect sensor failed");
            }

            // initialize Kinect background removal
            hr = BackgroundWrapper.InitBackgroundRemoval();
            if (hr != 0)
            {
                throw new Exception("Initialization of BackgroundRemoval failed");
            }

            // Initialize the foreground buffer and texture
            foregroundTex = new Texture2D(BackgroundWrapper.Constants.ColorImageWidth, BackgroundWrapper.Constants.ColorImageHeight, TextureFormat.RGBA32, false);

            Rect  cameraRect = Camera.main.pixelRect;
            float rectHeight = cameraRect.height;
            float rectWidth  = cameraRect.width;

            if (rectWidth > rectHeight)
            {
                rectWidth = rectHeight * BackgroundWrapper.Constants.ColorImageWidth / BackgroundWrapper.Constants.ColorImageHeight;
            }
            else
            {
                rectHeight = rectWidth * BackgroundWrapper.Constants.ColorImageHeight / BackgroundWrapper.Constants.ColorImageWidth;
            }

            foregroundRect = new Rect((cameraRect.width - rectWidth) / 2, cameraRect.height - (cameraRect.height - rectHeight) / 2, rectWidth, -rectHeight);

            int imageLength = BackgroundWrapper.Constants.ColorImageWidth * BackgroundWrapper.Constants.ColorImageHeight * 4;
            foregroundImage = new byte[imageLength];

            // kinect background removal was successfully initialized
            instance = this;
            backgroundRemovalInited = true;
        }
        catch (DllNotFoundException ex)
        {
            Debug.LogError(ex.ToString());
        }
        catch (Exception ex)
        {
            string message = ex.Message + " - " + BackgroundWrapper.GetNuiErrorString(hr);
            Debug.LogError(ex.ToString());

            return;
        }

        // don't destroy the object on loading levels
        DontDestroyOnLoad(gameObject);
    }
Ejemplo n.º 14
0
        public void RefreshControls(bool forceToReload)
        {
            if (this.IsDataLoaded == false || forceToReload == true)
            {
                RefreshImage.Visibility = System.Windows.Visibility.Collapsed;
                LoadingImage.Visibility = System.Windows.Visibility.Visible;
                List <string> assignedTos = new List <string>();
                if (AssignedToFilterableHeader.FilterItems != null)
                {
                    assignedTos = AssignedToFilterableHeader.NotSelectedItemTexts;
                }

                List <string> statuses = new List <string>();
                if (StatusFilterableHeader.FilterItems != null)
                {
                    statuses = StatusFilterableHeader.NotSelectedItemTexts;
                }

                List <string> priorities = new List <string>();
                if (PriorityFilterableHeader.FilterItems != null)
                {
                    priorities = PriorityFilterableHeader.NotSelectedItemTexts;
                }

                object[] args     = new object[] { this.SiteSetting, this.TaskListLocation, this.TasksListView, assignedTos, statuses, priorities, LoadingImage, RefreshImage };
                WorkItem workItem = new WorkItem(Languages.Translate("Populating tasks"));
                workItem.CallbackFunction = new WorkRequestDelegate(LoadTasks_Callback);
                workItem.CallbackData     = args;
                workItem.WorkItemType     = WorkItem.WorkItemTypeEnum.NonCriticalWorkItem;
                BackgroundManager.GetInstance().AddWorkItem(workItem);
            }
        }
 private void Start()
 {
     if (BackgroundRespawner)
     {
         bgManager = FindObjectOfType <BackgroundManager>();
     }
 }
Ejemplo n.º 16
0
        void dragMgr_ProcessDrop(object sender, DragEventArgs e)//, ProcessDropEventArgs<DataRowView> e)
        {
            if (e.Effects == DragDropEffects.None)
            {
                return;
            }

            if (e.Data.GetDataPresent("System.Data.DataRowView", false) == true && this.dragMgr.IndexUnderDragCursor != -1)//JD.
            {
                ListView  list  = (ListView)e.Source;
                DataTable items = ((DataView)list.ItemsSource).Table;

                DataRowView item = e.Data.GetData(typeof(DataRowView)) as DataRowView;

                OC_Datarow dropUnder = (OC_Datarow)(items.Rows[this.dragMgr.IndexUnderDragCursor]);

                bool isFolder = (dropUnder.Tag as Folder != null);

                if (isFolder)
                {
                    ISiteSetting siteSetting = ConfigurationManager.GetInstance().GetSiteSetting(SelectedFolder.SiteSettingID);

                    Folder     folder         = dropUnder.Tag as Folder;
                    OC_Datarow dataSourceItem = (OC_Datarow)(item).Row;
                    IItem      itemToMove     = dataSourceItem.Tag as IItem;

                    if (ItemsManager.moveItem(siteSetting, itemToMove, folder))
                    {
                        reloadItemList();
                    }
                }
            }
            else
            {
                if (SelectedFolder == null)
                {
                    return;
                }
                List <IItem> emailItems = new List <IItem>();

                if (SelectedFolder.CanUpload() == false)
                {
                    MessageBox.Show(Languages.Translate("In order to upload email, you need to enable attachment feature in this list."));
                    return;
                }

                ISiteSetting      siteSetting = ConfigurationManager.GetInstance().GetSiteSetting(SelectedFolder.SiteSettingID);
                List <UploadItem> uploadItems = ApplicationContext.Current.GetUploadItems(SelectedFolder.GetWebUrl(), siteSetting, SelectedFolder, e, getFieldMappings);
                if (uploadItems == null)
                {
                    return;
                }

                WorkItem workItem = new WorkItem(Languages.Translate("Uploading emails"));
                workItem.CallbackFunction = new WorkRequestDelegate(UploadEmails_Callback);
                workItem.CallbackData     = new object[] { siteSetting, SelectedFolder, uploadItems, this.ConnectorExplorer, true };
                workItem.WorkItemType     = WorkItem.WorkItemTypeEnum.NonCriticalWorkItem;
                BackgroundManager.GetInstance().AddWorkItem(workItem);
            }
        }
Ejemplo n.º 17
0
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            SimpleIoc.Default.Register <Home.WelcomePageViewModel>();
            SimpleIoc.Default.Register <Home.MainPageViewModel>();
            SimpleIoc.Default.Register <Home.ScreenshotsPageViewModel>();

            SimpleIoc.Default.Register <Settings.AboutPageViewModel>();
            SimpleIoc.Default.Register <Settings.ApplicationPageViewModel>();
            SimpleIoc.Default.Register <Settings.ApplicationsPageViewModel>();
            SimpleIoc.Default.Register <Settings.MainPageViewModel>();
            SimpleIoc.Default.Register <Settings.ToolsPageViewModel>();

            SimpleIoc.Default.Register <Tutorials.MainPageViewModel>();
            SimpleIoc.Default.Register <Tutorials.UsbPageViewModel>();

            SimpleIoc.Default.Register <Transfers.WatchfacePageViewModel>();
            SimpleIoc.Default.Register <Transfers.WallpapersPageViewModel>();

            SimpleIoc.Default.Register <Controls.ScpCredentialsDialogViewModel>();
            SimpleIoc.Default.Register <Controls.ScreenshotsBenchmarkDialogViewModel>();

            SimpleIoc.Default.Register(InitializeNavigationService);
            SimpleIoc.Default.Register <IDialogService, DialogService>();
            SimpleIoc.Default.Register <Services.ApplicationsService>(createInstanceImmediately: true);

            if (!Common.Helpers.TilesHelper.BatteryTileExists())
            {
                BackgroundManager.Unregister(BackgroundManager.TimeBatteryLevelTaskName);
            }
        }
Ejemplo n.º 18
0
    // Use this for initialization
    void Start()
    {
        enemyStartPoint  = enemyGenerator.position;
        playerStartPoint = thePlayer.transform.position;

        theScoreManager      = FindObjectOfType <ScoreManager> ();
        theBackgroundManager = FindObjectOfType <BackgroundManager> ();
    }
Ejemplo n.º 19
0
        public Load()
        {
            this.myButtons = new List <Button>(); //Initializes the button list.
            myBackground   = new BackgroundManager(ContentManager.Background[0]);

            CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2((Game1.mySelf.Window.ClientBounds.Width / 2), (Game1.mySelf.Window.ClientBounds.Height / 2)), "NEW", 0.5f);       //Start Button
            CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2((Game1.mySelf.Window.ClientBounds.Width / 2), (Game1.mySelf.Window.ClientBounds.Height / 2) + 80), "LOAD", 0.5f); //Start Button
        }
Ejemplo n.º 20
0
 //Instance object of the BackgroundManager class
 public static BackgroundManager Instance()
 {
     if (!bgManager)
     {
         bgManager = FindObjectOfType(typeof(BackgroundManager)) as BackgroundManager;
     }
     return(bgManager);
 }
Ejemplo n.º 21
0
 void Start()
 {
     if (generateBackgrounds)
     {
         backgroundManager = BackgroundManager.instance;
         backgroundManager.managerParent = managerName;
     }
 }
Ejemplo n.º 22
0
    // Start is called before the first frame update
    void Start()
    {
        if (backgroundManager == null)
        {
            backgroundManager = this;
        }

        ResetBackground();
    }
Ejemplo n.º 23
0
 public Menu()
 {
     this.myButtons = new List <Button>(); //Initializes the button list.
     myBackground   = new BackgroundManager(ContentManager.Background[0]);
     myFont         = ContentManager.Font[1];
     CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2((Game1.mySelf.Window.ClientBounds.Width / 2), (Game1.mySelf.Window.ClientBounds.Height / 2)), "Start", 0.5f);        //Start Button
     CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2((Game1.mySelf.Window.ClientBounds.Width / 2), (Game1.mySelf.Window.ClientBounds.Height / 2) + 80), "Upgrade", 0.5f); //Upgrade Button
     CreateButton(ContentManager.Button[0], ContentManager.Font[0], new Vector2((Game1.mySelf.Window.ClientBounds.Width / 2), (Game1.mySelf.Window.ClientBounds.Height / 2) + 160), "Exit", 0.5f);   //Exit Button
 }
Ejemplo n.º 24
0
    // Use this for initialization
    void Start()
    {
        lvlEditMan = FindObjectOfType(typeof(LevelEditorManager)) as LevelEditorManager;
        bgMan      = FindObjectOfType(typeof(BackgroundManager)) as BackgroundManager;
        xPlus      = bgMan.XPlus;
        yPlus      = bgMan.YPlus;

        tMan = FindObjectOfType(typeof(TouchManager)) as TouchManager;
    }
Ejemplo n.º 25
0
 void Start()
 {
     cm             = GetComponent <CharacterManager>();
     gm             = GetComponent <GameManager>();
     bm             = GetComponent <BackgroundManager>();
     playerInputBar = GameObject.FindWithTag("PlayerInputBar");
     EventManager.addedToPlayerInputBar.AddListener(EvaluatePlayerInputBar);
     StartStory();
 }
Ejemplo n.º 26
0
    /// <summary>
    /// 加载关卡的默认背景场景
    /// </summary>
    private void OnStateLoadStageDefaultBgUpdate()
    {
#if DEBUG_GAMESTATE
        Logger.Log("Start loading bg of stage " + _curStageName);
#endif
        _curState = eSTGMainState.StateWait;
        CommandManager.GetInstance().Register(CommandConsts.STGLoadStageDefaultBgComplete, this);
        BackgroundManager.GetInstance().LoadStageDefaultBg(_curStageName);
    }
Ejemplo n.º 27
0
    void Awake()
    {
                #if !UNITY_XBOXONE
        string words = "";
        using (StreamReader reader = new StreamReader(Application.dataPath + "/StreamingAssets/language.txt"))
        {
            words = reader.ReadLine();
            GameConstants.language = System.Convert.ToInt32(words);
        }
                #endif

        Random.seed = System.Environment.TickCount;
        Application.targetFrameRate = (int)GameConstants.TARGET_FRAMERATE;
        GameEventDistributor       += delegate(string arg1, object[] arg2) { Log("ManagerManager.cs: GAME EVENT: " + arg1); };

        Cursor.visible = false;
        gameObject.AddComponent <AudioListener>();

        //Debug.Log("setting up managers");
        mReferences = GetComponent <PrefabReferenceBehaviour>();
        //mMenuReferences = GetComponent<MenuReferenceBehaviour>();
        mNewRef = GetComponent <NewMenuReferenceBehaviour>();

        Manager = this;

        mCharacterBundleManager       = new CharacterBundleManager(this);
        mMusicManager                 = new MusicManager(this);
        mZigManager                   = new ZgManager(this);
        mProjectionManager            = new ProjectionManager(this);
        mBodyManager                  = new BodyManager(this);
        mTransparentBodyManager       = new BodyManager(this);
        mTransparentBodyManager.mMode = 1;         //nasty
        mBackgroundManager            = new BackgroundManager(this);
        mCameraManager                = new CameraManager(this);
        mAssetLoader                  = new AssetBundleLoader(this);
        mGameManager                  = new NewGameManager(this);
        mTransitionCameraManager      = new TransitionCameraManager(this);
        mMetaManager                  = new MetaManager(this);

        if (mStartDelegates != null)
        {
            /* CAN DELETE
             * var time = Time.time;
             * string output = "";
             * foreach(var e in mStartDelegates.GetInvocationList())
             * {
             *  e.DynamicInvoke();
             *  output += e.ToString() + " took: " + (Time.time - time) + "\n";
             *  time = Time.time;
             * }
             * Debug.Log(output);*/

            mStartDelegates();
        }

        ManagerManager.Log("ManagerManager.cs: AWAKE() COMPLETE");
    }
Ejemplo n.º 28
0
        private async void RegisterBatteryTask()
        {
            this.ShowBatteryCheckWarning = this.BatteryCheckFrequency.Minutes < 15;

            if (this.BatteryCheckFrequency.Minutes >= 15)
            {
                await BackgroundManager.RegisterTimeBatteryLevelTask(this.BatteryCheckFrequency.Minutes);
            }
        }
            public BackgroundManager GetBackgroundManager()
            {
                if (m_backgroundManager == null)
                {
                    m_backgroundManager = new BackgroundManager(this);
                }

                return(m_backgroundManager);
            }
Ejemplo n.º 30
0
    void Start()
    {
        CreateSkybox();
        CreateDayClouds();
        CreateSun();
        CreateStars();
        CreateNightClouds();

        instance = this;
    }
Ejemplo n.º 31
0
    void OnApplicationQuit()
    {
        // finish background removal
        if(backgroundRemovalInited)
        {
            BackgroundWrapper.FinishBackgroundRemoval();
            BackgroundWrapper.ShutdownKinectSensor();

            backgroundRemovalInited = false;
            instance = null;
        }
    }
Ejemplo n.º 32
0
 // Use this for initialization
 void Start()
 {
     bgManager = GetComponent<BackgroundManager>();
     egc = FindObjectOfType<ExitGameCommand>();
 }
Ejemplo n.º 33
0
 public void Start()
 {
     currentLives = startingLives;
     bgManager = FindObjectOfType<BackgroundManager>();
     scoreController = FindObjectOfType<ScoreController>();
     showHighScoreBox = false;
     timeCounter = 0;
     transition = UITransitionState.Steady;
     playerSpecial = FindObjectOfType<PlayerSpecial>();
     referenceFrame = FindObjectOfType<ReferenceFrame>();
 }
Ejemplo n.º 34
0
    void StartBackgroundRemoval()
    {
        int hr = 0;

        try
        {
            // initialize Kinect sensor as needed
            hr = BackgroundWrapper.InitKinectSensor((int)BackgroundWrapper.Constants.ColorImageResolution, (int)BackgroundWrapper.Constants.DepthImageResolution, BackgroundWrapper.Constants.IsNearMode);
            if(hr != 0)
            {
                throw new Exception("Initialization of Kinect sensor failed");
            }

            // initialize Kinect background removal
            hr = BackgroundWrapper.InitBackgroundRemoval();
            if(hr != 0)
            {
                throw new Exception("Initialization of BackgroundRemoval failed");
            }

            // Initialize the foreground buffer and texture
            foregroundTex = new Texture2D(BackgroundWrapper.Constants.ColorImageWidth, BackgroundWrapper.Constants.ColorImageHeight, TextureFormat.RGBA32, false);

            Rect cameraRect = Camera.main.pixelRect;
            float rectHeight = cameraRect.height;
            float rectWidth = cameraRect.width;

            if(rectWidth > rectHeight)
                rectWidth = rectHeight * BackgroundWrapper.Constants.ColorImageWidth / BackgroundWrapper.Constants.ColorImageHeight;
            else
                rectHeight = rectWidth * BackgroundWrapper.Constants.ColorImageHeight / BackgroundWrapper.Constants.ColorImageWidth;

            foregroundRect = new Rect((cameraRect.width - rectWidth) / 2, cameraRect.height - (cameraRect.height - rectHeight) / 2, rectWidth, -rectHeight);

            int imageLength = BackgroundWrapper.Constants.ColorImageWidth * BackgroundWrapper.Constants.ColorImageHeight * 4;
            foregroundImage = new byte[imageLength];

            // kinect background removal was successfully initialized
            instance = this;
            backgroundRemovalInited = true;
        }
        catch(DllNotFoundException ex)
        {
            Debug.LogError(ex.ToString());
            if(debugText != null)
                debugText.GetComponent<GUIText>().text = "Please check the Kinect SDK installation.";
        }
        catch (Exception ex)
        {
            string message = ex.Message + " - " + BackgroundWrapper.GetNuiErrorString(hr);
            Debug.LogError(ex.ToString());

            if(debugText != null)
            {
                debugText.GetComponent<GUIText>().text = message;
            }

            return;
        }

        // don't destroy the object on loading levels
        DontDestroyOnLoad(gameObject);
    }
Ejemplo n.º 35
0
 void Start()
 {
     Instance = this;
 }
Ejemplo n.º 36
0
Archivo: Game1.cs Proyecto: KEZI/Kod
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            //TitleScreen = new TitleScreen(Content, new EventHandler(TitleScreenEvent));

            Zelda = new Hero();
            BackgroundOne = new Sprite();
            BackgroundTwo = new Sprite();
            BackgroundThree = new Sprite();
            BGMan = new BackgroundManager();
            BoxOne = new Sprite();
            BoxTwo = new Sprite();
            BoxThree = new Sprite();
            BoxMan = new BoxManager();

            // Create a new SpriteBatch, which can be used to draw textures.
            SBatch = new SpriteBatch(GraphicsDevice);

            //CurrentScreen = TitleScreen;

            base.Initialize();
        }
		public PicassoBackgroundManagerTarget (BackgroundManager backgroundManager)
		{
			this.mBackgroundManager = backgroundManager;
		}