void OnTriggerEnter(Collider other) { switch (other.tag) { case "PPC": ppc popcorn = other.GetComponent <ppc>(); if (null != popcorn) { Debug.Log("Catch! ppcNum = " + popcorn.playerNum + " playerNum=" + playerNum); if (popcorn.playerNum == playerNum) { FindObjectOfType <AudioManager>().Play("CoinCollect"); GameSystem.getInstance().setScore(popcorn.TakePopcorn()); } } Destroy(other.gameObject); break; case "PROPS": props tmpProp = other.GetComponent <props> (); if (null != tmpProp) { FindObjectOfType <AudioManager>().Play("CoinCollect"); tmpProp.TakePopcorn(); } Destroy(other.gameObject); break; } }
public static T CustomProperty <T>(RoomInfo a, props p, T def = default(T)) { var key = p.ToString(); if (!a.customProperties.ContainsKey(key)) { return(def); } return((T)a.customProperties[key]); }
=> dict(map(props(o), p => (p.Name, p.GetValue(o))));
new PfsBuilder(props, Console.WriteLine).WriteImage(outFile);