페이지

2022년 4월 8일 금요일

On ParticleSystem Stretched Billboard Render Mode, Particle not Showing

When ParticleSystem.mainModule.StartSpeed = 0,

Particle are not showing.

Stretched Billboard : Particle stretched in the direction of motion.

this means particle must have speed.





camera scale : Particle stretched in the camera velocity

speed scale: Particle stretched in the speed of particle ( mainModule.startSpeed )

Length scale: Particle stretched in the length scale




2021년 12월 23일 목요일

2021년 11월 15일 월요일

How to set TextureSheetAnimationModule.startFrame constant value by script

if 8x8 texture atlas sheet,

Set Texture Sprite of column index = 3, row index = 1.

 

var ps = flame.textureSheetAnimation;
ps.numTilesX = 8;
ps.numTilesY = 8;
ps.animation = ParticleSystemAnimationType.SingleRow;
ps.startFrame = 1f / flameTextureSheets.numTilesX * 3f;
ps.rowIndex = 1;

2021년 7월 1일 목요일

When custom view autolayout doesn't work correclty

if updateLayout() is called in another methods except layoutSubivews(),

view's autolayout doesn't work appropriately.

i don't know why ...

class MyView:UIView {

    override func layoutSubviews() {

        super.layoutSubviews()

        updateLayout()

    }

    func updateLayout(){

        // setting height, constraints

    }

}

2021년 5월 25일 화요일

Using Generic Type Monobehavior class


public class ExGeneric<T> : MonoBehaviour
{
public T data;

}


This ExGeneric<T> component can't be shown in Unity Inspector.


public class ExGenericFloat : ExGeneric<float>
{

}


This ExGenericFloat component is shown in Inspector.


2021년 4월 23일 금요일

Unity Inspector variable Lifecycle



1. Setting Test = 7



output:

Awake: test = 7



2. Setting Test default value

output

Awake: test = 1



3. 



output

ExInspector: test = 2

ExInspector: test = 2

Awake: test = 1




Conclusion : Setting value order

1. Setting class member default value

2. Setting value in Inspector

3. Setting value in Awake()