Ejemplo n.º 1
0
 void Awake()
 {
     requestManager = GetComponent<PathRequest_Manager>();
     dungeonManager = GameObject.FindGameObjectWithTag("Dm");
     dm = dungeonManager.GetComponent<Dungeon_Manager>();
     pm = dungeonManager.GetComponent<Pathfinding_Manager>();
 }
Ejemplo n.º 2
0
 private void OnTriggerEnter(Collider other)
 {
     myV = this.gameObject.transform.position;
     if (other.tag == "Hero_Ambient")
     {
         if (!following && !targetLastV.Equals(targetV))
         {
             visible     = true;
             targetLastV = targetV;
             following   = true;
             PathRequest_Manager.RequestPath(transform.position, targetV, OnPathFound);
         }
     }
     else if (other.tag == "Light_Trigger")
     {
         if (!following && !targetLastV.Equals(targetV))
         {
             visible     = true;
             targetLastV = targetV;
             following   = true;
             PathRequest_Manager.RequestPath(transform.position, targetV, OnPathFound);
         }
     }
     else if (other.tag == "PlayerBody")
     {
         hero.PlayerDead();
     }
 }
Ejemplo n.º 3
0
    void FixedUpdate()
    {
        if (visible)
        {
            GetComponent <SpriteRenderer> ().enabled = true;
        }
        else if (!visible)
        {
            GetComponent <SpriteRenderer> ().enabled = false;
        }
        visible = false;

        if (seekTime == 0)
        {
            StartCoroutine(Seek());
        }

        if (seekTime > 3)
        {
            PathRequest_Manager.RequestPath(transform.position, myV, OnPathFound);
        }
    }
Ejemplo n.º 4
0
 void Awake()
 {
     instance    = this;
     pathFinding = GetComponent <Path_Finding> ();
 }
Ejemplo n.º 5
0
 void Awake()
 {
     gridManager    = GetComponent <Grid_Manager> ();
     requestManager = GetComponent <PathRequest_Manager> ();
 }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     GameObject manager = GameObject.FindGameObjectWithTag("Dm");
     prm = GetComponent<PathRequest_Manager>();
     //pm = manager.GetComponent<Pathfinding_Manager>();
     //dm = manager.GetComponent<Dungeon_Manager>();
     pm = GetComponent<Pathfinding_Manager>();
     dm = GetComponent<Dungeon_Manager>();
 }
Ejemplo n.º 7
0
 void Start()
 {
     GameObject manager = GameObject.FindGameObjectWithTag("Dm");
     prm = manager.GetComponent<PathRequest_Manager>();
     pm = manager.GetComponent<Pathfinding_Manager>();
     dm = manager.GetComponent<Dungeon_Manager>();
     HP = 50;
     curHP = HP;
     hBar.rectTransform.sizeDelta = new Vector2(0.5f, hBar.rectTransform.rect.height);
 }
Ejemplo n.º 8
0
 void Awake()
 {
     instance = this;
     pathfinding = GetComponent<PathFinding>();
 }