示例#1
0
    void Start()
    {
        pcInstance = GameObject.Find ("MapLogic").GetComponent<PrefabChest> ();

        // This implementation was suggested by arrowgamer.
        // It's way more efficient and easy for the eye
        // to just look for the particle effect once
        // and hold an instance of it in a private variable.
        foreach (Transform child in transform)
        {
            if (child.name == "Particle Effect")
            {
                this.particleEffect = child;
                break;
            }
        }
    }
示例#2
0
    void Start()
    {
        pcInstance = GameObject.Find("MapLogic").GetComponent <PrefabChest> ();

        // This implementation was suggested by arrowgamer.
        // It's way more efficient and easy for the eye
        // to just look for the particle effect once
        // and hold an instance of it in a private variable.
        foreach (Transform child in transform)
        {
            if (child.name == "Particle Effect")
            {
                this.particleEffect = child;
                break;
            }
        }
    }