Exemplo n.º 1
0
        public IHttpActionResult PutColorTab(int id, ColorTab colorTab)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != colorTab.Id)
            {
                return(BadRequest());
            }

            db.Entry(colorTab).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ColorTabExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 2
0
        public IHttpActionResult GetColorTab(int id)
        {
            ColorTab colorTab = db.ColorTabs.Find(id);

            if (colorTab == null)
            {
                return(NotFound());
            }

            return(Ok(colorTab));
        }
Exemplo n.º 3
0
        public IHttpActionResult PostColorTab(ColorTab colorTab)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ColorTabs.Add(colorTab);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = colorTab.Id }, colorTab));
        }
Exemplo n.º 4
0
        public IHttpActionResult DeleteColorTab(int id)
        {
            ColorTab colorTab = db.ColorTabs.Find(id);

            if (colorTab == null)
            {
                return(NotFound());
            }

            db.ColorTabs.Remove(colorTab);
            db.SaveChanges();

            return(Ok(colorTab));
        }
Exemplo n.º 5
0
    void Start()
    {
        //find player
        _player = GameObject.Find("player").GetComponent <Player>();

        //init active tab
        _activeTab = _tabs[_tabCounter];
        _activeTab.transform.localScale = _upScale;
        _activeTab.Label.gameObject.SetActive(true);

        //find meters
        _r = GameObject.Find("R").GetComponent <ColorMeter>();
        _g = GameObject.Find("G").GetComponent <ColorMeter>();
        _b = GameObject.Find("B").GetComponent <ColorMeter>();
    }
Exemplo n.º 6
0
    //go through the tabs after spinning
    public void UpdateWheel(int _dir)
    {
        //increase index and reset if necessary
        _tabCounter += _dir;
        if (_tabCounter == _tabs.Length)
        {
            _tabCounter = 0;
        }
        else if (_tabCounter == -1)
        {
            _tabCounter = _tabs.Length - 1;
        }

        //change scales
        _activeTab.transform.localScale = _normalScale;
        _activeTab.Label.gameObject.SetActive(false);

        //update active tab
        _activeTab = _tabs[_tabCounter];

        //change scales
        _activeTab.transform.localScale = _upScale;
        _activeTab.Label.gameObject.SetActive(true);
    }