void Update() { //Debug.Log(transform.rotation); weapon = GetComponentInChildren <WeaponNew>(); if (Input.GetButton("Attack")) { //SwingNew(); WeaponSwing(); } rotation = transform.rotation.z * 100; if (weapon != null) { //Debug.Log(weapon.damage); } //StartCoroutine(CRT_Swinging()); //Debug.Log(transform.eulerAngles); //from rotation, to rotation, speed //Debug.Log(rotation); // transform.eulerAngles.z = new Vector3(0, 0, 2); // WeaponSwing(); //transform.rotation = Quaternion.Euler(45f, Mathf.Sin(Time.deltaTime * 2f), 0, 0, 0); //transform.rotation = Quaternion.Euler(0, 0, 22f); }
public void SelectWeapon(int id) { DisableAllWeapons(); GetWeaponWithId(id).SetActive(true); holding = GetWeaponWithId(id).GetComponent <WeaponNew>(); current_index = ingMg.GetWeaponIndex(id); }
public void EnableHands() { holding = null; DisableAllWeapons(); current_index = 9999999; NoWeapon.SetActive(true); }
void Start() { hitBox = GetComponent <BoxCollider2D>(); //weapon = FindObjectOfType<WeaponNew>(); weapon = GetComponentInParent <WeaponNew>(); hitboxSpriteTest = GetComponent <SpriteRenderer>(); playerController = FindObjectOfType <PlayerController>(); }
public void SelectWeapon(int id) { DisableAllWeapons(); GameObject selWeapon = GetWeaponWithId(id); if (selWeapon == null) { return; } selWeapon.SetActive(true); holding = selWeapon.GetComponent <WeaponNew>(); current_index = ingMg.GetWeaponIndex(id); }
void Start() { agent = GetComponent <NavMeshAgent>(); goal = GameObject.Find("Player"); playerScript = (WeaponNew)goal.GetComponent(typeof(WeaponNew)); }
// Start is called before the first frame update public void Awake() { Instance = this; }