2019

Unity - Procedure texture anti-aliasing shader

A shader for showing progress in sin-wave style.

review

Unity - Extensions

Extensions

1. Get Hierarchy Path of a GameObject in Scene

public static string GetHierarchyPath(this GameObject obj)
{
    string path = "/" + obj.name;
    while (obj.transform.parent != null)
    {
        obj = obj.transform.parent.gameObject;
        path = "/" + obj.name + path;
    }

review

My Blog Reader developed with Unity UIWidgets

My Blog Reader

review

Unity TinyPNG compression

Compress Textures in Unity Editor by using TinyPNG

public class TinyPNGEditor : MonoBehaviour
{
    private const string URL_API = "https://api.tinify.com/shrink";
    
    // your key here
    private const string KEY_API = "xxxxxxx";


    private static UnityWebRequest www;
    private static Action onDone;

review

Unity Loaded texture during RUNTIME has white or black line

review

Unity Loaded texture during RUNTIME has white or black line

It is because of Texture's alpha is not dilated for the gap.
Details could be found HOWTO-alphamaps

So how to fix it:
  • if it's in your Unity project, just enable this texture's AlphaIsTransparency in Texture Importing Setting inspector.
public static void DilateTexture()
{
    if (Selection.activeObject == null)
    {
        if (EditorUtility.DisplayDialog("Error Selection", "Select a texture", "OK"))
        {
            return;
        }

review

Unity - Font Pruner

using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using AssetBundleBrowser.AssetBundlePacker;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;
using Debug = UnityEngine.Debug;

review

Unity - Simple Image Downloader

a simple image downloader, it downloads images via a queue and by UnityWebRequest and Coroutine.

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class ImageDownloader : MonoSingleton<ImageDownloader>
{
    private const int MAX_REQUEST = 10;

    public Action<UnityWebRequest, string> OnError;

review

Huawei悦盒EC6108V9C破解要点记录

引用教程及工具

华为悦盒EC6108V9C安装教程

如何进入rec模式

  • 开机狂按左右
  • 开机狂按待机

华为STB管理工具连接不上

  • 恢复出厂设置
  • 开启远程连接

安装不了系统App

  • 空间不够?

review

Unity - Record Scene sounds

Sometimes we just wanna record sounds from scene, so Unity's MicroPhone API would not be very useful.

But we have OnAudioFilterRead to do this kind of action.

Share a solution which is from
http://evanxmerz.com/blog/index.php/2016/10/07/recording-in-game-audio-in-unity/

This script should be added to a Unity AudioListener GameObject then it could do its works.

HowTo

  • Create a MonoBehaviour script with an OnAudioFilterRead method
    // write the incoming audio to the output string
    void OnAudioFilterRead(float[] data, int channels)
    {
    

review