Beispiel #1
0
    protected virtual void OnCollisionEnter2D(Collision2D collision)
    {
        GameObject gameObj = collision.gameObject;

        PlayerController player = gameObj.GetComponent <PlayerController>();

        if (player != null)
        {
            Messenger.Broadcast(GameEvent.PLAYER_CONTACT, this, player);
            return;
        }

        ScoreArea area = gameObj.GetComponent <ScoreArea>();

        if (area != null)
        {
            Messenger.Broadcast(GameEvent.SCORE_AREA_CONTACT, this, area);
            return;
        }

        Tilemap tilemap = gameObj.GetComponent <Tilemap>();

        if (tilemap != null)
        {
            Messenger.Broadcast(GameEvent.WALL_CONTACT, this, tilemap);
            return;
        }
    }
Beispiel #2
0
        public void EditScore([FromBody] ScoreArea scorePartyModel, double newScore)
        {
            var getParty = Table4Collection.Find(it => it.Id == scorePartyModel.Id).FirstOrDefault();

            scorePartyModel.Score = newScore;
            getParty.Score        = scorePartyModel.Score;
            getParty.StatusEdit   = true;
            // Table4Collection.DeleteOne(it => it.Id == getParty.Id);
            // Table4Collection.InsertOne(getParty);
            Table4Collection.ReplaceOne(it => it.IdArea == getParty.IdArea && it.Id == getParty.Id, getParty);
            //set status Area Edit
            var getDataByArea = Table4Collection.Find(it => it.IdArea == getParty.IdArea).ToList();

            foreach (var data in getDataByArea)
            {
                data.StatusAreaEdit = true;
                Table4Collection.ReplaceOne(it => it.IdArea == data.IdArea && it.Id == data.Id, data);
            }
        }