New answers tagged

0

When you use LoadImage it resizes the texture for you. It could just as easily be new Texture2D(2,2). Also note that you don’t need to explicitly call compress or apply if you create the texture with the dxt format to begin with: //Use DXT5 for images which may have an alpha channel, or DXT1 for images that do not have one: Texture2D texture = new ...


2

Let's do it the other way ;) When you Instantiate ItemDrop, you can retrieve LifeTimer from the Camera and save it. For instance, right after the instantiate of your prefab, the method Start() of your object ItemDrop will be called by Unity. In this, you could easily get the Camera (via Camera.mainif it's the main camera of your game), and get the LifeTimer ...


Top 50 recent answers are included