示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        //  notoriousLevels = GetComponentInParent<PlayerNotoriousLevels>();
        notoriousLevels = FindObjectOfType <PlayerNotoriousLevels>();

        lightTexB = RenderTexture.GetTemporary(lightTexA.width, lightTexA.height, 0, RenderTextureFormat.Default, RenderTextureReadWrite.Linear);

        List <int> indexInC = new List <int>();

        Color[] colors = mask2DTexure.GetPixels();
        int     length = colors.Length;

        //TODO : rewright this function to math
        for (int i = 0; i < length; i++)
        {
            if (colors[i].r > 0.9f)
            {
                indexInC.Add(i);
            }
        }

        indexInCircle = indexInC.ToArray();


        mask2DTexure = new Texture2D(lightTexB.width, lightTexB.height);
        colors       = new Color[lightTexB.width * lightTexB.height];
    }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     pN =
         GetComponent <PlayerNotoriousLevels>();
 }