Exemplo n.º 1
0
    void Update()
    {
        if (cMisc.rPC == null)
        {
            Debug.Log("No player");
            return;
        }
        if (Time.time - mGunD.mLastFireTmStmp > mGunD._fireInterval)
        {
            Debug.Log("Shoot grenade");
            PJ_EN_PGrenade p = Instantiate(PF_Grenade, transform.position, transform.rotation);
            p.GetComponent <PJ_Base>().FShootAt(cMisc.rPC.transform.position, transform.position, gameObject);
            p.mGrenD.vDest = cMisc.rPC.transform.position;

            mGunD.mLastFireTmStmp = Time.time;
        }
        cMisc.FUpdateUI();
    }
Exemplo n.º 2
0
 public void FHandleHitObj()
 {
     if (_TYPE == GRENADE_TYPE.PLASMA)
     {
         PJ_EN_PGrenade p = GetComponent <PJ_EN_PGrenade>();
         if (p == null)
         {
             Debug.Log("Grenade is null, maybe wrong type?");
             return;
         }
         p.FEnter_Landed();
     }
     else if (_TYPE == GRENADE_TYPE.FRAG)
     {
         // bounce around a little, but maybe just actually stop or something.
         PJ_PC_FGren p = GetComponent <PJ_PC_FGren>();
         if (p == null)
         {
             Debug.Log("Grenade null, maybe wrong type?");
             return;
         }
         p.FEnter_Landed();
     }
 }