示例#1
0
文件: Creatrue.cs 项目: kspine/mmorpg
    public virtual void fight(short action, Creature attack, Creature target)
    {
        //	GameDebug.Log("fight:"+ID);

        GameObject bulletObj = ResMgr.getSingleton().getBullet();

        bulletObj.transform.position = this.transform.position;
        bullet b = bulletObj.GetComponent <bullet>();

        b.Init(attack, target, (int)action);
    }
示例#2
0
文件: TankShooter.cs 项目: Mostrp/P.T
 // Update is called once per frame
 void Update()
 {
     if (m_fShootCurCoolDown > 0)
     {
         m_fShootCurCoolDown -= Time.deltaTime;
     }
     if (m_fShootCurCoolDown <= 0 && Input.GetMouseButton(0))
     {
         Vector3    dir  = Target.position - Port.position;
         GameObject go   = GameObject.Instantiate(BulletPfb);
         bullet     bull = go.GetComponent <bullet>();
         bull.transform.position = Port.position;
         bull.Init(dir);
         m_fShootCurCoolDown = ShootCoolDown;
     }
 }