예제 #1
0
 // Trigger Control
 void OnTriggerStay(Collider coll)
 {
     if (coll.tag == TagList.GroundBlock)
     {
         // Debug.Log("Trigger Stay");
         standState           = STAND_STATE.OnSafe;
         lastTriggerStayTimer = Time.time;
     }
 }
예제 #2
0
    void Start()
    {
        // DamagingEffect = GameObject.FindGameObjectWithTag (TagList.DamagingEffect);
        GameObject deathFire = Resources.Load("PlayerEffect/DamagingFlame") as GameObject;

        DamagingEffect = Instantiate(deathFire, transform.position, Quaternion.identity) as GameObject;
        DamagingEffect.transform.parent = transform;

        standState = STAND_STATE.OnSafe;
        DamagingEffect.SetActive(standState == STAND_STATE.OnDanger);
        playerData = GetComponent <PlayerData> ();
    }
예제 #3
0
    //Continously damaged if the player is stand on Fire
    void FixedUpdate()
    {
        if (Time.time - lastTriggerStayTimer > 0.2f)
        {
            standState = STAND_STATE.OnDanger;
        }
        if (standState == STAND_STATE.OnDanger && !damaging)
        {
            damaging = true;

            StartCoroutine(DangerDamage());
        }
        DamagingEffect.SetActive(standState == STAND_STATE.OnDanger);
    }