示例#1
0
        private JokerArt GetClosestArt()
        {
            float    dist       = Mathf.Infinity;
            JokerArt closestArt = null;

            foreach (JokerArt art in availableArt)
            {
                float tempDist = Vector3.Distance(transform.position, art.transform.position);
                if (tempDist < dist)
                {
                    dist       = tempDist;
                    closestArt = art;
                }
            }
            return(closestArt);
        }
示例#2
0
        private void Clean()
        {
            JokerArt art = GetClosestArt();

            if (art != null)
            {
                if (WaterLevelCk(art.Value))
                {
                    AddWater = -art.Value;
                    availableArt.Remove(art);
                    art.Value = -art.Value;
                    artRemoved++;
                    scoreText.text   = "Score: " + artRemoved.ToString();
                    audioSource.clip = audioWipeFloor;
                    audioSource.Play();
                }
            }
        }