protected virtual void Start()
        {
            sceneController   = FreeRoamSceneController.GetFreeRoamSceneController(gameObject.scene);
            textBoxController = TextBoxController.GetTextBoxController(gameObject.scene);

            RefreshGridPositions();
        }
        private void Start()
        {
            textBoxController = TextBoxController.GetTextBoxController(gameObject.scene);

            controlEnabled = true;

            pointer.SetMenuController(this);

            boxAreaController.SetPointerGameObject(pointer);
            partyAreaController.SetPointerGameObject(pointer);
            closeButton.SetPointerGameObject(pointer);

            boxAreaController.SetUp(this);
            partyAreaController.SetUp(this);

            closeButton.OnClick.AddListener(() => {
                if (controlEnabled)
                {
                    CloseMenu();
                }
            });

            SetCurrentBoxIndex(0);
            RefreshPartyPokemon();

            SelectDefaultEventSystemGameObject();
        }
Beispiel #3
0
        private void Start()
        {
            HideMenu();

            itemDetailsController.SetItem(null, false); //Second parameter doesn't matter if setting as null
            itemsListController.SetUp(fullBorderPrefab, (index) => OnItemSelected(index));
            itemsListController.itemIndexSelected.RemoveAllListeners();
            itemsListController.itemIndexSelected.AddListener(index => SetCurrentSelectionIndex(index));

            RefreshPlayerMoneyText();

            if (buttonBack.GetComponent <MenuSelectableController>() == null)
            {
                Debug.LogError("No MenuSelectableController on back button");
            }
            buttonBack.onClick.RemoveAllListeners();
            buttonBack.onClick.AddListener(BackButtonPressed);

            textBoxController = TextBoxController.GetTextBoxController(gameObject.scene);
        }
        protected override void SetUp()
        {
            textBoxController = TextBoxController.GetTextBoxController(gameObject.scene);

            buttonBack.onClick.AddListener(() => CloseMenu());

            currentSectionIndex = 0;
            currentActionIndex  = 0;
            currentItemIndex    = 0;
            currentItems        = new Item[0];

            actionsBarController.SetUp(this, fullBorderPrefab);
            sectionsBarController.SetUp(this, fullBorderPrefab);
            itemsListController.SetUp(fullBorderPrefab, (index) => OnSelectItem(index));
            pokemonSelectionController.SetUp(this);
            itemsListController.itemIndexSelected.RemoveAllListeners();
            itemsListController.itemIndexSelected.AddListener(index =>
            {
                currentItemIndex = index;
                RefreshCurrentItem();
            });

            ChangeToSectionSelection();
        }
 private void Start()
 {
     textBoxController = TextBoxController.GetTextBoxController(gameObject.scene);
 }
Beispiel #6
0
 protected virtual void Start()
 {
     textBoxController = TextBoxController.GetTextBoxController(Scene);
 }
 public virtual void SetUp()
 {
     textBoxController = TextBoxController.GetTextBoxController(gameObject.scene);
 }
Beispiel #8
0
        private void Start()
        {
            textBoxController = TextBoxController.GetTextBoxController(Scene);

            SetUpScene();
        }
        public IEnumerator RunAnimation(PokemonInstance sendPmon,
                                        PokemonInstance recvPmon)
        {
            textBoxController = TextBoxController.GetTextBoxController(gameObject.scene);

            PokeBall sendPokeBall = PokeBall.GetPokeBallById(sendPmon.pokeBallId);
            PokeBall recvPokeBall = PokeBall.GetPokeBallById(recvPmon.pokeBallId);

            Vector3 pokemonInitialScale = PokemonTransform.localScale;

            //Initialise visibilities
            pokemonImage.enabled  = true;
            pokeBallImage.enabled = false;

            //Initialise sprites
            pokemonImage.sprite  = sendPmon.LoadSprite(PokemonSpecies.SpriteType.Front1);
            pokeBallImage.sprite = sendPokeBall.GetSprite(PokeBall.SpriteType.Neutral);

            //Initialise positions
            PokemonTransform.position  = mainRootTransform.position;
            PokeBallTransform.position = mainRootTransform.position;

            //Goodbye message
            yield return(StartCoroutine(
                             textBoxController.RevealText(goodbyeMessagePrefix + sendPmon.GetDisplayName() + goodbyeMessageSuffix, true)
                             ));

            //Send pokemon cry
            SoundFXController.PlayPokemonCry(sendPmon.speciesId);

            //Send pokemon bouncing
            for (byte i = 0; i < sendPmonBonuceCount; i++)
            {
                yield return(StartCoroutine(Animation_Bounce(PokemonTransform)));
            }

            //Delay
            yield return(new WaitForSeconds(jumpScaleDelay));

            //Open and show poke ball
            pokeBallImage.enabled = true;
            pokeBallImage.sprite  = sendPokeBall.GetSprite(PokeBall.SpriteType.Open);

            //Shrink and hide pokemon
            yield return(StartCoroutine(GradualEffect(
                                            t =>
            {
                PokemonTransform.localScale = pokemonInitialScale * (1 - t);
            },
                                            shrinkGrowTime)));

            pokemonImage.enabled = false;

            //Close poke ball
            pokeBallImage.sprite = sendPokeBall.GetSprite(PokeBall.SpriteType.Neutral);

            //Delay
            yield return(new WaitForSeconds(pokeBallCloseSendDelay));

            //Send away poke ball
            yield return(StartCoroutine(Animation_GradualLinearFunctionMovement(PokeBallTransform,
                                                                                pokeBallOffScreenTransform.position,
                                                                                t => Vector2.up * pokeBallFactorDisplacementCurve_y.Evaluate(t),
                                                                                t => Vector2.right * pokeBallAddedDisplacementCurve_x.Evaluate(t) * addedDisplacementFactor,
                                                                                pokeBallSendReturnTime)));

            //Wait
            yield return(new WaitForSeconds(pokeBallReturnDelay));

            //Switch pokemon and poke ball sprites
            pokemonImage.sprite  = recvPmon.LoadSprite(PokemonSpecies.SpriteType.Front1);
            pokeBallImage.sprite = recvPokeBall.GetSprite(PokeBall.SpriteType.Neutral);

            //Return poke ball
            yield return(StartCoroutine(Animation_GradualLinearFunctionMovement(PokeBallTransform,
                                                                                mainRootTransform.position,
                                                                                t => Vector2.up * pokeBallFactorDisplacementCurve_y.Evaluate(t),
                                                                                t => Vector2.right * pokeBallAddedDisplacementCurve_x.Evaluate(t) * addedDisplacementFactor,
                                                                                pokeBallSendReturnTime)));

            //Delay
            yield return(new WaitForSeconds(pokeBallRecvOpenDelay));

            //Open poke ball
            pokeBallImage.sprite = recvPokeBall.GetSprite(PokeBall.SpriteType.Open);

            //Show and grow pokemon
            pokemonImage.enabled = true;
            yield return(StartCoroutine(GradualEffect(
                                            t =>
            {
                PokemonTransform.localScale = pokemonInitialScale * t;
            },
                                            shrinkGrowTime)));

            //Delay
            yield return(new WaitForSeconds(jumpScaleDelay));

            //Recv pokemon cry
            SoundFXController.PlayPokemonCry(recvPmon.speciesId);

            //Receive pokemon bouncing
            for (byte i = 0; i < recvPmonBounceCount; i++)
            {
                yield return(StartCoroutine(Animation_Bounce(PokemonTransform)));
            }

            //Delay
            yield return(new WaitForSeconds(endDelayTime));

            //Receiving message
            yield return(StartCoroutine(
                             textBoxController.RevealText(receiveMessagePrefix + recvPmon.GetDisplayName() + receiveMessageSuffix, true)
                             ));
        }