コード例 #1
0
ファイル: ActiveWeapon.cs プロジェクト: LucasLBrum/OWW
 private void Start()
 {
     anim = GetComponent<Animator>();
     overrides = anim.runtimeAnimatorController as AnimatorOverrideController;
     WeaponRaycast exisitingWeapon = GetComponentInChildren<WeaponRaycast>();
     if (exisitingWeapon)
     {
         Equip(exisitingWeapon);
     }
 }
コード例 #2
0
ファイル: ActiveWeapon.cs プロジェクト: LucasLBrum/OWW
    public void Equip(WeaponRaycast newWeapon)
    {
        weapon = newWeapon;

        weapon.transform.parent = weaponParent.parent;
        weapon.gameObject.transform.localPosition = Vector3.zero;
        weapon.gameObject.transform.localRotation = Quaternion.identity;

        handIK.weight = 1.0f;
        anim.SetLayerWeight(1, 1.0f);
        Invoke(nameof(SetAnimationDelayed), 0.001f);
    }