private void Start() { peikkoDamage = 0; audioManager = GetComponent <AudioManagerScript>(); animationManager = GetComponent <AnimatorScript>(); music = Camera.main.GetComponent <AudioSource>(); instance = this; peikkoState = PeikkoState.DEFAULT; dodgeCommand = PeikkoState.DEFAULT; peikkoActionCount = 0; Color color = attackButton.color; color.a = 0; attackButton.color = color; attackButton.transform.GetComponent <Button>().interactable = false; }
// Should be called by fight manager when ready. If done in Start(), the order will differ from those of the NetworkBehaviours and //null references can occur public void Init(int areaNumber) { fightManager = FindObjectOfType <FightManager>(); if (fightManager != null) { fightManager.enemySpawnedEvent.AddListener(UpdateUIForEnemy); areaText.text = fightManager.currentArea.areaName; } bossFightManager = FindObjectOfType <BossFightManager>(); if (bossFightManager != null) { bossFightManager.bossSpawnedEvent.AddListener(UpdateUIForEnemy); } playerHealthBar.SetTarget(FindObjectOfType <Player>().GetPlayerPawn().gameObject); playerManaBar.SetTarget(FindObjectOfType <Player>().GetPlayerPawn().gameObject); FindObjectOfType <Player>().GetPlayerPawn().GetComponent <Unit>().dealtDamageEvent.AddListener(ShowDamageNumber); }
// Use this for initialization protected override void Start() { base.Start(); playerPawn = FindObjectOfType <Player>().GetPlayerPawn(); bossFightManager = FindObjectOfType <BossFightManager>(); }
//public GameObject enemyBars; void Awake() { fightManager = FindObjectOfType <FightManager>(); bossFightManager = FindObjectOfType <BossFightManager>(); playerQuests = FindObjectOfType <PlayerQuests>(); }
// Use this for initialization void Start() { am = GameObject.FindGameObjectWithTag ("AudioManager").GetComponent<AudioManager> (); timer = 0; animator = GetComponent<Animator> (); player = GameObject.FindGameObjectWithTag ("Player").GetComponent<PlayerScript> (); playerTrans = player.transform; trapSpawner = GameObject.FindGameObjectsWithTag ("Trap"); bfm = GameObject.Find("Boss").GetComponent<BossFightManager> (); for (int c=0; c< trapSpawner.Length; c++) { //haha get it c++ trapSpawner[c].SetActive(false); } if (isCenterBoss) StartCoroutine ("CenterBoss"); else StartCoroutine ("LRBosses"); }