Beauty Salon α-BET (alphabet)

space001
Blender3d Collada dae modeling Use Papervision3d on Progression3 and 4 http://a-bet.secret.jp/#/access
more whaison works.
whaison space
space002
http://whaison.jugem.jp/ https://jp.pinterest.com/whaison/ https://www.instagram.com/whaison/ https://whaison.amebaownd.com/
https://suzuri.jp/whaison
http://whaison.blogspot.com/
http://whaison.tumblr.com/ http://qiita.com/users/whaison http://www.behance.net/whaison https://github.com/whaison/ https://bitbucket.org/whaison http://serato.com/user/whaison http://whaison.hatenablog.jp/

typo memo
http://d.hatena.ne.jp/whaison/


dayNote
http://www.myspace.com/whaison http://ameblo.jp/whaison/ http://blog.crooz.jp/whaison/ http://blog.crooz.jp/whaisoncafe/ http://nenpyo.org/whaison

fulldisk
http://full.shin-gen.jp/
http://whaison.client.jp/
http://www.dclog.jp/whaison/
featured forums.
space004
forum.unity3d.com/

forums.unrealengine.com.

Progression Forum.

FlashDevelop Forum.

Papervision3D Forum.

FlexUserGroup Forum.

SparkProjectForum.





Twitter







Mobile
qrcode
Calendar
SunMonTueWedThuFriSat
  12345
6789101112
13141516171819
20212223242526
27282930   
<< September 2020 >>
New Entries
Archives
Categories
Recent comment
  • FlashDevelopでフォント埋め込み
    感謝!! (12/24)
  • cocos2d-x-3.0rc0 ,c++ ,cpp でTexturePacker で 吐き出した、plist と png でパラパラアニメーションのコード例
    whaison (04/17)
  • Blender2.67にbvh(web上に2500個以上ころがってる)入れてそのBoneオブジェクトをUnity4.0のmecanimで使う
    whaison (08/19)
  • Apple Dev Center 「Certificates, Identifiers & Profiles」で Adhoc をつくってXCode4.6.1でArchiveしてipaを書き出し
    whaison (04/30)
  • Flash CS6でプロパティーパネルで物理演算のジャンプの高さを設定できるCitrus Engine
    whaison (03/01)
  • 「Flash以外、例えばKinectとか」ON TOKYO (会場:高田馬場4-11-8 Floor 6階 ) 短縮URL http://bit.ly/dI0Bfx
    uka (03/02)
  • App Store Review Guidelines アップル社のアプリ審査基準ガイドライン和訳 Apple が 開発者を悩ませ ユーザーをハッピーにしたいガイドライン。w
    whaison (01/25)
  • Unity3d では ADOBE JAPAN OSAKIで行われたFITC 2010 TOKYOでは、 「iOS用にパブリッシュするためには、フリー版ではなくて、有料版を買ってください。さらに追加のパッケージである、"iOS Package (for Development)"を買ってください」とのことだった。
    whaison (01/25)
  • enjoy Adidas-Futsal-Park
    whaison (01/16)
  • MacBookAir にFlashPlayer入れたらなった。Mac Flash Player 10.1/10.2でUstream などでカメラが認識されないバグそんなときはUstreamProducer!でもなくiPhoneだと直ぐにライブ配信できた
    whaison (01/14)
simple sintax high lighter2.0
space003
SyntaxHighlighter2.0用 の貼り付けコード作成する!
ブログパーツ-BLOG PARTS.
Profile
Links
Recommend
Admin
無料ブログ作成サービス JUGEM
Seach this site
            
2016.06.09 Thursday
Unity5.3から使えるようになったParticleSystem.Module 画面表示とYamlにはあったモジュール達

Unity5.3から使えるようになったParticleSystem.Module  画面表示とYamlにはあったモジュール達
Script




---

---

 //Unity5.3から使えるようになった画面表示とYamlにはあったモジュール達
           // InitialModule = GetComponent<ParticleSystem>();//もとからある
            ParticleSystem.ShapeModule m_ShapeModule = GetComponent<ParticleSystem>().shape;
            ParticleSystem.EmissionModule m_EmissionModule = GetComponent<ParticleSystem>().emission;
            ParticleSystem.SizeOverLifetimeModule m_SizeModule = GetComponent<ParticleSystem>().sizeOverLifetime;
            ParticleSystem.SizeBySpeedModule m_SizeBySpeedModule = GetComponent<ParticleSystem>().sizeBySpeed;
            ParticleSystem.RotationOverLifetimeModule RotationOverLifetimeModule = GetComponent<ParticleSystem>().rotationOverLifetime;
            ParticleSystem.RotationBySpeedModule m_RotationBySpeedModule = GetComponent<ParticleSystem>().rotationBySpeed;
            ParticleSystem.ColorOverLifetimeModule m_ColorOverLifetimeModule = GetComponent<ParticleSystem>().colorOverLifetime;
            ParticleSystem.ColorBySpeedModule m_ColorBySpeedModule = GetComponent<ParticleSystem>().colorBySpeed;
            ParticleSystem.TextureSheetAnimationModule m_TextureSheetAnimationModule = GetComponent<ParticleSystem>().textureSheetAnimation;
            ParticleSystem.VelocityOverLifetimeModule m_VelocityOverLifetimeModule = GetComponent<ParticleSystem>().velocityOverLifetime;
            ParticleSystem.InheritVelocityModule m_InheritVelocityModule = GetComponent<ParticleSystem>().inheritVelocity;
            ParticleSystem.ForceOverLifetimeModule m_ForceOverLifetimeModule = GetComponent<ParticleSystem>().forceOverLifetime;
            ParticleSystem.ExternalForcesModule m_ExternalForcesModule = GetComponent<ParticleSystem>().externalForces;
            ParticleSystem.CollisionModule m_CollisionModule = GetComponent<ParticleSystem>().collision;
            ParticleSystem.SubEmittersModule m_SubModule = GetComponent<ParticleSystem>().subEmitters;
            m_SubModule.enabled = false;
            m_EmissionModule .enabled = false;//モジュールごとの表示非表示切り替えもできる!

https://docs.unity3d.com/ScriptReference/ParticleSystem.html


各モジュールのリファレンス。
-ScriptReference Modules
collision Access the particle system collision module.
colorBySpeed Access the particle system color by lifetime module.
colorOverLifetime Access the particle system color over lifetime module.
-
emission Access the particle system emission module.
externalForces Access the particle system external forces module.
forceOverLifetime Access the particle system force over lifetime module.

-
inheritVelocity Access the particle system velocity inheritance module.

-
limitVelocityOverLifetime Access the particle system limit velocity over lifetime module.

-
rotationBySpeed Access the particle system rotation by speed module.
rotationOverLifetime Access the particle system rotation over lifetime module.

-
shape Access the particle system shape module.
-
sizeBySpeed Access the particle system size by speed module.

-
sizeOverLifetime Access the particle system size over lifetime module.

-
subEmitters Access the particle system sub emitters module.
textureSheetAnimation Access the particle system texture sheet animation module.

-
velocityOverLifetime Access the particle system velocity over lifetime module.

-
カーブの使い方はこちら
http://blogs.unity3d.com/2016/04/20/particle-system-modules-faq/
-
-
-

Curve

In this mode, the value of the property will change based on querying a curve. When using curves from the MinMaxCurve in script there are some caveats.
Firstly, if you try to read the curve property when it is in one of the Curve modes, then the you’ll get the following error message: “Reading particle curves from script is unsupported unless they are in constant mode”.
Due to the way the curves are compressed in the engine, it is not possible to get the MinMaxCurve unless it is using one of the 2 constant modes.We know this isn’t great, read on our plans to improve it. The reason for this is that internally, we don’t actually just store an AnimationCurve, but select one of two paths. If the curve is simple (no more than 3 keys with one at each end), then we use an optimized polynomial curve, which provides improved performance. We then fallback to using the standard non-optimized curve if it is more complex. In the Inspector, an unoptimized curve will have a small icon at the bottom right which will offer to optimize the curve for you.

An optimized curve

1

An unoptimized curve

1

While it may not be possible to get the curve from a module in script, it is possible to work around this by storing your own curve and applying this to the module when required, like this:

While it may not be possible to get the curve from a module in script, it is possible to work around this by storing your own curve and applying this to the module when required, like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using UnityEngine;
 
public class MinMaxCurveCurveMode : MonoBehaviour
{
   ParticleSystem myParticleSystem;
   ParticleSystem.EmissionModule emissionModule;
 
   // We can "scale" the curve with this value. It gets multiplied by the curve.
   public float scalar = 1.0f;
 
   AnimationCurve ourCurve;
 
   void Start()
   {
     // Get the system and the emission module.
     myParticleSystem = GetComponent<ParticleSystem>();
     emissionModule = myParticleSystem.emission;
 
     // A simple linear curve.
     ourCurve = new AnimationCurve();
     ourCurve.AddKey(0.0f, 0.0f);
     ourCurve.AddKey(1.0f, 1.0f);
 
     // Apply the curve
     emissionModule.rate = new ParticleSystem.MinMaxCurve(scalar, ourCurve);
 
     // In 5 seconds we will modify the curve.
     Invoke( "ModifyCurve" , 5.0f);
   }
 
   void ModifyCurve()
   {
     // Add a key to the current curve.
     ourCurve.AddKey(0.5f, 0.0f);
 
    // Apply the changed curve
    emissionModule.rate = new ParticleSystem.MinMaxCurve(scalar, ourCurve);
   }
}

Random between 2 curves.

This mode generates random values from in between the min and a max curves, using time to determine where on the x axis to sample. The shaded area represents the potential values. This mode is similar to the curve mode in that it is not possible to access the curves from script and that we also use optimized polynomial curves(when possible). In order to benefit from this, both curves must be optimizable, that is contain no more than 3 keys and have one at each end. Like in curve mode, it is possible to tell if the curves are optimized by examining the bottom right of the editor window.

1

This example is very similar to the curve, however, we now also set the minimum curve as well.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using UnityEngine;
 
public class MinMaxCurveRandom2CurvesMode : MonoBehaviour
{
   ParticleSystem myParticleSystem;
   ParticleSystem.EmissionModule emissionModule;
 
   AnimationCurve ourCurveMin;
   AnimationCurve ourCurveMax;
 
   // We can "scale" the curves with this value. It gets multiplied by the curves.
   public float scalar = 1.0f;
 
   void Start()
   {
     // Get the system and the emission module.
     myParticleSystem = GetComponent<ParticleSystem>();
     emissionModule = myParticleSystem.emission;
 
     // A horizontal straight line at value 1
     ourCurveMin = new AnimationCurve();
     ourCurveMin.AddKey(0.0f, 1.0f);
     ourCurveMin.AddKey(1.0f, 1.0f);
 
     // A horizontal straight line at value 0.5
     ourCurveMax = new AnimationCurve();
     ourCurveMax.AddKey(0.0f, 0.5f);
     ourCurveMax.AddKey(1.0f, 0.5f);
 
     // Apply the curves
     emissionModule.rate = new ParticleSystem.MinMaxCurve(scalar, ourCurveMin, ourCurveMax);
 
     // In 5 seconds we will modify the curve.
     Invoke( "ModifyCurve" , 5.0f);
   }
 
   void ModifyCurve()
   {
     // Create a "pinch" point.
     ourCurveMin.AddKey(0.5f, 0.7f);
     ourCurveMax.AddKey(0.5f, 0.6f);
 
     // Apply the changed curve
     emissionModule.rate = new ParticleSystem.MinMaxCurve(scalar, ourCurveMin, ourCurveMax);
   }
}
-
-
-
-
-
-
-
-
-
--

-
-
-
| whaison | Unity3d | 16:57 | comments(0) | - | pookmark |
Comment




whaisonStudyNoteBook をFaceBookで いいね!





Share |