private void imgAmpolleta_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
        {
            Image img = sender as Image;

            if (img.Name == "imgOjos")
            {
                if (oso)
                {
                    gano();
                }
                else
                {
                    Ojos.Begin();
                    ojos = true;
                }
            }
            else if (img.Name == "imgOso")
            {
                if (ojos)
                {
                    gano();
                }
                else
                {
                    Oso.Begin();
                    oso = true;
                }
            }
            else
            {
            }
        }
Beispiel #2
0
        public ActionResult Post(bool IsNew, OjosModel varOjos)
        {
            try
            {
                //if (ModelState.IsValid)
                //{
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _IOjosApiConsumer.SetAuthHeader(_tokenManager.Token);



                var result   = "";
                var OjosInfo = new Ojos
                {
                    Clave         = varOjos.Clave
                    , Descripcion = varOjos.Descripcion
                };

                result = !IsNew?
                         _IOjosApiConsumer.Update(OjosInfo, null, null).Resource.ToString() :
                             _IOjosApiConsumer.Insert(OjosInfo, null, null).Resource.ToString();

                Session["KeyValueInserted"] = result;
                return(Json(result, JsonRequestBehavior.AllowGet));
                //}
                //return Json(false, JsonRequestBehavior.AllowGet);
            }
            catch (ServiceException ex)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
Beispiel #3
0
 public void Init()
 {
     npc          = GetComponentInParent <NPC>();
     col2D        = npc.col2D;
     m_ciudad     = npc.ciudad;
     m_pathfinder = npc.pathfinder;
     pies         = npc.pies;
     ojos         = npc.ojos;
 }
Beispiel #4
0
 void Awake()
 {
     ciudad         = GetComponentInParent <Ciudad>();
     spriteRenderer = GetComponent <SpriteRenderer>();
     movimiento     = InstantiateComponent(movimientoPrefab).GetComponent <Movimiento>();
     pies           = InstantiateComponent(piesPrefab).GetComponent <Pies>();
     ojos           = InstantiateComponent(ojosPrefab).GetComponent <Ojos>();
     pathfinder     = GetComponentInChildren <PathfinderNPC>();
     animador       = GetComponentInChildren <AnimadorNPC>();
     col2D          = GetComponent <BoxCollider2D>();
     pies.Init();
     pathfinder.Init();
     movimiento.Init();
     ojos.Init();
     animador.Init();
     ciudad.NPCs.Add(pathfinder);
 }
    public override void OnInspectorGUI()
    {
        //base.OnInspectorGUI();

        Ojos ojos = (Ojos)target;

        ojos.tamañoOjos = EditorGUILayout.Slider("Tamaño", ojos.tamañoOjos, .1f, 2f);

        ojos.transform.localScale = Vector3.one * ojos.tamañoOjos;

        if (GUILayout.Button("Color aleatorio"))
        {
            ojos.ColorAleatorio();
            Debug.Log("Color cambiado con exito");
        }

        if (GUILayout.Button("Reiniciar color"))
        {
            ojos.ReiniciarColor();
            Debug.Log("Color reiniciado con exito");
        }
    }
Beispiel #6
0
        public ActionResult Delete(int id)
        {
            try
            {
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _IOjosApiConsumer.SetAuthHeader(_tokenManager.Token);

                Ojos varOjos = null;
                if (id.ToString() != "0")
                {
                    string where = "";
                }
                var result = _IOjosApiConsumer.Delete(id, null, null).Resource;
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (ServiceException ex)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
        void timer_Tick(object sender, EventArgs e)
        {
            switch (contador)
            {
            case 0:
                recurso.reporducirSonido("/Sonidos/Voces/TocaComienzaO.mp3");
                break;

            case 1:
                break;

            case 2:
                break;

            case 3:
                recurso.reporducirSonido("/Sonidos/Voces/Extintor.mp3");
                break;

            case 4:
                Extintor.Begin();
                break;

            case 5:
                recurso.reporducirSonido("/Sonidos/Voces/Oso.mp3");
                break;

            case 6:
                Oso.Begin();
                break;

            case 7:
                recurso.reporducirSonido("/Sonidos/Voces/Pollo.mp3");
                break;

            case 8:
                Pollito.Begin();
                break;

            case 9:
                recurso.reporducirSonido("/Sonidos/Voces/Ampolleta.mp3");
                break;

            case 10:
                Ampolleta.Begin();
                break;

            case 11:
                recurso.reporducirSonido("/Sonidos/Voces/Ojos.mp3");
                break;

            case 12:
                Ojos.Begin();
                break;

            case 13:
                timer.Stop();
                desbloquearBotones();
                break;
            }
            contador++;
        }