示例#1
0
    public static void PlaySound(GameObject go, AudioClip clip = null)    //xxx
    {
        AudioSource source = QUnity.GetOrAddComponent <AudioSource> (go);

        if (clip != null)
        {
            source.clip = clip;
        }
        source.Play();
    }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        startTransform = new QTransform(this.gameObject);

        distanceText = QUnity.FindGameObject("distance").GetComponent <TMP_Text> ();
        angleText    = QUnity.FindGameObject("angle").GetComponent <TMP_Text> ();
        stateText    = QUnity.FindGameObject("state").GetComponent <TMP_Text> ();

        Reset();
    }