Esempio n. 1
0
 void OnCollisionEnter(Collision co)
 {
     collisionCount++;
     if (collisionCount > 1 && !CatPreferences.IsStarving())
     {
         catControl.MoveTo(transform.position);
         CatPreferences.addBallPlayingNum();
         collisionCount = 0;
     }
     yPosition = co.transform.position.y;
 }
Esempio n. 2
0
    bool HitTestWithResultType(ARPoint point, ARHitTestResultType resultTypes)
    {
        List <ARHitTestResult> hitResults = UnityARSessionNativeInterface.GetARSessionNativeInterface().HitTest(point, resultTypes);

        if (hitResults.Count > 0)
        {
            foreach (var hitResult in hitResults)
            {
                hitTransform.position = UnityARMatrixOps.GetPosition(hitResult.worldTransform);
                hitTransform.rotation = UnityARMatrixOps.GetRotation(hitResult.worldTransform);
                catControl.MoveTo(hitTransform.position, -0.15f);
                Show();
                return(true);
            }
        }
        return(false);
    }