public void InitGolem(Player player, float growRate) { this.growRate = growRate; EBoss boss = FindObjectOfType <EBoss>(); if (boss) { if (hpBar == null) { hpBar = Instantiate(hpBarPrefab, uiCanvas).GetComponent <HPBar>(); } hpBar.ShowUp(!boss.IsCurseOn); } this.player = player; if (nav) { nav.enabled = true; } if (mainCollider) { mainCollider.enabled = true; } float mAttRad = Mathf.Lerp(attRad.x, attRad.y, growRate); sqrAttRad = mAttRad * mAttRad; float mScale = Mathf.Lerp(bodyScale.x, bodyScale.y, growRate); transform.localScale = new Vector3(mScale, mScale, mScale); mStompDamage = Mathf.Lerp(stompDamage.x, stompDamage.y, growRate); maxHP = Mathf.Lerp(maxHPRange.x, maxHPRange.y, growRate); curHP = maxHP; jumpSplash = Mathf.Lerp(jumpSplashRange.x, jumpSplashRange.y, growRate); GetComponent <CapsuleCollider>().radius = Mathf.Lerp(colliderSizeRange.x, colliderSizeRange.y, growRate); fist = GetComponentInChildren <MeleeWeapon>(); fist.SetDamage(Mathf.Lerp(attDamage.x, attDamage.y, growRate)); camShaker = Camera.main.GetComponent <CameraShakeSimpleScript>(); camShaker.ShakeCaller(3.5f, 2.0f); StartCoroutine(IE_Enable()); }
public override void Start() { base.Start(); SetupModels(); rIndicator = GetComponentInChildren <RangeIndicator>(); rIndicator.Init(rIndicatorMaxRad.x, Color.red, 360); rIndicator.gameObject.SetActive(false); camShaker = Camera.main.GetComponent <CameraShakeSimpleScript>(); followCamera.transform.Rotate(camRotOffset); camFollowPt = transform.position + camPosOffset; followCamera.transform.position = camFollowPt; sk2Button.Active(false); sk3Button.Active(false); }