Ejemplo n.º 1
0
 public override void OnInspectorGUI()
 {
     base.OnInspectorGUI();
     if (GUILayout.Button("Test"))
     {
         CombatText.Show("Test");
     }
 }
Ejemplo n.º 2
0
    public void Show(Sprite img, Vector3 pos, Vector3 motion, float duration)
    {
        CombatText cmb = GetCombatText();


        //swap
        cmb.txt.gameObject.SetActive(false);
        cmb.lootImg.gameObject.SetActive(true);
        cmb.lootImg.sprite = img;

        cmb.go.transform.position = pos;
        cmb.motion = motion;

        cmb.duration = duration;
        cmb.Show();
    }
Ejemplo n.º 3
0
    public void Show(string text, int fontsize, Color color, Vector3 pos, Vector3 motion, float duration)
    {
        CombatText cmb = GetCombatText();

        cmb.txt.text     = text;
        cmb.txt.fontSize = fontsize;
        cmb.txt.color    = color;
        //swap
        cmb.txt.gameObject.SetActive(true);
        cmb.lootImg.gameObject.SetActive(false);


        cmb.go.transform.position = pos;
        cmb.motion = motion;

        cmb.duration = duration;
        cmb.Show();
        Debug.Log("Show projective");
    }
Ejemplo n.º 4
0
    private void Update()
    {
        if (!_searchingAnchor)
        {
            return;
        }

        Session.GetTrackables(_planes);
        TrackableHit hit;

        if (Frame.Raycast(Screen.width * .5f, Screen.height * .5f, RaycastFilter, out hit))
        {
            var delta = FirstPersonCamera.transform.position - hit.Pose.position;
            var dot   = Vector3.Dot(delta, hit.Pose.rotation * Vector3.up);
            if (hit.Trackable is DetectedPlane && dot > 0)
            {
                var newAnchor = hit.Trackable.CreateAnchor(hit.Pose);

                if (Anchor != null)
                {
                    for (var i = 0; i < Anchor.transform.childCount; i++)
                    {
                        var child = Anchor.transform.GetChild(i);
                        child.SetParent(newAnchor.transform, false);
                    }
                    Destroy(Anchor.gameObject);
                }

                Anchor = newAnchor;

                if (AnchorFound != null)
                {
                    AnchorFound.Invoke(Anchor, hit);
                }
                _searchingAnchor = false;
                CombatText.Show("Anchor Found.");
            }
        }
    }
    public void Show(float damage, DamageIdicator indicator)
    {
        // Getting slot
        CombatText cmb = GetCombatText();

        // Assinging incoming damage, and rounding to 0.00 format
        cmb.Txt.text = damage.ToString("0.00");

        // Test code // Will be deleted in the future // TODO

        switch (indicator)
        {
        case DamageIdicator.Raw:
            cmb.GO.transform.position = combatTextContainer.transform.position + textRawOffset;
            cmb.Txt.color             = Color.white;
            cmb.Motion = rawMotion;
            break;

        case DamageIdicator.Ability:
            cmb.GO.transform.position = combatTextContainer.transform.position + textAbilityOffset;
            cmb.Txt.color             = Color.magenta;
            cmb.Motion = abilityMotion;
            break;

        case DamageIdicator.Crit:
            cmb.GO.transform.position = combatTextContainer.transform.position + textCritOffset;
            cmb.Txt.color             = Color.red;
            cmb.Motion = critMotion;
            break;

        default:
            throw new ArgumentOutOfRangeException();
        }

        cmb.Show();
    }
Ejemplo n.º 6
0
 public void FindNewAnchor()
 {
     _searchingAnchor = true;
     CombatText.Show("Looking For Anchor...");
 }