// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D>(); player = GameObject.FindGameObjectWithTag("Player"); monstersight = gameObject.GetComponent <MonsterSight>(); spawnCounter = 0; }
private void Awake() { mover = GetComponent <MonsterMovement>(); sight = GetComponent <MonsterSight>(); attacker = GetComponent <MonsterAttack>(); maxHealth = health; healthBar = transform.GetChild(0).gameObject; healthBarValue = healthBar.transform.GetChild(0).gameObject; healthBar.SetActive(false); }
// Use this for initialization void Start() { // Find the player and playercontroller player = GameObject.FindGameObjectWithTag(Tags.playerTag); playerController = player.GetComponent <PlayerController>(); animator = GetComponentInChildren <Animator>(); characterController = GetComponent <CharacterController>(); // Assign the reference to the controls and game data manager gameController = GameObject.FindGameObjectWithTag(Tags.gameControllerTag).GetComponent <GameController>(); // Assign the script component references monsterSight = GetComponent <MonsterSight>(); monsterHealth = GetComponent <MonsterHealth>(); monsterMovement = GetComponent <MonsterMovement>(); }
private void RandomSpawnMonster2(GameTile tile, int group) { Monster monster = monsterFactory.Get(); monster.SpawnOn(tile); monster.MonsterID = ++Monster.TotalMonster; monster.Group = group; monsterManager.Add(monster); monster.OnDestroyNotify.Attach(o => { monsterManager.Remove((Monster)o); }); MonsterSight sight = new MonsterSight(monster, this); monster.EnterBattleMode(sight); }
// Use this for initialization void Awake() { rigid = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); sight = gameObject.AddComponent <MonsterSight>(); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); monstersight = gameObject.GetComponent <MonsterSight>(); }