public void TrackFighter(Fighter fighter, WhereIs whereIs, bool interactive = false) { buildUI.SetActive(false); fighterUI.SetActive(true); fighterUIInteractive.SetActive(interactive); fighterUIStatic.SetActive(!interactive); activeFighter = fighter; SetHP(activeFighter.GetHealth()); SetCD(activeFighter.GetCooldown()); SetTargetingMode(activeFighter.GetTargetingMode()); fighterParent = whereIs.GetParent(); fighterName.text = fighter.GetName(); if (whereIs.GetCameraMount() != null) { FPSCamera.transform.SetParent(whereIs.GetCameraMount()); FPSCamera.transform.localPosition = Vector3.zero; FPSCamera.transform.localRotation = Quaternion.identity; } if (fighterParent != null) { surroundParent.SetParent(fighterParent); surroundParent.localPosition = Vector3.zero; surroundParent.rotation = Quaternion.identity; surroundActive = true; } }
protected virtual void Awake() { whereIs = gameObject.GetComponent <WhereIs>(); fighterParent = whereIs.GetParent(); ResetStats(); }