Ejemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     m_animator             = GetComponent <Animator>();
     fov                    = GetComponent <TitansFieldOfView>();
     tm                     = GetComponent <Titan_Mouvement>();
     hm                     = GetComponent <HealthManagement>();
     roars                  = GetComponents <AudioSource>();
     sphereCollider         = sphereAttack.GetComponent <SphereCollider>();
     sphereCollider.enabled = false;
     attackParticule        = attackEffect.GetComponent <ParticleSystem>();
     //StartCoroutine(UnAggroRoutine());
     InvokeRepeating("UnAggroRoutine2", 2.0f, 5.0f);
 }
Ejemplo n.º 2
0
    private void OnSceneGUI()
    {
        TitansFieldOfView fow = (TitansFieldOfView)target;

        Handles.color = Color.white;
        Handles.DrawWireArc(fow.transform.position, Vector3.up, Vector3.forward, 360, fow.viewRadius);
        Vector3 viewAngleA = fow.DirFromAngle(-fow.viewAngle / 2, false);
        Vector3 viewAngleB = fow.DirFromAngle(fow.viewAngle / 2, false);

        Handles.DrawLine(fow.transform.position, fow.transform.position + viewAngleA * fow.viewRadius);
        Handles.DrawLine(fow.transform.position, fow.transform.position + viewAngleB * fow.viewRadius);

        Handles.color = Color.red;
        foreach (Transform visibleTarget in fow.visibleTargets)
        {
            Handles.DrawLine(fow.transform.position, visibleTarget.position);
        }
    }