예제 #1
0
        // *************************** score
        public int CheckDebrisForScore(Debris.Kind targetDebrisKind)
        {
            int matchCount = 0;

            foreach (Transform trans in debrisTrunk)
            {
                if (trans.gameObject.activeSelf == false)
                {
                    break;
                }

                if (trans.gameObject.CompareTag(GameTag.TAG_PLAYER_KID))
                {
                    Debris d = trans.gameObject.GetComponent <Debris>();
                    if (d)
                    {
                        if (d.kind == targetDebrisKind)
                        {
                            matchCount++;
                        }
                    }
                }
            }

            return(matchCount);
        }
예제 #2
0
		private GameObject GetPrefabByDebrisKind(Debris.Kind kind)
		{
			foreach(GameObject go in prefabs)
			{
				Debris debris = go.GetComponent<Debris>();
				if(debris != null)
				{
					if(debris.kind == kind)
					{
						return go;
					}				
				}
			}

			return null;
		}