Esempio n. 1
0
        /// <summary>
        /// <para>Inicia la animacion de los botones</para>
        /// </summary>
        /// <param name="interac">Interaccion</param>
        /// <returns></returns>
        private IEnumerator AnimacionBtns(Interactivo interac)        // Inicia la animacion de los botones
        {
            // Representamos los botones
            for (int n = 0; n < interac.opciones.Length; n++)
            {
                // Instanciar el boton
                BtnMenuCircular newBtn = Instantiate(btnPrefab) as BtnMenuCircular;

                // Fijar el padre del boton
                newBtn.transform.SetParent(transform, false);

                // Algoritmo de ordenacion circular
                // Crea una circunferencia de un circulo y la divide por el numero opciones
                float theta = (2 * Mathf.PI / interac.opciones.Length) * n;
                float xPos  = Mathf.Sin(theta);
                float yPos  = Mathf.Cos(theta);

                // Asignacion de la posicion del boton
                newBtn.transform.localPosition = new Vector3(xPos, yPos, 0.0f) * 100.0f;

                // Representacion de los datos
                newBtn.circulo.color = interac.opciones[n].color;
                newBtn.icono.sprite  = interac.opciones[n].sprite;
                newBtn.titulo        = interac.opciones[n].titulo;
                newBtn.menu          = this;
                newBtn.AnimacionON();

                yield return(new WaitForSeconds(0.06f));
            }
        }
Esempio n. 2
0
        public void ToogleGraphInitiate(bool value)
        {
            BtnMenuCircular currentGameObject = EventSystem.current.currentSelectedGameObject.GetComponent <BtnMenuCircular>();

            if (value)
            {
                if (totalActiveGraphCounter <= TotalGraphInstanceAllowed)
                {
                    currentGameObject.IntiateReadingTask(GraphPrefab);
                    totalActiveGraphCounter += 1;
                    Debug.Log(totalActiveGraphCounter + "   " + TotalGraphInstanceAllowed);
                }
            }
            else if (currentGameObject.getGraphInstance() != null)
            {
                currentGameObject.DestroyTheGraphInstance();
                applicationManager.StopTaskfromFeeding(currentGameObject.TagName);
                totalActiveGraphCounter -= 1;
                Debug.Log(totalActiveGraphCounter);
            }
        }