예제 #1
0
    private IEnumerator DisplaySequence(UIDisplay uiDisplay)
    {
        HideAll();

        DecideIfShowTransition(uiDisplay);

        var timer = 0.0f;

        while (timer < HidingTime)
        {
            yield return(null);

            timer += Time.deltaTime;
        }

        HideAllInstantly();
        uiGroups.TryGetValue(uiDisplay, out currentUIGroup);
        Assert.IsNotNull(currentUIGroup, "UIGroup not found:" + uiDisplay + " currentUIGroup:" + currentUIGroup);

        currentUIGroup.Show();

        // Level loading does not put away the transition, it is put away by the gameplay

        PutAwayTransition();

        yield return(new WaitForSeconds(0.5f));

        if (uiDisplay == UIDisplay.MainMenu)
        {
            // don't do this until the screen is covered with the transition
            CoreGameControl.DisableGameRenderers();
            CoreConnector.CameraControl.DisableGameCamera();
            CoreConnector.CameraControl.DisableVisuals();
        }
    }
예제 #2
0
    // Use this for initialization
    IEnumerator Start()
    {
        uiDisplay = gameObject.GetComponent <UIDisplay> ();

        getPage();

        uiDisplay.getCountData(catName, (int count) => {
            if (count > 0)
            {
                //StartCoroutine (delayAddPage ());
                GetComponent <Animation> ().Play("openBook");
                if (count == 1)
                {
                    StartCoroutine(uiDisplay.LoadBookData(bookLeftImg, bookLeftText, curPageNumber, catName, true));
                }
                else if (count >= 2)
                {
                    StartCoroutine(uiDisplay.LoadBookData(bookLeftImg, bookLeftText, curPageNumber, catName, true));
                    StartCoroutine(uiDisplay.LoadBookData(pageLeftImg, pageLeftText, nextPageNumber, catName, false));
                }
            }
            else
            {
                bookActive.SetActive(true);
                StartCoroutine(delayAddPage());
            }
        });
        yield return(new WaitForSeconds(3f));

        bookActive.SetActive(false);
        animationAvailable = true;
    }
예제 #3
0
 // Use this for initialization
 void Start () {
     if (!Score_Tracker) { //If ScoreTracker is not set somewhere
         Score_Tracker = GameObject.Find("Canvas").GetComponent<UIDisplay>(); //Set the score tracker to the UIDisplay script on the canvas
     }
     Time.timeScale = 1;//Set Timescale to 1 to undo stop from previous games
     anim = GetComponent<Animator>();
 }
    // Use this for initialization
    void Start () {
        t = GetComponent<Transform>(); //Get transform of the object, used to represent its position and "center" of shockwave
        Score_Tracker = GameObject.Find("Canvas").GetComponent<UIDisplay>(); //Get the script that tracks the score on the Canvas for UI display

        ShockWaveAttack(rad); //As soon as the shockwave is "spawned", use the function for its attack
        Instantiate(shockwave, transform.position, Quaternion.identity);
    }
예제 #5
0
    // private void Awake() {
    //     SetupSingleton();
    // }

    void Start()
    {
        ui = FindObjectOfType <UIDisplay>();
        winLabel.SetActive(false);
        loseLabelOne.SetActive(false);
        loseLabelTwo.SetActive(false);
        ui.ShowScore(score);
    }
    public float rad = 50f; //Use a huge radius with Shockwave Programming to envelop screen

    // Use this for initialization
    void Start () {
        t = GetComponent<Transform>(); //Get transform of the object, used to represent its position and "center" of shockwave
        Score_Tracker = GameObject.Find("Canvas").GetComponent<UIDisplay>(); //Get the script that tracks the score on the Canvas for UI display

        GameObject.Find("ScreenFlash").GetComponent<FlashScript>().FlashOn(); //Trigger the flash effect

        ScreenNukeAttack(rad); //As soon as the shockwave is "spawned", use the function for its attack
    }
예제 #7
0
    void HighlightVisual(bool value, UIDisplay display)
    {
        Color color = value ? colorFront : colorBack;

        display.box.GetComponent <RawImage>().color = color;
        display.arrow.SetActive(!value);
        display.title.GetComponent <RawImage>().color = color;
        display.title.interactable = !value;
    }
예제 #8
0
    private void SetDisplays()
    {
        UIDisplay previousBox = GetBoxByState(previousState);
        UIDisplay currentBox  = GetBoxByState(state);

        HighlightVisual(false, previousBox);
        HighlightVisual(true, currentBox);
        SetDrawOrder(currentBox.box.transform, previousBox.box.transform);
    }
예제 #9
0
    public void Display(UIDisplay uiDisplay)
    {
        if (coroutine != null)
        {
            StopCoroutine(coroutine);
        }

        coroutine = DisplaySequence(uiDisplay);
        StartCoroutine(coroutine);
    }
예제 #10
0
    void Start()
    {
        defenderParent = GameObject.Find("Defenders");
        starDisplay    = GameObject.FindObjectOfType <UIDisplay>();

        if (!defenderParent)
        {
            defenderParent = new GameObject("Defenders");
        }
    }
예제 #11
0
    void Start()
    {
        m_Camera.transform.position = m_CamOffset;
        m_CameraControl             = m_Camera.GetComponent <CameraControl>();
        // Disable camera control to not interfere with the starting screen
        m_CameraControl.enabled = false;

        // Get UI component to display text on screen
        uidisplay = m_Display.GetComponent <UIDisplay>();

        // Get audio source for background music and winning sound
        audioSource = GetComponent <AudioSource>();
    }
예제 #12
0
    // Use this for initialization
    void Start () {
        t = GetComponent<Transform>(); //Get Transform of this shot GameObject
        Shot_start = transform.position;

        Score_Tracker = GameObject.Find("Canvas").GetComponent<UIDisplay>();

        Dabba_Loc = GameObject.Find("Dabba").GetComponent<Transform>(); //Get the Transform of Dabba at the time the shot is spawned
        Dabba_start = Dabba_Loc.position; //Get Dabba's position when the projectile is spawned

        direction = (Dabba_start - Shot_start).normalized;

        t.position = new Vector3(t.position.x, t.position.y, t.position.y); //Set the position of the object so its z value matches its Y value for layering purposes
    }
    void Awake() { //For Scattershot, initialize these values on Awake() instead of on Start(). This ensures they have these values as soon as they exist

        t = GetComponent<Transform>(); //Get Transform of this shot GameObject
        Shot_start = transform.position;

        Score_Tracker = GameObject.Find("Canvas").GetComponent<UIDisplay>();

        Dabba_Loc = GameObject.Find("Dabba").GetComponent<Transform>(); //Get the Transform of Dabba at the time the shot is spawned
        Dabba_start = Dabba_Loc.position; //Get Dabba's position when the projectile is spawned


        direction = (Dabba_start - Shot_start); //Normalize the direction towards the point in question for use in movement
        direction.Normalize();

        t.position = new Vector3(t.position.x, t.position.y, t.position.y); //Set the position of the object so its z value matches its Y value for layering purposes        
    }
예제 #14
0
    private void DecideIfShowTransition(UIDisplay uiDisplay)
    {
        // gameplay UI won't load the transition because it is already shown by the Loading screen
        if (uiDisplay == UIDisplay.GamePlay || uiDisplay == UIDisplay.GameOver ||
            uiDisplay == UIDisplay.LevelComplete)
        {
            // not showing transition
            return;
        }

        if (mainMenu.ShowCount < 1)
        {
            // if this is the first time the game has shown the main menu, then don't show the transition
            return;
        }

        ShowTransition();
    }
예제 #15
0
 public void Awake()
 {
     if (emptyListIfStarted && GameStateManager.singleton?.gameStarted == true)
     {
         foreach (UIElement e in elements)
         {
             if (e.gameObject.name != "CountdownTimer")
             {
                 GameObject.Destroy(e.gameObject);
             }
         }
         StartFromBeginning = false;
         PressAnyButton.SetActive(false);
     }
     foreach (UIElement e in elements)
     {
         e.gameObject.SetActive(false);
     }
     singleton = this;
 }
예제 #16
0
        public void GetCustomerInfo()
        {
            sc.Clear();
            UIDisplay.MenuTitle("Customer information: ");
            this.Name    = UIDisplay.GetUserInfo("Please enter your name: ");
            this.Address = UIDisplay.GetUserInfo("Please enter your address: ");

            Match match;
            Regex regex = new Regex(@"^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$");

            do
            {
                this.PhoneNumber = UIDisplay.GetUserInfo("Please enter your phone#: ");
                match            = regex.Match(this.PhoneNumber);

                if (!match.Success)
                {
                    UIDisplay.InvalidEntry(this.PhoneNumber);
                }
            } while (!match.Success);
        }
예제 #17
0
    void Awake()
    {
        UIDisplayComponent = mainDisplay.GetComponent <UIDisplay>();

        if (UIDisplayComponent)
        {
            UIDisplayComponent.Init(this);
            if (Level.currentLevelInfo.TotalDropsPerLevel > 0)
            {
                UIDisplayComponent.DropsLeftText = Level.currentLevelInfo.TotalDropsPerLevel.ToString();
            }
            else
            {
                UIDisplayComponent.DropsLeftText = "Unlimited";
            }
            UIDisplayComponent.SetTotalDrops(Level.currentLevelInfo.DropsPerRound);

            UIDisplayComponent.GameTypeText = "GameType: " + Level.currentLevelInfo.LevelType;
        }
        currentGameStats.init();
    }
예제 #18
0
    // Use this for initialization
    void Start () {
        t = GetComponent<Transform>();
        t.position = new Vector3(t.position.x, t.position.y, t.position.y); //Set the position of the object so its z value matches its Y value for layering purposes

        Score_Tracker = GameObject.Find("Canvas").GetComponent<UIDisplay>();
    }
예제 #19
0
 // Use this for initialization
 void Awake()
 {
     map        = FindObjectOfType <mapGenerator>();
     ui         = FindObjectOfType <UIDisplay>();
     pathFinder = GameObject.FindGameObjectWithTag("pathfinding").GetComponent <PathFinding>();
 }
 // Use this for initialization
 public void Start()
 {
     flowerDisplay = GameObject.Find("FlowerDisplay").GetComponent <UIDisplay>();
 }
 // Use this for initialization
 void Start () {
     if (!Score_Tracker)
     { //If ScoreTracker is not set somewhere
         Score_Tracker = GameObject.Find("Canvas").GetComponent<UIDisplay>(); //Set the score tracker to the UIDisplay script on the canvas
     }
 }
 private void Start()
 {
     UID = GameObject.Find("coinText").GetComponent <UIDisplay>();
 }
예제 #23
0
 void Start()
 {
     path = FindObjectOfType <PathFinding>();
     ui   = FindObjectOfType <UIDisplay>();
     hive = FindObjectOfType <GhostHivemindMovement>();
 }