Beispiel #1
0
    IEnumerator Player1UI()
    {
        //Debug.Log("UISetUpRunning");
        //Spawn UI elements
        p1uiCopy = Instantiate(p1_UI, UICanvas.position, Quaternion.identity) as GameObject;

        //Get transform
        p1Transform = p1uiCopy.GetComponent <RectTransform>();

        //Set parent to canvas
        p1uiCopy.transform.SetParent(UICanvas);

        //Set Position
        p1Transform.position = new Vector2(0, 1050);//or 50/479

        //Get Info
        p1_UI_Info = p1uiCopy.GetComponent <UIMaster>();

        //CanvasGroup
        p1CanvasGroup = p1_UI_Info.GetComponentInChildren <CanvasGroup>();

        yield return(new WaitForSeconds(0.05f));

        //P1
        //UI references
        //Health
        //player1HealthScript.healthBar = p1_UI_Info.healthBar;
        player1HealthScript.healthNum = p1_UI_Info.healthNum;

        //Shields
        player1HealthScript.overchargeBar = p1_UI_Info.shieldsBar;

        //SpeedBuff
        player1HealthScript.speedBar = p1_UI_Info.speedBar;

        //to Color
        //player1SpriteManager.healthBar = p1_UI_Info.healthBar;
        player1SpriteManager.playerNum    = p1_UI_Info.playerNum;
        player1SpriteManager.healthText   = p1_UI_Info.healthNum;
        player1SpriteManager.abilityMeter = p1_UI_Info.abilityMeter;
        player1SpriteManager.glow         = p1_UI_Info.glow;
        player1SpriteManager.uiSpinner    = p1_UI_Info.playerSpinner;

        player1SpriteManager.SpriteSet();

        //AbilityMeter Tracking
        player1AbilityScript.uiAbilityMeter = p1_UI_Info.abilityMeter;

        //yield return new WaitForSeconds(0.05f);

        p1CanvasGroup.alpha = 0;
    }
Beispiel #2
0
    IEnumerator Player3UI()
    {
        p3uiCopy = Instantiate(p3_UI, UICanvas.position, Quaternion.identity) as GameObject;

        p3Transform = p3uiCopy.GetComponent <RectTransform>();

        p3uiCopy.transform.SetParent(UICanvas);

        p3Transform.position = new Vector2(0, 10);

        p3_UI_Info = p3uiCopy.GetComponent <UIMaster>();

        yield return(new WaitForSeconds(0.05f));

        //CanvasGroup
        p3CanvasGroup = p3_UI_Info.GetComponentInChildren <CanvasGroup>();



        //P3
        //UI references
        //Health
        //player3HealthScript.healthBar = p3_UI_Info.healthBar;
        player3HealthScript.healthNum = p3_UI_Info.healthNum;

        //Shields
        player3HealthScript.overchargeBar = p3_UI_Info.shieldsBar;

        //SpeedBuff
        player3HealthScript.speedBar = p3_UI_Info.speedBar;

        //to Color
        //player3SpriteManager.healthBar = p3_UI_Info.healthBar;
        player3SpriteManager.playerNum    = p3_UI_Info.playerNum;
        player3SpriteManager.healthText   = p3_UI_Info.healthNum;
        player3SpriteManager.abilityMeter = p3_UI_Info.abilityMeter;
        player3SpriteManager.glow         = p3_UI_Info.glow;
        player3SpriteManager.uiSpinner    = p3_UI_Info.playerSpinner;

        player3SpriteManager.SpriteSet();

        //AbilityMeter Tracking
        player3AbilityScript.uiAbilityMeter = p3_UI_Info.abilityMeter;

        //yield return new WaitForSeconds(0.05f);

        p3CanvasGroup.alpha = 0;
    }