Beispiel #1
0
    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;
        }
    }
Beispiel #2
0
 protected virtual void Awake()
 {
     whereIs       = gameObject.GetComponent <WhereIs>();
     fighterParent = whereIs.GetParent();
     ResetStats();
 }