Exemplo n.º 1
0
    // Late update the damage, receive damage change before this!!!
    void Update()
    {
        coun.CheckCounter();



        if (coun.Count() == 1)
        {
            transform.parent.SendMessage("StopMovement", false);
            if (ans != null)
            {
                ans.SetHurt(false);
            }

            DestroySelf();
        }
    }
Exemplo n.º 2
0
    //int c;


    void Start()
    {
        //nav = transform.parent.GetComponent<NavMeshAgent>();



        ans = transform.parent.parent.GetComponentInChildren <AniSwitcher>();


        if (transform.parent.Find("WindDot(Clone)") != null)
        {
            Transform pos = com.CalShortestDistance(transform.position);
            //Debug.Log(pos.name);

            if (pos.Find("WindSwing(Clone)") != null)
            {
                pos.Find("WindSwing(Clone)").SendMessage("AddFireWind");
            }
        }

        transform.parent.SendMessage("StopMovement", true);

        if (damaged == false)
        {
            if (transform.parent.GetComponent <BasicStat>().abFire) //absorpstion!!!
            {
                transform.parent.SendMessage("HpModifier", damage);
                damaged = true;
            }
            else
            {
                if (ans != null)
                {
                    ans.SetHurt(true);
                }

                transform.parent.SendMessage("HpModifier", -damage);
                damaged = true;
            }
        }


        //c = coun.Count();
    }