示例#1
0
    private void DeleteToken(Token.Model serializableEntity)
    {
        var token = scene.tokens.FirstOrDefault(x => x.id == serializableEntity.id);

        if (token == null)
        {
            return;
        }

        scene.tokens.Remove(token);
        scene.selectedTokens.Remove(token);
        Destroy(token.gameObject);
    }
示例#2
0
    private void ChangeToken(Token.Model serializableEntity)
    {
        var token = scene.tokens.FirstOrDefault(x => x.id == serializableEntity.id);

        if (token == null)
        {
            token = Instantiate(scene.tokenPrefab, scene.tokensParent).GetComponent <Token>();
            scene.tokens.Add(token);
        }

        token.Deserialize(serializableEntity);

        foreach (var t in scene.tokens.Where(x => x.sharedVision))
        {
            t.dirty = true;
        }
    }