public void SetupSockets(AtavismMobSockets ams) { // Sockets for attaching weapons (and particles) this.mainHand = ams.mainHand; this.mainHand2 = ams.mainHand2; this.offHand = ams.offHand; this.offHand2 = ams.offHand2; this.mainHandRest = ams.mainHandRest; this.mainHandRest2 = ams.mainHandRest2; this.offHandRest = ams.offHandRest; this.offHandRest2 = ams.offHandRest2; this.shield = ams.shield; this.shield2 = ams.shield2; this.shieldRest = ams.shieldRest; this.shieldRest2 = ams.shieldRest2; this.head = ams.head; this.leftShoulderSocket = ams.leftShoulderSocket; this.rightShoulderSocket = ams.rightShoulderSocket; // Sockets for particles this.rootSocket = ams.rootSocket; this.leftFootSocket = ams.leftFootSocket; this.rightFootSocket = ams.rightFootSocket; this.pelvisSocket = ams.pelvisSocket; this.leftHipSocket = ams.leftHipSocket; this.rightHipSocket = ams.rightHipSocket; this.chestSocket = ams.chestSocket; this.backSocket = ams.backSocket; this.neckSocket = ams.neckSocket; this.mouthSocket = ams.mouthSocket; this.leftEyeSocket = ams.leftEyeSocket; this.rightEyeSocket = ams.rightEyeSocket; this.overheadSocket = ams.overheadSocket; SetWeaponsAttachmentSlot(true); }
IEnumerator GetModel(string modelName) { // Profiler.BeginSample("AtavismGetModel.GetModel"); WaitForSeconds delay = new WaitForSeconds(0.5f); while (m_model == null) { if (AtavismAssetBundlesManager.Instance != null) { var model = AtavismAssetBundlesManager.Instance.GetModel(modelName); if (model != null) { // Profiler.BeginSample("AtavismGetModel.GetModel.Instantiate"); m_model = (GameObject)Instantiate(model, transform); m_model.GetComponent <Transform>().localScale = ScaleForModel; m_model.GetComponent <Transform>().localPosition = Vector3.zero; m_model.GetComponent <Transform>().localRotation = new Quaternion(0f, 0f, 0f, 0f); AtavismMobSockets ams = m_model.GetComponent <AtavismMobSockets>(); if (ams != null) { AtavismMobAppearance ama = GetComponent <AtavismMobAppearance>(); if (ama != null) { ama.SetupSockets(ams); } } // Profiler.EndSample(); } // else { Debug.LogError("AtavismGetModel.GetModel No Model: " + modelName); } // } else { AtavismLogger.LogError("AtavismGetModel.GetModel No Model"); } } yield return(delay); } // Profiler.EndSample(); }