Beispiel #1
0
 public Response <Item_ColorModel> UpdateItem_Color(Item_ColorModel Item_ColorModel)
 {
     try
     {
         using (var unitOfWorkStore = new UnitOfWorkStore(dbFactory))
         {
             var        rpItem_Color     = unitOfWorkStore.GetRepository <Item_Color>();
             Item_Color Item_ColorEntity = rpItem_Color.GetById(Item_ColorModel.Item_Color_ID);
             Item_ColorEntity.Name = Item_ColorModel.Name;
             rpItem_Color.Update(Item_ColorEntity);
             if (unitOfWorkStore.Save() >= 1)
             {
                 Item_ColorModel.Name = Item_ColorEntity.Name;
                 return(new Response <Item_ColorModel>((int)StatusResponses.Success, MessageResConst.Success, Item_ColorModel));
             }
             else
             {
                 return(new Response <Item_ColorModel>((int)StatusResponses.ErrorSystem, MessageResConst.ErrorCommonRequestParam, Item_ColorModel));
             }
         }
     }
     catch (Exception ex)
     {
         return(new Response <Item_ColorModel>((int)StatusResponses.ErrorSystem, ex.Message, null));
     }
 }
Beispiel #2
0
    public void Splash(Vector3 pos, Item_Color _color)
    {
        Vector3 p1 = new Vector3(pos.x + 1.8f, pos.y, pos.z);


        if (_color == color)
        {
            SoundMenager.Play(clip_good);
            Instantiate(scored_good, p1, Quaternion.identity);
            gController.AddScore();
        }
        else
        {
            SoundMenager.Play(clip_bad);
            Instantiate(scored_bad, p1, Quaternion.identity);
            gController.AddFailsScore();
        }



        Instantiate(splash, p1, Quaternion.identity);
        Destroy(gameObject);
    }
Beispiel #3
0
 // Start is called before the first frame update
 void Start()
 {
     c = transform.parent.GetComponent <Cake>().Cake_color;
 }