Ejemplo n.º 1
0
 void Start()
 {
     pg = GetComponent<LPParticleGroup>();
     nowcol = pg._Color;
     destcol = new Color(Random.Range(0f,1f),Random.Range(0f,1f),Random.Range(0f,1f),Random.Range(0.2f,1f));
     StartCoroutine("changecol");
 }
Ejemplo n.º 2
0
 void Start()
 {
     pg      = GetComponent <LPParticleGroup>();
     nowcol  = pg._Color;
     destcol = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0.2f, 1f));
     StartCoroutine("changecol");
 }
Ejemplo n.º 3
0
 protected override void Start2()
 {
     if(pg == null)pg = GetComponent<LPParticleGroup>();
     #if UNITY_EDITOR
     if(GameObject.FindObjectOfType<LPParticleSystem>() == null)
     {
         Debug.LogError("There is no ParticleSystem. You must have one in your scene particles in Liquid Physics 2D to work");
         return;
     }
     #endif
 }
Ejemplo n.º 4
0
 protected override void Start2()
 {
     if (pg == null)
     {
         pg = GetComponent <LPParticleGroup>();
     }
             #if UNITY_EDITOR
     if (GameObject.FindObjectOfType <LPParticleSystem>() == null)
     {
         Debug.LogError("There is no ParticleSystem. You must have one in your scene particles in Liquid Physics 2D to work");
         return;
     }
             #endif
 }
Ejemplo n.º 5
0
    private void SetPositionToGroupCenteroid()
    {
        // Set the position to the particle group center
        LPParticleGroup group  = GetComponent <LPParticleGroup>();
        Vector2         center = group.GetCenter();

        if (!(float.IsNaN(center.x)) && !(float.IsNaN(center.y)))
        {
            transform.position = new Vector3(center.x, center.y, startZ);
        }
        else
        {
            transform.position = new Vector3(-1000, -1000, -1000);
        }
    }
Ejemplo n.º 6
0
    public LPParticleGroup[] GetGroupDataFromPlugin()
    {
        int groupCount = LPAPIParticleSystems.GetParticleGroupCount(PartSysPtr);

        Groups = new LPParticleGroup[groupCount];
        if (groupCount > 0)
        {
            IntPtr groupsPointer = LPAPIParticleSystems.GetParticleGroupPointers(PartSysPtr);

            IntPtr[] groupThingPtrs = new IntPtr[groupCount];
            Marshal.Copy(groupsPointer, groupThingPtrs, 0, groupCount);

            for (int i = 0; i < groupCount; i++)
            {
                Groups[i] = new LPParticleGroup();
                Groups[i].SetThingPtr(groupThingPtrs[i]);
                //Debug.Log("Group " + i + " has " + Groups[i].GetParticleCount());
            }
        }

        return(Groups);
    }
Ejemplo n.º 7
0
 void Start()
 {
     group = GetComponent <LPParticleGroup>();
     sys   = FindObjectOfType <LPManager>().ParticleSystems[group.ParticleSystemImIn];
     StartCoroutine("Melt");
 }
Ejemplo n.º 8
0
 void Start()
 {
     group = GetComponent<LPParticleGroup>();
     sys = FindObjectOfType<LPManager>().ParticleSystems[group.ParticleSystemImIn];
     StartCoroutine("Melt");
 }