Author Topic: How to add change alpha possibility?  (Read 1362 times)

PoN

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 111
    • View Profile
How to add change alpha possibility?
« on: October 01, 2014, 09:15:03 PM »
I would like to add possibility to change an alpha of material by slider in UIPanel. I have my own shader for 3d object , i'd like to change slider position of alpha on UIPanel that changes alpha of material on 3d objects. What i should to add in the shader ?
Worked on Doc&DogAge Of Fury 3D. Actually working on WarMach.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to add change alpha possibility?
« Reply #1 on: October 02, 2014, 10:10:21 PM »
Color c = renderer.material.color;
c.a = slider.value;
renderer.material.color = c;