Example #1
0
    private void Start()
    {
        recipeCanvas             = GetComponentsInChildren <Canvas>()[0];
        progressBarCanvas        = GetComponentsInChildren <Canvas>()[1];
        destroyProgressBarCanvas = GetComponentsInChildren <Canvas>()[2];

        progressBarCanvas.worldCamera        = Camera.main;
        destroyProgressBarCanvas.worldCamera = Camera.main;
        forgingProgressBar = progressBarCanvas.GetComponentInChildren <ProgressBarBehaviour>();
        destroyProgressBar = destroyProgressBarCanvas.GetComponentInChildren <ProgressBarBehaviour>();

        resourceList = new List <Resource>();

        // [0] - Background image
        // [1 - 4] Resource images
        // [5 - ] Progress bar images
        resourceImages = GetComponentsInChildren <Image>();

        if (forgingProgressBar != null)
        {
            forgingProgressBar.enabled = false;
            progressBarCanvas.enabled  = false;
        }

        if (destroyProgressBar != null)
        {
            destroyProgressBar.enabled       = false;
            destroyProgressBarCanvas.enabled = false;
        }

        metadataManager = MetadataManager.Instance;
    }
    private void Start()
    {
        healthBarBehaviour = healthBar.GetComponent <ProgressBarBehaviour>();

        healthBarBehaviour.maxSize = enemyHealth;
        healthBarBehaviour.IncrementValue(enemyHealth);
    }
Example #3
0
    private void UpdateCraftIconProgressBar(int slotIndex, RectTransform iconPanel)
    {
        ProgressBarBehaviour progressBar = iconPanel.GetComponentInChildren <ProgressBarBehaviour>();

        iconProgressMap[iconPanel] += Time.deltaTime * 100.0f / CraftingManager.Instance.slotRefreshSeconds;
        progressBar.Value           = iconProgressMap[iconPanel];
    }
        private void Start()
        {
            Figures = new Figure[20, 15];

            var cellPosition = hexGrid.GetCell(new Vector3(155.8846f, -0.4045f, 30.0f)).transform.position;

            SpawnFigure(2, 8, 2, 155.8846f, -0.4045f, 30.0f);
            hexGrid.GetCell(new Vector3(155.8846f, -0.4045f, 30.0f)).Walled        = true;
            hexGrid.GetCell(new Vector3(155.8846f, -0.4045f, 30.0f)).isWallCapsule = true;
            SpawnFigure(3, 2, 13, 147.2243f, 0.8379046f, 195.0f);
            hexGrid.GetCell(new Vector3(147.2243f, 0.8379046f, 195.0f)).PlantLevel       = 3;
            hexGrid.GetCell(new Vector3(147.2243f, 0.8379046f, 195.0f)).isWallNonCapsule = true;
            camera = GameObject.Find("Hex Map Camera").GetComponent <HexMapCamera>();

            firstPlayerCounter  = 60.0f;
            secondPlayerCounter = 60.0f;

            playerOwnershipManager = hexGrid.GetComponent <PlayerOwnershipManager>();

            firstPlayerTimerbar        = GameObject.Find("First Player Timer Bar").GetComponent <ProgressBarBehaviour>();
            secondPlayerTimerbar       = GameObject.Find("Second Player Timer Bar").GetComponent <ProgressBarBehaviour>();
            firstPlayerTimerbar.Value  = 100;
            secondPlayerTimerbar.Value = 100;

            players = new Player[2] {
                new Player("first", BuildingType.WALLS), new Player("second", BuildingType.PLANTS)
            };
        }
    // Use this for initialization
    void Start()
    {
        gameControl         = GetComponent <GameController>();
        gameCtrlInputReader = GetComponent <GameCtrlInputReader>();
        graphControl        = GetComponent <GraphController>();

        progressBar    = FindObjectOfType <ProgressBarBehaviour>();
        progressBarObj = progressBar.gameObject;
        panelrecttrans = GameObject.Find("PanelLeft").GetComponent <RectTransform>();
        tlPaneltrans   = GameObject.Find("TimelinePanel").GetComponent <RectTransform>();
        progressBarObj.SetActive(false);

        nodename = GameObject.Find("Input_Text").GetComponent <InputField>();
        nodename.onValueChanged.AddListener((s) => NodeTextChanged(s));
        ShowPanel(panelVisible);
        slider.onValueChanged.AddListener((pos) => graphControl.SetTimePosition(pos));

        graphControl.PlayerPosition += GraphControl_PlayerPosition;
        btnPlay   = GameObject.Find("BtnPlay");
        btnPause  = GameObject.Find("BtnPause");
        btnStop   = GameObject.Find("BtnStop");
        btnRecord = GameObject.Find("BtnRecord");
        btnNext   = GameObject.Find("BtnNext");
        btnPrev   = GameObject.Find("BtnPrev");

        SetPlayState();
    }
Example #6
0
 // Use this for initialization
 void Start()
 {
     playerHPbar = GameObject.FindGameObjectWithTag("PlayerHP").GetComponent <ProgressBarBehaviour>();
     playerHPbar.ProgressSpeed = 500;
     playerMPbar = GameObject.FindGameObjectWithTag("PlayerMP").GetComponent <ProgressBarBehaviour>();
     playerMPbar.ProgressSpeed = 500;
     playerExpbar = GameObject.FindGameObjectWithTag("PlayerExp").GetComponent <ProgressBarBehaviour>();
     playerExpbar.ProgressSpeed = 500;
 }
Example #7
0
 public override void UpdateMe()
 {
     foreach (KeyValuePair <Player, GameObject> entry in collectingMap)
     {
         ProgressBarBehaviour progressBar = entry.Value.GetComponentInChildren <ProgressBarBehaviour>();
         collectingProgressMap[entry.Value] += Time.deltaTime * 100.0f / AppConstant.Instance.resourceCollectingSeconds;
         progressBar.Value = collectingProgressMap[entry.Value];
     }
 }
    IEnumerator Start()
    {
        BarBehaviour = GetComponent <ProgressBarBehaviour>();
        while (true)
        {
            yield return(new WaitForSeconds(UpdateDelay));

            BarBehaviour.Value = Random.value * 100;
        }
    }
Example #9
0
    private void EnableProgressBar(GameObject resource, bool enable)
    {
        ProgressBarBehaviour progressBar = resource.GetComponentInChildren <ProgressBarBehaviour>();

        progressBar.enabled         = enable;
        progressBar.Value           = 0.0f;
        progressBar.ProgressSpeed   = 1000;
        progressBar.TransitoryValue = 0.0f;
        resource.GetComponentInChildren <Canvas>().enabled = enable;
    }
Example #10
0
    IEnumerator Start()
    {
        lastcount    = 0;
        totalcount   = 0;
        barpercent   = 0;
        BarBehaviour = GetComponent <ProgressBarBehaviour>();

        //hiveButton = GetComponent<UnityEngine.UI.Button>();

        while (true)
        {
            yield return(new WaitForSeconds(UpdateDelay));

            int partcount = parts.particleCount;
            if (partcount != lastcount)
            {
                //				Debug.Log("partcount="+partcount);
                //				Debug.Log("lastcount="+lastcount);
                if (partcount > lastcount)
                {
                    totalcount += partcount;
                }
                lastcount = partcount;

                //				int x = (int)((totalcount / 30000f)*100);
                //				Debug.Log("totalcount=" + totalcount);
                //				Debug.Log("XXXXX=" + x);
                barpercent = (int)((totalcount / 10000f) * 100);
                if (barpercent > 100)
                {
                    hiveButton.SetActive(true);
                }

                if (totalcount > 10000)
                {
                    totalcount = 10000;
                }
                //hiveButton.interactable = true;
                //		SceneManager.LoadScene ("scene02");
                if (barpercent > 100)
                {
                    barpercent = 100;
                }
                //				barpercent += 1;
                //				Debug.Log("barpercent=>" + barpercent);
            }
            //BarBehaviour.Value = Random.value * 100;
            if (BarBehaviour.Value < 100)
            {
                BarBehaviour.Value = barpercent;
            }
            //				BarBehaviour.SetFillerSizeAsPercentage(barpercent);
            //print("new value: " + BarBehaviour.Value);
        }
    }
Example #11
0
 void Start()
 {
     BarBehaviour       = GetComponent <ProgressBarBehaviour>();
     BarBehaviour.Value = 0;
     recipeManagerObj   = GameObject.Find("RecipeManager");
     recipeManager      = recipeManagerObj.GetComponent <RecipeManager>();
     //totalSteps = this.transform.parent.parent.gameObject.GetComponent<RecipeManager>().getStepCanvas().getTotalSteps();
     //currentStep = this.transform.parent.parent.gameObject.GetComponent<RecipeManager>().getStepCanvas().getCurrentStep();
     totalSteps  = recipeManager.getStepCanvas().getTotalSteps();
     currentStep = recipeManager.getStepCanvas().getCurrentStep();
 }
Example #12
0
    // Use this for initialization
    void Start()
    {
        gameControl         = GetComponent <GameController>();
        gameCtrlInputReader = GetComponent <GameCtrlInputReader>();
        graphControl        = GetComponent <GraphController>();

        progressBar = FindObjectOfType <ProgressBarBehaviour>();
        //progressBarObj = progressBar.gameObject;

        progressBarObj.SetActive(false);
    }
    // Use this for initialization
    void Start()
    {
        gameControl         = GetComponent <GameController>();
        gameCtrlInputReader = GetComponent <GameCtrlInputReader>();
        graphControl        = GetComponent <GraphController>();

        progressBar    = FindObjectOfType <ProgressBarBehaviour>();
        progressBarObj = progressBar.gameObject;
        panelrecttrans = GameObject.Find("PanelLeft").GetComponent <RectTransform>();
        progressBarObj.SetActive(false);
    }
Example #14
0
 public void Init()
 {
     doneRecording = false;
     endPoints     = new List <GameObject> ();
     movePlayer    = gameObject.GetComponent <MovePlayer> ();
     FindEndPoints();
     initialPoseFrame     = GetCurrentPoseFrame();
     progressBarBehaviour = GameObject.Find("ProgressBar").GetComponent <ProgressBarBehaviour> ();
     onionCharacter       = GameObject.Find("Onion Character");
     onionMovePlayer      = onionCharacter.GetComponent <MovePlayer>();
 }
Example #15
0
 /// <summary>
 /// Instantiates progress bar variables.
 /// </summary>
 private void SetupProgressBar()
 {
     if (_progressBar == null)
     {
         GameObject progressBarObj = GameObject.FindGameObjectWithTag("ProgressBar");
         if (progressBarObj != null && progressBarObj.activeSelf)
         {
             _progressBar = progressBarObj.GetComponent <ProgressBarBehaviour>();
         }
     }
 }
Example #16
0
    IEnumerator Timer()
    {
        BarBehaviour = GetComponent <ProgressBarBehaviour>();
        while (true)
        {
            yield return(new WaitForSeconds(UpdateDelay / timer));

            BarBehaviour.Value += 1f;
            timeElapsed        += 1;
            //	print("new value: " + BarBehaviour.Value);
        }
    }
Example #17
0
    private void ResetProgressBar(RectTransform iconPanel)
    {
        ProgressBarBehaviour progressBar = iconPanel.GetComponentInChildren <ProgressBarBehaviour>();

        if (progressBar == null || !progressBar.enabled)
        {
            return;
        }
        progressBar.Value           = 0.0f;
        progressBar.TransitoryValue = 0.0f;
        iconProgressMap[iconPanel]  = 0.0f;
    }
Example #18
0
    private ProgressBarBehaviour makeMPbar()
    {
        GameObject           canvas = GameObject.FindGameObjectWithTag("Canvas");
        Vector2              pos    = WorldToCanvas.toCanvas(canvas, transform.position + new Vector3(0, 3.0f));
        ProgressBarBehaviour pb     = Instantiate(MP, pos, Quaternion.identity);

        pb.ProgressSpeed = 500;
        pb.SetFillerSizeAsPercentage(100.0f);
        pb.transform.SetParent(canvas.transform, false);
        pb.transform.localScale = new Vector3(0.2f, 0.3f);

        return(pb);
    }
Example #19
0
//	void Awake()
//	{
//		BarBehaviour = GetComponent<ProgressBarBehaviour>();
//		BarBehaviour.Value = 100;
//		print("Value from awake:" + BarBehaviour.Value);
//	}
    IEnumerator Start()
    {
        //print("Value from start:" + BarBehaviour.Value);
        BarBehaviour       = GetComponent <ProgressBarBehaviour>();
        BarBehaviour.Value = 100;
        while (true)
        {
            yield return(new WaitForSeconds(UpdateDelay));

            BarBehaviour.Value -= 5;
            print("new value: " + BarBehaviour.Value);
        }
    }
Example #20
0
    // Use this for initialization
    void Start()
    {
        GameObject obj = GameObject.Find("ProgressBarLabelInside");

        barBehaviour = obj.GetComponent <ProgressBarBehaviour>();
        barBehaviour.ProgressSpeed = 10000;



        BookInfo bookInfo = (BookInfo)GlobalVar.shareContext.shareVar["bookInfo"];

        GlobalVar.shareContext.shareVar.Remove("bookInfo");

        if (bookInfo == null)           // for testing
        //assetBundleName = "test_book";
        {
            assetBundleName = "solar_system_book";
        }
        else
        {
            assetBundleName = bookInfo.assetbundle;
        }


        string platform = Application.platform.ToString();

        if (Application.platform == RuntimePlatform.WindowsEditor)// for testing
        {
            platform = "Android";
        }
        try
        {
            assetDataFolder = GlobalVar.DATA_PATH + "/" + assetBundleName;
            if (Directory.Exists(assetDataFolder))
            {
                Directory.Delete(assetDataFolder, true);
            }
        }
        catch (System.Exception ex)
        {
            DebugOnScreen.Log(ex.ToString());
        }

        url = GlobalVar.BASE_ASSET_DOWNLOAD_URL + bookInfo.download_url + "/" + platform + ".zip";
        if (GlobalVar.DEBUG)
        {
            DebugOnScreen.Log("url=" + url);
        }
        www = new WWW(url);
    }
Example #21
0
    private void Start()
    {
        ammoManager = GetComponentInChildren <AmmoManager>();

        totalPlayerEnergy = playerEnergy;

        healthBarBehaviour = healthBar.GetComponent <ProgressBarBehaviour>();
        energyBarBehaviour = energyBar.GetComponent <ProgressBarBehaviour>();

        healthBarBehaviour.maxSize = MAX_HP;
        energyBarBehaviour.maxSize = MAX_ENERGY;

        energyBarBehaviour.IncrementValue(playerEnergy);
        healthBarBehaviour.IncrementValue(playerHealth);
    }
Example #22
0
    void Update()
    {
        BarBehaviour = EnergyUI.GetComponent <ProgressBarBehaviour>();
        TouchControl = GetComponent <SimpleTouchController> ();

        print(TouchControl.touchPresent);
        if (TouchControl.touchPresent == true)
        {
            //yield return new WaitForSeconds (UpdateDelay);
            BarBehaviour.Value += 1;
            //print ("new value: " + BarBehaviour.Value);
        }
        else
        {
            //print ("new value: " + BarBehaviour.Value);
        }
    }
Example #23
0
    //	public GameObject hiveButton;
    //	public Text pollenText;

    void Start()
    {
        if (totalcount == 0)
        {
            totalcount = 10000;
        }
        lastcount    = 0;
        barpercent   = 0;
        BarBehaviour = GetComponent <ProgressBarBehaviour> ();

        //hiveButton = GetComponent<UnityEngine.UI.Button>();

//		while (true) {
//			yield return new WaitForSeconds (UpdateDelay);


//		}
    }
Example #24
0
    IEnumerator Start()
    {
        levelManager = GameObject.FindObjectOfType <LevelManager> ();
        Debug.Log("START Load Async");
        BarBehaviour = GetComponent <ProgressBarBehaviour> ();
        while (BarBehaviour.Value < 100)
        {
            yield return(new WaitForSeconds(UpdateDelay));

            BarBehaviour.Value += Random.value * 100;
            //result.allowSceneActivation = true;
        }
        Debug.Log("YEAH Loaded Async");

        yield return(new WaitForSeconds(0.5f));

        SceneManager.LoadScene("Start");
    }
Example #25
0
    void Start()
    {
        GameObject moveTypePanel       = GameObject.Find("MoveTypePanel");
        GameObject slidersPanel        = GameObject.Find("SlidersPanel");
        GameObject activeBodypartPanel = GameObject.Find("ActiveBodypartPanel");
        GameObject recordFramesPanel   = GameObject.Find("RecordFramesPanel");
        GameObject nameAndSavePanel    = GameObject.Find("NameAndSavePanel");

        phaseProgressBar = GameObject.Find("PhaseProgressBar").GetComponent <ProgressBarBehaviour> ();
        statePanels      = new GameObject[] {
            moveTypePanel,
            activeBodypartPanel,
            recordFramesPanel,
            slidersPanel,
            nameAndSavePanel
        };
        this.returnScript = GameObject.FindObjectOfType <SceneReturnScript> ();
    }
Example #26
0
    // Use this for initialization
    void Start()
    {
        hpProgressBar = GetComponentInChildren <ProgressBarBehaviour>();
        if (hpProgressBar == null)
        {
            return;
        }

        hpProgressBar.Value           = 100.0f;
        hpProgressBar.TransitoryValue = 0.0f;
        hpProgressBar.ProgressSpeed   = 1000;

        foreach (Canvas canvas in GetComponents <Canvas>())
        {
            if (canvas.gameObject.name.Equals("HpCanvas"))
            {
                canvas.enabled = false;
                hpBarCanvas    = canvas;
                break;
            }
        }
    }
Example #27
0
    void Start()
    {
        this.character1 = StaticCharacterHolder.characters [1 - 1];
        this.character2 = StaticCharacterHolder.characters [2 - 1];
        pauseMenu       = GameObject.Find("PauseMenu");
        pauseMenu.SetActive(false);
        timeUntilPressAnyKey  = 1.0f;
        pauseBackgroundToggel = GameObject.Find("PauseBackground").GetComponent <ColorModifier> ();
        pauseBackgroundToggel.SetDefaultColor(new Color32(0, 0, 0, 0));
        pauseBackgroundToggel.SetSelectedColor(new Color32(120, 120, 120, 160));
        healthBars = new ProgressBarBehaviour[StaticCharacterHolder.characters.Count];
        ProgressBarBehaviour character1HealthBar = GameObject.Find("Character1HealthBar").GetComponent <ProgressBarBehaviour> ();

        healthBars [0] = character1HealthBar;
        ProgressBarBehaviour character2HealthBar = GameObject.Find("Character2HealthBar").GetComponent <ProgressBarBehaviour> ();

        character2HealthBar.SetDirection(-1);          //Flip the health bar on the right.
        healthBars[1]   = character2HealthBar;
        winnerText      = GameObject.Find("WinnerText").GetComponent <Text> ();
        pressAnyKeyText = GameObject.Find("PressAnyKeyText").GetComponent <Text> ();
        gameOver        = false;
        paused          = false;
    }
Example #28
0
    IEnumerator Start()
    {
        lastcount    = 0f;
        totalcount   = 0f;
        barpercent   = 0f;
        BarBehaviour = GetComponent <ProgressBarBehaviour>();

        //hiveButton = GetComponent<UnityEngine.UI.Button>();

        while (true)
        {
            yield return(new WaitForSeconds(UpdateDelay));

            int partcount = parts.particleCount;
            if (partcount != lastcount)
            {
                if (partcount > lastcount)
                {
                    totalcount += partcount;
                }
                lastcount = partcount;

                if (barpercent >= 1000)
                {
                    hiveButton.SetActive(true);
                }
            }
            //BarBehaviour.Value = Random.value * 100;
            if (BarBehaviour.Value < 100)
            {
                BarBehaviour.Value = barpercent;
            }
            //				BarBehaviour.SetFillerSizeAsPercentage(barpercent);
            //print("new value: " + BarBehaviour.Value);
        }
    }
Example #29
0
    void Start( )
    {
        rage        = null;
        progressBar = null;
        random      = new System.Random( );
        ResetDifficulty();
        if (rage == null && GameObject.Find("RagePanel"))
        {
            rage        = GameObject.Find("RagePanel").GetComponent <RagePanelController> ( );
            progressBar = GameObject.Find("ProgressBarLabelRight").GetComponent <ProgressBarBehaviour> ( );
            player      = GameObject.Find("Player").GetComponent <PlayerControl> ( );
        }


        //gamejolt API
        if (GameJolt.API.Manager.Instance.CurrentUser != null)
        {
            //user is logged
        }
        else
        {
            //user is not logged
        }
    }
Example #30
0
 // Start is called before the first frame update
 void Start()
 {
     text        = GetComponentInChildren <TextMesh>();
     progressBar = GetComponentInChildren <ProgressBarBehaviour>();
 }