void Awake() { masterGame = GetComponentInParent<MasterGameScript>(); foreground = transform.Find ("Camera/Foreground"); level = GetComponentInChildren<LevelScript>(); waves = new List<Wave>(); }
void Awake() { masterGame = GetComponentInParent<MasterGameScript>(); foreground = transform.Find ("Camera/Foreground"); playerCamera = GetComponentInChildren<Camera>(); revengeSpawner = GetComponentInChildren<RevengeSpawner>(); level = GetComponentInChildren<LevelScript>(); waves = new List<Wave>(); }
/// <summary> /// Called when the script is called and initializes the settings and loads /// the first scene /// </summary> void Awake() { if (instance == null) { instance = this; } else { Destroy(this); return; } // Tells Unity to not destroy the gameObject on a new scene load. DontDestroyOnLoad(gameObject); /* A new series of user settings */ userSettings = new UserSettings(); /* A new series of game settings */ gameSettings = new GameSettings(); }
///<summary> /// ///</summary> void Start() { masterGameLoop = GameObject.Find(MASTER_OBJECT). GetComponent <MasterGameScript>(); canvas = GameObject.Find(UI_CANVAS).transform; createHunterPanel = canvas.Find(CREATE_HUNTER_PANEL); nameField = createHunterPanel.Find(NAME_FIELD). GetComponent <InputField>(); nameField.onEndEdit.AddListener(delegate { setName(nameField); }); sanityField = createHunterPanel.Find(SANITY_FIELD). GetComponent <InputField>(); sanityField.onEndEdit.AddListener(delegate { setSanity(sanityField); }); meleeAttackCountField = createHunterPanel.Find(MELEE_FIELD). GetComponent <InputField>(); meleeAttackCountField.onEndEdit.AddListener( delegate { setMeleeAttackCount(meleeAttackCountField); }); actionPointCountField = createHunterPanel.Find(ACTION_POINT_FIELD). GetComponent <InputField>(); actionPointCountField.onEndEdit.AddListener( delegate { setActionPointCount(actionPointCountField); }); toughnessField = createHunterPanel.Find(TOUGHNESS_FIELD). GetComponent <InputField>(); toughnessField.onEndEdit.AddListener( delegate { setToughness(toughnessField); }); strengthField = createHunterPanel.Find(STRENGTH_FIELD). GetComponent <InputField>(); strengthField.onEndEdit.AddListener( delegate { setStrength(strengthField); }); movementField = createHunterPanel.Find(MOVEMENT_FIELD). GetComponent <InputField>(); movementField.onEndEdit.AddListener( delegate { setMovement(movementField); }); givenName = ""; givenSanity = GameSettings.BASE_SANITY; givenMeleeAttackCount = GameSettings.BASE_MELEE_ATTACK_COUNT; givenActionPointCount = GameSettings.BASE_ACTION_POINTS; givenToughness = GameSettings.BASE_TOUGHNESS; givenStrength = GameSettings.BASE_STRENGTH; givenMovement = GameSettings.BASE_MOVEMENT; }
public virtual void Start() { this.masterGame = this.gameObject.GetComponentInParent<MasterGameScript>(); this.parentGame = (GameScript) this.gameObject.GetComponentInParent (typeof(GameScript)); this.playerCamera = (Camera) this.parentGame.gameObject.GetComponentInChildren (typeof(Camera)); }