Пример #1
0
    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);
    }
Пример #2
0
 public void SelectWeapon(int id)
 {
     DisableAllWeapons();
     GetWeaponWithId(id).SetActive(true);
     holding       = GetWeaponWithId(id).GetComponent <WeaponNew>();
     current_index = ingMg.GetWeaponIndex(id);
 }
Пример #3
0
 public void EnableHands()
 {
     holding = null;
     DisableAllWeapons();
     current_index = 9999999;
     NoWeapon.SetActive(true);
 }
Пример #4
0
 void Start()
 {
     hitBox = GetComponent <BoxCollider2D>();
     //weapon = FindObjectOfType<WeaponNew>();
     weapon           = GetComponentInParent <WeaponNew>();
     hitboxSpriteTest = GetComponent <SpriteRenderer>();
     playerController = FindObjectOfType <PlayerController>();
 }
Пример #5
0
        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);
        }
Пример #6
0
 void Start()
 {
     agent        = GetComponent <NavMeshAgent>();
     goal         = GameObject.Find("Player");
     playerScript = (WeaponNew)goal.GetComponent(typeof(WeaponNew));
 }
Пример #7
0
 // Start is called before the first frame update
 public void Awake()
 {
     Instance = this;
 }