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(); } }
private void Update() { transform.rotation = maincam.transform.rotation; if (shooting) { UDPCNS.getins().dpsend.setgunrot(transform.localEulerAngles); } }
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; } }
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; }
// 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; }
private void Awake() { ins = this; new MPlayerInfo(); }