Exemplo n.º 1
0
 public void GetAllNeededReferences()
 {
    if(inGameUIManager_Ref == null)
         inGameUIManager_Ref = InGameUIManager.GetInstance();
     if (bubbleManager_Ref == null)
         bubbleManager_Ref = BubbleManager.GetInstance();
 }
 public void enemyTurn()
 {
     for (int i = 0; i < enemies.Length; ++i)
     {
         if (enemies[i].gameObject.activeSelf)
         {
             if (!enemies[i].isMoveable())
             {
                 continue;
             }
             if (enemies[i].getAttack() - PlayerManager.Inst().getPlayer().getDefend() > 0)
             {
                 PlayerManager.Inst().getPlayer().GetDamaged(enemies[i].getAttack() - PlayerManager.Inst().getPlayer().getDefend());
                 Debug.Log("Player get damaged");
             }
             else
             {
                 PlayerManager.Inst().getPlayer().GetDamaged(10);
                 Debug.Log("Player get damaged");
             }
             if (enemies[i].getStatus() != StatusEffect.None)
             {
                 if (Random.Range(0, 20) < 1)
                 {
                     PlayerManager.Inst().getPlayer().setStatusEffect(enemies[i].getStatus());
                     PlayerManager.Inst().getPlayer().setStatusRemainTurn(Random.Range(4, 8));
                 }
             }
         }
     }
     Combination = "";
     InGameUIManager.Inst().combinationTextUpdate();
     turnOver();
 }
Exemplo n.º 3
0
        private void AddSelectedShipUI(object sender, EventArgs e)
        {
            PlayerShip playerShip = sender as PlayerShip;

            FlashingInGameImage selectedShipUI = InGameUIManager.GetObject <FlashingInGameImage>("Selected Player Ship UI");

            if (selectedShipUI == null)
            {
                InGameUIManager.AddObject(new FlashingInGameImage(Vector2.Zero, playerShip.Size, "Sprites\\UI\\Markers\\SelectedShipMarker", playerShip), "Selected Player Ship UI", true);
            }
            else if (selectedShipUI.Parent != playerShip)
            {
                selectedShipUI.Parent  = playerShip;
                selectedShipUI.Size    = playerShip.Size;
                selectedShipUI.Visible = true;
            }

            InGameShipInfo inGameShipInfo = UIManager.GetObject <InGameShipInfo>("Selected Player Ship Info UI");

            if (inGameShipInfo == null)
            {
                InGameShipInfo shipInfo = new InGameShipInfo(playerShip, new Vector2(Viewport.Width - 150, ScreenCentre.Y), new Vector2(300, Viewport.Height), "Sprites\\UI\\Menus\\default", UnderSiegeGameplayScreen.SceneRoot);
                UIManager.AddObject(shipInfo, "Selected Player Ship Info UI", true);
            }
            else if (inGameShipInfo.PlayerShip != playerShip)
            {
                // This will automatically rebuild the UI - see the class
                inGameShipInfo.PlayerShip = playerShip;
            }
        }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        gameTouchController = new GameTouchController();

        //创建角色
        GameObject roleObj = Resources.Load("Prefabs/MapObj/InGameRole") as GameObject;

        roleObj = Instantiate(roleObj);
        role    = roleObj.GetComponent <InGameRole>();

        //地面
        GameObject touchPlaneObj = Resources.Load("Prefabs/MapObj/TouchPlane") as GameObject;

        touchPlane = Instantiate(touchPlaneObj);


        GameObject groundPlaneObj = Resources.Load("Prefabs/MapObj/GroundPlane") as GameObject;

        groundPlane = Instantiate(groundPlaneObj);
        //
        inGameLevelManager = new InGameLevelManager();
        inGameLevelManager.Init();

        inGameUIManager = new InGameUIManager();
        inGameUIManager.Init();

        int selmodel = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL, 0);

        modelManager = InGameBaseModel.Create(selmodel);
        modelManager.Init();

        gameState = enGameState.playing;
    }
Exemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
     TWTransition.FadeOut();
     isPaused = false;
     uilive();
 }
Exemplo n.º 6
0
 private void Awake()
 {
     if (m_instance == null)
     {
         m_instance = this;
     }
 }
Exemplo n.º 7
0
 //Иницицализирует статические поля мэнэджера,чтобы к ниму всегда был доступ
 void InitStaticFields()
 {
     ingamemanager   = GetComponent <InGameManager>();
     soundmanager    = GetComponent <SoundManager>();
     scoremanager    = GetComponent <ScoreManager>();
     ingameuimanager = GetComponent <InGameUIManager>();
 }
Exemplo n.º 8
0
    private void Awake()
    {
        instance = this;

        mHPLabel = transform.Find("GaugeUIPanel/HP").GetComponent <UILabel>();
        mMPLabel = transform.Find("GaugeUIPanel/MP").GetComponent <UILabel>();
    }
 void Awake()
 {
     GameObject findObject = GameObject.Find ("UIManager");
     if (findObject != null) {
         _uiManager = findObject.GetComponent<InGameUIManager>();
     }
 }
Exemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        Instance = this;

        PlayAgainButton.gameObject.SetActive(false);
        ExitButton.gameObject.SetActive(false);
    }
Exemplo n.º 11
0
    void Start()
    {
        buttonReleaseScript = GameObject.Find("ButtonRelease").GetComponent<ButtonReleased>();
        inGameUI = GameObject.Find("InGameUIManager").GetComponent<InGameUIManager>();
        nappyPadSpawnerObj = GameObject.Find("NappyPadSpawner");

        if(nappyPadSpawnerObj != null)
        {
            nappyPadSpawnerScript = nappyPadSpawnerObj.GetComponent<NappyPadSpawner>();
        }

        nappyPadSpawnerScript.nappyPadCount++;

        if(!inGameUI.firstNappy)
        {
            if(inGameUI.isLevel1)
            {
                inGameUI.Enable("PlayerButtonTutorialLabel5");
                inGameUI.Enable("LeftArrow");
                inGameUI.firstNappy = true;
            }
        }

        sm = GameObject.Find("SoundManager").GetComponent<SoundManager>();
    }
Exemplo n.º 12
0
 //---
 void Awake()
 {
     // Two
     _InGameUIManager = GameObject.Find("UIManager");
     _ingame          = _InGameUIManager.GetComponent <InGameUIManager>();
     //------
 }
Exemplo n.º 13
0
    private void SetMeAsReferenceToInGameUIManager()
    {
        if (!inGameUIManagerRefOfMeIsSet)
        {
            if (amIPlayerOne)
            {
                inGameUIManager_Ref.PlayerOnePrintText_Ref = this;
                inGameUIManagerRefOfMeIsSet = true;
            }
            else
            {
                if (inGameUIManager_Ref != null)
                {
                    inGameUIManager_Ref.PlayerTwoPrintText_Ref = this;

                    inGameUIManagerRefOfMeIsSet = true;
                }
                else
                {
                    inGameUIManager_Ref = InGameUIManager.GetInstance();

                    if (inGameUIManager_Ref != null)
                    {
                        inGameUIManager_Ref.PlayerTwoPrintText_Ref = this;

                        inGameUIManagerRefOfMeIsSet = true;
                    }
                    else
                    {
                        Debug.Log("PrintText on: " + gameObject.name + ", is missing a value for inGameUIManager_Ref");
                    }
                }
            }
        }
    }
Exemplo n.º 14
0
 private void Start()
 {
     TWTransition.FadeOut();
     Init();
     instance = this;
     Debug.Log(GameVariables.ACTIVE_LEVEL.coinCollect);
 }
Exemplo n.º 15
0
    // Use this for initialization
    void InitGame()
    {
        gameTouchController = new GameTouchController();

        //创建角色
        GameObject roleObj = Resources.Load("Prefabs/MapObj/InGameRole") as GameObject;

        roleObj = Instantiate(roleObj);
        role    = roleObj.GetComponent <InGameRole>();

        roleObj.transform.position = new Vector3(0, GetGameRect().y + 5, 0);

        gameEffectManager = new GameEffectManager();

        //
        inGameLevelManager = new InGameLevelManager();
        inGameLevelManager.Init();

        inGameUIManager = new InGameUIManager();
        inGameUIManager.Init();

        int selmodel = PlayerPrefs.GetInt(GameConst.USERDATANAME_MODEL, 0);

        modelManager = InGameBaseModel.Create(selmodel);
        modelManager.Init();

        inGameColorManager = new InGameColorManager();
        inGameColorManager.Init();

        gameState = enGameState.playing;
    }
Exemplo n.º 16
0
 //---
 void Awake()
 {
     // Two
     _InGameUIManager = GameObject.Find ("UIManager");
     _ingame = _InGameUIManager.GetComponent<InGameUIManager>();
     //------
 }
Exemplo n.º 17
0
    void Start()
    {
        gameStateMachine_Ref = GameStateMachine.GetInstance();

        myImage         = GetComponent <Image>();
        addToFrameIndex = true;

        if (amountOfLoops == 0)
        {
            amountOfLoops = 1;
        }
        if (frameInterval == 0)
        {
            frameInterval = 0.1f;
        }

        if (gameStateMachine_Ref.devMode)
        {
            Destroy(this);
        }
        if (playerOne && !victoryScreen)
        {
            mySprites = gameStateMachine_Ref.PlayerCharacterArray[0].MySprites;

            if (!introText)
            {
                InGameUIManager.GetInstance().playerOneUIAnim_Ref = this;
            }
            else
            {
                InGameUIManager.GetInstance().playerOneIntroUIAnim_Ref = this;
            }
        }
        else
        {
            mySprites = gameStateMachine_Ref.PlayerCharacterArray[1].MySprites;
            if (!introText)
            {
                InGameUIManager.GetInstance().playerTwoUIAnim_Ref = this;
            }
            else
            {
                InGameUIManager.GetInstance().playerTwoIntroUIAnim_Ref = this;
            }
        }

        if (victoryScreen)
        {
            if (gameStateMachine_Ref.PlayerOneWon)
            {
                mySprites = gameStateMachine_Ref.PlayerCharacterArray[0].MySprites;
            }
            else
            {
                mySprites = gameStateMachine_Ref.PlayerCharacterArray[1].MySprites;
            }
            myPrintText = transform.parent.GetComponentInChildren <PrintText>();
        }
    }
Exemplo n.º 18
0
 private void Start()
 {
     ui = InGameUIManager.Instance;
     ui.ActionButton.onClick.AddListener(player.OnActionButtonClicked);
     ui.TransformationButton.onClick.AddListener(player.OnTransformationButtonClicked);
     leftButton  = ui.LeftButton.GetComponent <ButtonPressHandler>();
     rightButton = ui.RightButton.GetComponent <ButtonPressHandler>();
 }
Exemplo n.º 19
0
 /// <summary>
 /// Initialises the class. Sets the singleton object of InGameUIManager.
 /// </summary>
 private void Start()
 {
     if (s_Singleton != null)
     {
         Destroy(this);
         return;
     }
     s_Singleton = this;
 }
Exemplo n.º 20
0
 public virtual void DrawScreenUI()
 {
     UIManager.Draw(SpriteBatch);
     GameObjectManager.DrawScreenUI(SpriteBatch);
     InGameUIManager.DrawScreenUI(SpriteBatch);
     UIManager.DrawScreenUI(SpriteBatch);
     // This name is misleading - ingameui really refers to HoverInfoUI
     ScriptManager.DrawUI(SpriteBatch);
 }
Exemplo n.º 21
0
    public void SetVals(InGameUIManager manager)
    {
        lifeVisualInvoker = gameObject.AddComponent <LifeVisualInvoker>();

        life = gameObject.AddComponent <AddLife>();
        life.SetVals(manager);

        lifeVisualInvoker.setCommand(life);
    }
Exemplo n.º 22
0
    private void OnDestroy()
    {
        if (Instance != this)
        {
            return;
        }

        Instance = null;
    }
Exemplo n.º 23
0
    void Awake()
    {
        GameObject findObject = GameObject.Find("UIManager");

        if (findObject != null)
        {
            _uiManager = findObject.GetComponent <InGameUIManager>();
        }
    }
Exemplo n.º 24
0
        public virtual void Draw()
        {
            GameObjectManager.Draw(SpriteBatch);
            GameObjectManager.DrawInGameUI(SpriteBatch);
            InGameUIManager.Draw(SpriteBatch);
            InGameUIManager.DrawInGameUI(SpriteBatch);
            UIManager.DrawInGameUI(SpriteBatch);

            ScriptManager.Draw(SpriteBatch);
        }
Exemplo n.º 25
0
 void Update()
 {
     if (getHP() <= 0)
     {
         getAnimator().SetBool("dead", true);
         GameStateManager.Inst().setState(State.END);
         InGameUIManager.Inst().resultTextUpdate();
         InGameUIManager.Inst().OnStateChanged(State.END);
     }
 }
Exemplo n.º 26
0
 public void turnOver()
 {
     if (currentTurn == GameTurn.PLAYER)
     {
         for (int i = 0; i < enemies.Length; ++i)
         {
             if (enemies[i].gameObject.activeSelf)
             {
                 if (enemies[i].getStatusEffect() == StatusEffect.Corrosion)
                 {
                     enemies[i].GetDamaged((int)(enemies[i].getMaxHP() * 0.05f));
                     enemies[i].mobDead();
                 }
                 if (enemies[i].getStatusEffect() == StatusEffect.Frostbite)
                 {
                     enemies[i].setMoveable(!enemies[i].isMoveable());
                 }
                 if (enemies[i].getStatusEffect() != StatusEffect.None)
                 {
                     enemies[i].setStatusRemainTurn(enemies[i].getStatusRemainTurn() - 1);
                     if (enemies[i].getStatusRemainTurn() <= 0)
                     {
                         enemies[i].setStatusEffect(StatusEffect.None);
                         enemies[i].setMoveable(true);
                     }
                 }
             }
         }
         currentTurn = GameTurn.ENEMY;
         cost        = ++maxCost;
         if (maxCost > 10)
         {
             cost = maxCost = 10;
         }
         InGameUIManager.Inst().costTextUpdate();
     }
     else
     {
         if (PlayerManager.Inst().getPlayer().getStatusEffect() == StatusEffect.Frostbite)
         {
             PlayerManager.Inst().getPlayer().setMoveable(!PlayerManager.Inst().getPlayer().isMoveable());
         }
         if (PlayerManager.Inst().getPlayer().getStatusEffect() != StatusEffect.None)
         {
             PlayerManager.Inst().getPlayer().setStatusRemainTurn(PlayerManager.Inst().getPlayer().getStatusRemainTurn() - 1);
             if (PlayerManager.Inst().getPlayer().getStatusRemainTurn() <= 0)
             {
                 PlayerManager.Inst().getPlayer().setStatusEffect(StatusEffect.None);
                 PlayerManager.Inst().getPlayer().setMoveable(true);
             }
         }
         currentTurn = GameTurn.PLAYER;
     }
     InGameUIManager.Inst().HPbarUpdate();
 }
Exemplo n.º 27
0
 void Awake()
 {
     if (inGameUIManager_Ref == null)
     {
         inGameUIManager_Ref = this;
     }
     else
     {
         Destroy(this);
     }
 }
Exemplo n.º 28
0
        public virtual void HandleInput()
        {
            ScriptManager.HandleInput();

            if (ScriptManager.UpdateGame)
            {
                GameObjectManager.HandleInput();
                UIManager.HandleInput();
                InGameUIManager.HandleInput();
            }
        }
Exemplo n.º 29
0
 private void Awake()
 {
     if (m_instance == null)
     {
         m_instance = this;
     }
     else if (m_instance != this)
     {
         Destroy(this);
     }
 }
Exemplo n.º 30
0
 private void Start()
 {
     UINavigation.instance.ActiveNavigation(false);
     TWLoading.OnSuccessLoad(() => TWTransition.FadeOut());
     Init();
     levelClear = false;
     instance   = this;
     if (GameVariables.ACTIVE_LEVEL != null)
     {
         info = GameVariables.ACTIVE_LEVEL;
     }
 }
Exemplo n.º 31
0
 void Start()
 {
     distance = 5 + villageNum * 3;
     progress = 0;
     if (GameStateManager.Inst().getState() == State.PAUSE)
     {
         GameStateManager.Inst().setState(State.INGAME);
     }
     InGameUIManager.Inst().progressUpdate(progress);
     InGameUIManager.Inst().combinationTextUpdate();
     InGameUIManager.Inst().HPbarUpdate();
 }
Exemplo n.º 32
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        canvasGroup = GetComponent <CanvasGroup>();
    }
Exemplo n.º 33
0
        public virtual void Initialize()
        {
            if (Background != null)
            {
                Background.Initialize();
            }

            GameObjectManager.Initialize();
            UIManager.Initialize();
            InGameUIManager.Initialize();

            AddScripts();
            ScriptManager.LoadAndAddScripts(Content);
        }
Exemplo n.º 34
0
    void Start()
    {
        bottles = GameObject.Find("BottlesSpawner").GetComponent<BottlesSpawner>();
        buttonReleaseScript = GameObject.Find("ButtonRelease").GetComponent<ButtonReleased>();
        inGameUI = GameObject.Find("InGameUIManager").GetComponent<InGameUIManager>();
        menuButtonScript = GameObject.Find("UIPanel").GetComponent<MenuButton>();
        sm = GameObject.Find("SoundManager").GetComponent<SoundManager>();

        inGameUI.PF_Bottle = this.gameObject;

        if(!bottles.firstTimeBottleClicked && inGameUI.isLevel1)
        {
            inGameUI.Enable("5. CollectBottles");
            bottles.firstTimeBottleClicked = true;
        }

        //pbm.totalBottles++;
    }
Exemplo n.º 35
0
    void Start()
    {
        attackDelay = false;
        bottles = GameObject.Find("BottlesSpawner").GetComponent<BottlesSpawner>();
        buttonReleaseScript = GameObject.Find("ButtonRelease").GetComponent<ButtonReleased>();
        enemySpawner = GameObject.Find("EnemySpawner").GetComponent<EnemySpawner>();
        gameOverObj = GameObject.FindGameObjectWithTag("GO");
        gameSpawnScript = GameObject.Find("GameSpawner").GetComponent<GameSpawner>();
        inGameUI = GameObject.Find("InGameUIManager").GetComponent<InGameUIManager>();
        killed = false;
        nappyPad = GameObject.Find("NappyPadSpawner").GetComponent<NappyPadSpawner>().PF_NappyPad;
        nappyPadObj = GameObject.FindGameObjectWithTag("Ammo");

        if(nappyPadObj != null)
        {
            nappyPadScript = nappyPadObj.GetComponent<NappyPad>();
        }

        nappyPadShadow = GameObject.Find("NappyPadSpawner").GetComponent<NappyPadSpawner>().PF_NappyPadShadow;
        playerSpawn = GameObject.FindGameObjectWithTag("SpawnBlock").GetComponent<PlayerSpawn>();
        sm = GameObject.Find("SoundManager").GetComponent<SoundManager>();
        laugh = sm.laugh;

        SetState(0);
    }
Exemplo n.º 36
0
	// Use this for initialization
	void Start ()
	{
		instance = this;
	}
Exemplo n.º 37
0
    void Start()
    {
        gameSpawnScript = GameObject.Find("GameSpawner").GetComponent<GameSpawner>();

        if(gameSpawnScript.level == 2)
        {
            cowButton = GameObject.Find("CowButton").GetComponent<Button>();
            cowTickImage = GameObject.Find("CowTick").GetComponent<Image>();
        }

        if(gameSpawnScript.level == 3)
        {
            broccoliButton = GameObject.Find("BroccoliButton").GetComponent<Button>();
            broccoliTickImage = GameObject.Find("BroccoliTick").GetComponent<Image>();
            cowButton = GameObject.Find("CowButton").GetComponent<Button>();
            cowTickImage = GameObject.Find("CowTick").GetComponent<Image>();
        }

        inGameUIObj = GameObject.Find("InGameUIManager");
        tomatoButton = GameObject.Find("TomatoButton").GetComponent<Button>();
        tomatoTickImage = GameObject.Find("TomatoTick").GetComponent<Image>();

        if(broccoliButton != null)
        {
            broccoliButtonColours = broccoliButton.colors;
        }

        if(cowButton != null)
        {
            cowButtonColours = cowButton.colors;
        }

        if(inGameUIObj != null)
        {
            inGameUIScript = inGameUIObj.GetComponent<InGameUIManager>();
        }

        if(tomatoButton != null)
        {
            tomatoButtonColours = tomatoButton.colors;
        }

        sm = GameObject.Find("SoundManager").GetComponent<SoundManager>();
    }
Exemplo n.º 38
0
    void Start()
    {
        manager = GetComponent<UIManager> ();
        startMenu = GetComponent<StartMenuManager> ();
        worldSelect = GetComponent<WorldSelectManager>();
        levelSelect = GetComponent<LevelSelectManager>();
        inGameUI = GetComponent<InGameUIManager> ();
        pauseMenu = GetComponent<PauseMenuManager> ();
        levelFail = GetComponent<LevelFailManager> ();
        levelSuccess = GetComponent<LevelSuccessManager> ();
        creditMenu = GetComponent<CreditsMenuManager> ();

        SetUIState(UIState.StartMenu);
    }
Exemplo n.º 39
0
    void Start()
    {
        igu = GameObject.Find("InGameUIManager").GetComponent<InGameUIManager>();
        menuButtonScript = FindObjectOfType<MenuButton>();
        PF_BroccoliBaby = Resources.Load("PF_BroccoliBaby") as GameObject;
        PF_Cow = Resources.Load("PF_Cow") as GameObject;
        PF_TomatoBaby = Resources.Load("PF_TomatoBaby") as GameObject;
        sm = GameObject.Find("SoundManager").GetComponent<SoundManager>();
        tomatoButtonImage = GameObject.Find("TomatoButton").GetComponent<Image>();

        if(gameSpawnScript == null)
        {
            gameSpawnScript = GameObject.Find("GameSpawner").GetComponent<GameSpawner>();
        }
    }