Beispiel #1
0
    /*
     * public bool filter {
     *  get { return img.sprite.texture.filterMode != FilterMode.Point; }
     *  set {
     *      if (value)  img.sprite.texture.filterMode = FilterMode.Trilinear;
     *      else        img.sprite.texture.filterMode = FilterMode.Point;
     *  }
     * }
     */

    // The function that creates a sprite.
    public LuaSpriteController(Image i)
    {
        img             = i.gameObject;
        originalSprite  = i.sprite;
        nativeSizeDelta = new Vector2(100, 100);
        if (img.GetComponent <Projectile>())
        {
            tag = "projectile";
        }
        else if (img.GetComponent <EnemyController>())
        {
            tag = "enemy";
        }
        else if (i.transform.parent != null)
        {
            if (i.transform.parent.GetComponent <EnemyController>())
            {
                tag = "bubble";
            }
            else
            {
                tag = "other";
            }
        }
        shader = new LuaSpriteShader("sprite", img);
    }
Beispiel #2
0
 public LuaSpriteController(SpriteRenderer i)
 {
     img             = i.gameObject;
     originalSprite  = i.sprite;
     nativeSizeDelta = new Vector2(100, 100);
     tag             = "event";
     shader          = new LuaSpriteShader("event", img);
 }
 public void Awake()
 {
     material  = ShaderRegistry.UI_DEFAULT_MATERIAL;
     luashader = new LuaSpriteShader("camera", gameObject);
 }