// Use this for initialization void Start() { remember = Camera.main.GetComponent<PickupRemember>(); if (remember == null) throw new MissingComponentException("PickupRemember component not found in main camera"); }
// 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; }