public override void Start() { base.Start(); lr = GetComponent <LineRenderer>(); _entityData.health = 1000f; _iceCrow = _IceCrowGO.GetComponent <IceCrow>(); _waterCrow = _WaterCrowGO.GetComponent <WaterCrow>(); _punishmentClock = Time.time; _chainOfDestinyClock = Time.time; _iceCrow = Instantiate(_iceCrow, new Vector3(0f, 1f, 0f), Quaternion.identity); _waterCrow = Instantiate(_waterCrow, new Vector3(0f, 1f, 0f), Quaternion.identity); _iceCrow.setWaterCrow(_waterCrow); _waterCrow.setIceCrow(_iceCrow); //_waterCrow.setVulnerability(false); //_iceCrow.setVulnerability(false); _iceCrow.setHalja(this); _waterCrow.setHalja(this); _moveState = new Halja_MoveState(this, _stateMachine, "run", _entityData, this); _idleState = new Halja_IdleState(this, _stateMachine, "idle", _idleData, this); _scareState = new Halja_ScaredState(this, _stateMachine, "scared", _entityData, this); _deathState = new Halja_DeathState(this, _stateMachine, "death", this); _playerDetectState = new Halja_PlayerDetectState(this, _stateMachine, "playerDetect", _entityData, this); _punishment = new Halja_Punishment(this, _stateMachine, "punishment", this); _whipLashes = new Halja_WhipLashes(this, _stateMachine, "whiplashes", this); _spawnCrow = new Halja_SpawnCrow(this, _stateMachine, "spawnCrow", this); //crowSpawn(false); _stateMachine.InitializeState(_idleState); //todo spawn state }
public void crowSpawn() { if (iceCrowDead && waterCrowDead) { _iceClone = Instantiate(_IceCrowGO, new Vector3(0f, 1f, 0f), Quaternion.identity); _waterClone = Instantiate(_WaterCrowGO); _iceCrow = _iceClone.GetComponent <IceCrow>(); _waterCrow = _waterClone.GetComponent <WaterCrow>(); _iceCrow.setHalja(this); _waterCrow.setHalja(this); _waterCrow.setIceCrow(_iceCrow); _iceCrow.setWaterCrow(_waterCrow); _iceCrow.setVulnerability(true); _waterCrow.setVulnerability(false); } else if (iceCrowDead) { _iceClone = Instantiate(_IceCrowGO, new Vector3(0f, 1f, 0f), Quaternion.identity); _iceCrow = _iceClone.GetComponent <IceCrow>(); _waterCrow.setIceCrow(_iceCrow); _iceCrow.setWaterCrow(_waterCrow); _iceCrow.setHalja(this); _iceCrow.setVulnerability(false); } else if (waterCrowDead) { _waterClone = Instantiate(_WaterCrowGO); _waterCrow = _waterClone.GetComponent <WaterCrow>(); _iceCrow.setWaterCrow(_waterCrow); _waterCrow.setIceCrow(_iceCrow); _waterCrow.setHalja(this); _waterCrow.setVulnerability(false); } waterCrowDead = false; iceCrowDead = false; }