Ejemplo n.º 1
0
 private void OnTriggerEnter(Collider collider)
 {
     if (collider.gameObject.layer == 9)
     {
         if (collider.gameObject.GetComponent <EnemyCon>())
         {
             collider.gameObject.GetComponent <EnemyCon>().data.damage(5);
         }
         else
         {
             lock (UDPCNS.getins().dpsend)
             {
                 UDPCNS.getins().dpsend.damage = 5;
                 UDPCNS.getins().dpsend.damageIP = collider.gameObject.GetComponent <OtherPlayer>().IP;
                 UDPCNS.getins().SocketSendHurt(collider.gameObject.GetComponent <OtherPlayer>().IP);
             }
         }
     }
     if (target)
     {
         target = null;
     }
     if (collider.gameObject.layer != 8)
     {
         Recycle();
     }
 }
Ejemplo n.º 2
0
 private void Update()
 {
     transform.rotation = maincam.transform.rotation;
     if (shooting)
     {
         UDPCNS.getins().dpsend.setgunrot(transform.localEulerAngles);
     }
 }
Ejemplo n.º 3
0
 private void Update()
 {
     HpBar.fillAmount = Info.hp / Info.HPMAX;
     Hp.text          = (Info.hp).ToString();
     if (reviving)
     {
         //test
         print(2);
         UDPCNS.getins().gameObject.transform.position = new Vector3(-15, 2, -29);
         reviving = false;
     }
 }
Ejemplo n.º 4
0
 void SwitchState(object a, EventArgs aa)
 {
     shooting = !shooting;
     if (shooting)
     {
         shootcircle.SetActive(true);
         InvokeRepeating("SpawnBullet", 0.1f, 0.1f);
     }
     else
     {
         shootcircle.SetActive(false);
         CancelInvoke();
     }
     UDPCNS.getins().dpsend.shooting = shooting;
 }
Ejemplo n.º 5
0
    // Start is always called after any Awake functions.
    void Start()
    {
        // Set up the references.
        jumpBool     = Animator.StringToHash("Jump");
        groundedBool = Animator.StringToHash("Grounded");
        behaviourManager.GetAnim.SetBool(groundedBool, true);

        // Subscribe and register this behaviour as the default behaviour.
        behaviourManager.SubscribeBehaviour(this);
        behaviourManager.RegisterDefaultBehaviour(this.behaviourCode);
        speedSeeker = runSpeed;

        //
        _udpcns = GetComponent <UDPCNS>();
        PlayerInputManager.getins().But0Down += JumpButtonDown;
    }
Ejemplo n.º 6
0
 private void Awake()
 {
     ins = this;
     new MPlayerInfo();
 }