Beispiel #1
0
 private void Depointed(BattleWarrior warrior)
 {
     if (warrior)
     {
         warrior.GetComponent <WarriorSelector> ().DeHighlight();
     }
 }
Beispiel #2
0
    private void Update()
    {
        if (interractionEnable)
        {
            Vector3    aimPoint = transform.position + transform.forward * 1.5f;
            NavMeshHit hit;
            NavMesh.SamplePosition(aimPoint, out hit, 2, NavMesh.AllAreas);

            BattleWarrior w = GameController.Instance.Warrior;
            if (w && w.GetComponent <NavMeshAgent>().destination == hit.position && Vector3.Distance(hit.position, w.transform.position) <= w.GetComponent <NavMeshAgent>().stoppingDistance)
            {
                Talk();
            }
        }
    }
Beispiel #3
0
    private void Pointed(BattleWarrior warrior)
    {
        if (warrior)
        {
            Color color = Color.white;
            switch (warrior.type)
            {
            case BattleWarrior.WarriorType.Default:
                color = Color.white;
                break;

            case BattleWarrior.WarriorType.Player:
                color = Color.green;
                break;

            case BattleWarrior.WarriorType.Enemy:
                color = Color.red;
                break;
            }

            warrior.GetComponent <WarriorSelector> ().Highlight(color);
        }
    }
    private void SelectWarrior(BattleWarrior warrior)
    {
        if (this.warrior)
        {
            RemoveRaycasters();
            foreach (PlayerFollower pf in FindObjectsOfType <PlayerFollower>())
            {
                Destroy(pf);
            }
        }

        if (warrior)
        {
            this.warrior = warrior.GetComponent <FakeController> ();
        }
        else
        {
            this.warrior = null;
        }


        if (this.warrior)
        {
            AddRaycasters();
            int i = 0;

            foreach (BattleWarrior bw in FindObjectsOfType <BattleWarrior>())
            {
                if (bw != this.warrior.GetComponent <BattleWarrior>() && bw.type == BattleWarrior.WarriorType.Player)
                {
                    bw.gameObject.AddComponent <PlayerFollower> ().Init(i, FindObjectsOfType <BattleWarrior>().Length, formationType, formationScale);
                    i++;
                }
            }
        }
    }