Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Counting Fluid & Android Export
#1
Hi All,

I bought this asset a few days ago and everything was going well until I tried to count particles Sonrisa

I know this page: http://obi.virtualmethodstudio.com/tutor...sions.html and spent time there but I couldn't manage to "count" particles. It would be amazing if someone give hand about that.

I have my box collider and script on my Solver object. There is a counter in the script, but it counts as soon as 1 collision happens BETWEEN the fluid particles (not the collider) and it never stops increasing.

Here is my code;

Code:
using Obi;
using System.Collections.Generic;
using UnityEngine;

[RequireComponent(typeof(ObiSolver))]

public class Fill : MonoBehaviour
{
   ObiSolver solver;
   public int counter = 0;
   public Collider2D targetCollider = null;

   ObiSolver.ObiCollisionEventArgs collisionEvent;

   void Awake()
   {
       solver = GetComponent<ObiSolver>();

   }

   void OnEnable()
   {
       solver.OnCollision += Solver_OnCollision;
   }

   void OnDisable()
   {
       solver.OnCollision -= Solver_OnCollision;
   }

   void Solver_OnCollision(object sender, ObiSolver.ObiCollisionEventArgs e)
   {
       foreach (Oni.Contact contact in e.contacts)
       {
           // this one is an actual collision:
           if (contact.distance < 0.01)
           {
               Component collider;
               if (ObiCollider.idToCollider.TryGetValue(contact.other, out collider))
               {
                   counter++;
               }
           }
       }
   }
}


Second thing is, I only see pink screen when I export my game to the Android. I found a similar issue on the forum, did the suggestion (It was something like changing current shader to simple shader) and it didn't work.

Thanks in advance.
Reply


Messages In This Thread
Counting Fluid & Android Export - by Tuna.Y - 15-11-2018, 06:39 PM
RE: Counting Fluid & Android Export - by Tuna.Y - 15-11-2018, 08:12 PM
RE: Counting Fluid & Android Export - by Tuna.Y - 15-11-2018, 08:43 PM
RE: Counting Fluid & Android Export - by Tuna.Y - 16-11-2018, 06:24 AM
RE: Counting Fluid & Android Export - by Tuna.Y - 16-11-2018, 09:15 AM
RE: Counting Fluid & Android Export - by Tuna.Y - 16-11-2018, 12:57 PM
RE: Counting Fluid & Android Export - by Tuna.Y - 16-11-2018, 01:58 PM