Esempio n. 1
0
        public static Transform[] BronyaAttachHandler(ConfigWeaponAttach config, Transform weaponProtoTrans, IWeaponAttacher bronya, string avatarType)
        {
            Transform[] transformArray = new Transform[2];
            DeleteAttachPointChildren(bronya, "WeaponLeftArmIn", true);
            DeleteAttachPointChildren(bronya, "WeaponLeftArmOut", true);
            transformArray[0] = AttachPartToAttachPoint(bronya, "GunIn", "WeaponLeftArmIn", weaponProtoTrans);
            transformArray[1] = AttachPartToAttachPoint(bronya, "GunOut", "WeaponLeftArmOut", weaponProtoTrans);
            InstantiateChildrenAndAttach(weaponProtoTrans.Find("GunIn"), transformArray[0], true);
            InstantiateChildrenAndAttach(weaponProtoTrans.Find("GunOut"), transformArray[1], true);
            Material[] sharedMaterials = bronya.gameObject.transform.Find("MC_Body").GetComponent <Renderer>().sharedMaterials;
            Material   targetMaterial  = null;

            foreach (Material material2 in sharedMaterials)
            {
                if (material2.shader.name == "miHoYo/Character/Machine")
                {
                    targetMaterial = material2;
                    break;
                }
            }
            if (targetMaterial != null)
            {
                BronyaCopyMcBodyMaterial(targetMaterial, transformArray[0]);
                BronyaCopyMcBodyMaterial(targetMaterial, transformArray[1]);
            }
            int layer = LayerMask.NameToLayer("Weapon");

            SetRendererLayer(transformArray[0], layer);
            SetRendererLayer(transformArray[1], layer);
            MoveAvatarAttachPoint(bronya, "GunIn/GunPointAttach", "GunPoint", weaponProtoTrans);
            bronya.gameObject.GetComponent <Animator>().Rebind();
            return(transformArray);
        }
Esempio n. 2
0
 public static Transform[] HimekoAttachHandler(ConfigWeaponAttach config, Transform weaponProtoTrans, IWeaponAttacher himeko, string avatarType)
 {
     DeleteAttachPointChildren(himeko, "WeaponRightHand", true);
     Transform[] transformArray = new Transform[] { AttachPartToAttachPoint(himeko, "Sword", "WeaponRightHand", weaponProtoTrans) };
     InstantiateChildrenAndAttach(weaponProtoTrans.Find("Sword"), transformArray[0], true);
     return(transformArray);
 }
Esempio n. 3
0
 public static void KianaDetachHandler(ConfigWeaponAttach config, IWeaponAttacher kiana, string avatarType)
 {
     DetachWeaponAttachPoint(kiana, "WeaponLeftHand");
     DetachWeaponAttachPoint(kiana, "WeaponRightHand");
     DeleteAttachPointChildren(kiana, "WeaponLeftHand", true);
     DeleteAttachPointChildren(kiana, "WeaponRightHand", true);
 }
Esempio n. 4
0
 public static Transform[] FukaAttachHandler(ConfigWeaponAttach config, Transform weaponProtoTrans, IWeaponAttacher fuka, string avatarType)
 {
     DeleteAttachPointChildren(fuka, "WeaponTail", true);
     Transform[] transformArray = new Transform[] { AttachPartToAttachPoint(fuka, "Tail", "WeaponTail", weaponProtoTrans) };
     InstantiateChildrenAndAttach(weaponProtoTrans.Find("Tail"), transformArray[0], true);
     return(transformArray);
 }
Esempio n. 5
0
 public static void BronyaDetachHandler(ConfigWeaponAttach config, IWeaponAttacher bronya, string avatarType)
 {
     DetachWeaponAttachPoint(bronya, "WeaponLeftArmIn");
     DetachWeaponAttachPoint(bronya, "WeaponLeftArmOut");
     DeleteAttachPointChildren(bronya, "WeaponLeftArmIn", true);
     DeleteAttachPointChildren(bronya, "WeaponLeftArmOut", true);
 }
Esempio n. 6
0
 public static Transform[] KianaAttachHandler(ConfigWeaponAttach config, Transform weaponProtoTrans, IWeaponAttacher kiana, string avatarType)
 {
     DeleteAttachPointChildren(kiana, "WeaponLeftHand", true);
     DeleteAttachPointChildren(kiana, "WeaponRightHand", true);
     Transform[] transformArray = new Transform[] { AttachPartToAttachPoint(kiana, "LeftPistol", "WeaponLeftHand", weaponProtoTrans), AttachPartToAttachPoint(kiana, "RightPistol", "WeaponRightHand", weaponProtoTrans) };
     InstantiateChildrenAndAttach(weaponProtoTrans.Find("LeftPistol"), transformArray[0], true);
     InstantiateChildrenAndAttach(weaponProtoTrans.Find("RightPistol"), transformArray[1], true);
     MoveAvatarAttachPoint(kiana, "LeftPistol/LeftGunPoint", "LeftGunPoint", weaponProtoTrans);
     MoveAvatarAttachPoint(kiana, "RightPistol/RightGunPoint", "RightGunPoint", weaponProtoTrans);
     return(transformArray);
 }
Esempio n. 7
0
 public static void MeiDetachHandler(ConfigWeaponAttach config, IWeaponAttacher mei, string avatarType)
 {
     if ((avatarType == "Mei_C1_DH") || (avatarType == "Mei_C3_WS"))
     {
         DetachWeaponAttachPoint(mei, "WeaponRightHand");
         DeleteAttachPointChildren(mei, "WeaponRightHand", true);
     }
     else if ((avatarType == "Mei_C2_CK") || (avatarType == "Mei_C4_LD"))
     {
         DetachWeaponAttachPoint(mei, "WeaponLeftHand");
         DetachWeaponAttachPoint(mei, "WeaponRightHand");
         DeleteAttachPointChildren(mei, "WeaponLeftHand", true);
         DeleteAttachPointChildren(mei, "WeaponRightHand", true);
     }
 }
Esempio n. 8
0
 public static Transform[] MeiAttachHandler(ConfigWeaponAttach config, Transform weaponProtoTrans, IWeaponAttacher mei, string avatarType)
 {
     Transform[] transformArray;
     if ((avatarType == "Mei_C1_DH") || (avatarType == "Mei_C3_WS"))
     {
         DeleteAttachPointChildren(mei, "WeaponRightHand", false);
         transformArray = new Transform[] { AttachPartToAttachPoint(mei, "LongSword", "WeaponRightHand", weaponProtoTrans) };
         InstantiateChildrenAndAttach(weaponProtoTrans.Find("LongSword"), transformArray[0], false);
         return(transformArray);
     }
     if ((avatarType == "Mei_C2_CK") || (avatarType == "Mei_C4_LD"))
     {
         DeleteAttachPointChildren(mei, "WeaponLeftHand", false);
         DeleteAttachPointChildren(mei, "WeaponRightHand", false);
         transformArray = new Transform[] { AttachPartToAttachPoint(mei, "ShortSword", "WeaponLeftHand", weaponProtoTrans), AttachPartToAttachPoint(mei, "ShortSword", "WeaponRightHand", weaponProtoTrans) };
         InstantiateChildrenAndAttach(weaponProtoTrans.Find("ShortSword"), transformArray[0], false);
         InstantiateChildrenAndAttach(weaponProtoTrans.Find("ShortSword"), transformArray[1], false);
         return(transformArray);
     }
     return(new Transform[0]);
 }
Esempio n. 9
0
 public static void HimekoDetachHandler(ConfigWeaponAttach config, IWeaponAttacher himeko, string avatarType)
 {
     DetachWeaponAttachPoint(himeko, "WeaponRightHand");
     DeleteAttachPointChildren(himeko, "WeaponRightHand", true);
 }
Esempio n. 10
0
 public static void FukaDetachHandler(ConfigWeaponAttach config, IWeaponAttacher fuka, string avatarType)
 {
     DetachWeaponAttachPoint(fuka, "WeaponTail");
     DeleteAttachPointChildren(fuka, "WeaponTail", true);
 }