Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        remember = Camera.main.GetComponent<PickupRemember>();

        if (remember == null)
            throw new MissingComponentException("PickupRemember component not found in main camera");
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        Goal goal = (Goal)gameObject.AddComponent(typeof(Goal));

        if (goal == null)
            throw new MissingComponentException("Goal component not found");

        goal.timeInterval = timeInterval;
        goal.jumpsToWin = jumpsToWin;

        remember = (PickupRemember)gameObject.AddComponent(typeof(PickupRemember));

        if (remember == null)
            throw new MissingComponentException("PickupRemember component not found");

        remember.Item = null;
    }