示例#1
0
        private void loadConfigData(ConfigNode node)
        {
            if (configLoaded)
            {
                return;
            }
            configLoaded = true;
            ConfigNode[] drogueNodes = node.GetNodes("DROGUECHUTE");
            ConfigNode[] mainNodes   = node.GetNodes("MAINCHUTE");
            int          len         = drogueNodes.Length;

            drogueChuteModules = new ParachuteModelData[len];
            for (int i = 0; i < len; i++)
            {
                drogueChuteModules[i] = new ParachuteModelData(drogueNodes[i], drogueRetractedScale, drogueSemiDeployedScale, drogueFullDeployedScale, i, false);
            }
            len = mainNodes.Length;
            mainChuteModules = new ParachuteModelData[len];
            for (int i = 0; i < len; i++)
            {
                mainChuteModules[i] = new ParachuteModelData(mainNodes[i], mainRetractedScale, mainSemiDeployedScale, mainFullDeployedScale, i, true);
            }

            mainAttachPos = Vector3.zero;
            foreach (ParachuteModelData pmd in mainChuteModules)
            {
                mainAttachPos += pmd.localPosition;
            }
            mainAttachPos.z = -mainAttachPos.z;//TODO -- fix inverted Z on these things...
            drogueAttachPos = Vector3.zero;
            foreach (ParachuteModelData pmd in drogueChuteModules)
            {
                drogueAttachPos += pmd.localPosition;
            }
            drogueAttachPos.z = -drogueAttachPos.z;//TODO -- fix inverted Z on these things...
        }
 private void updateDeployAnimation(ParachuteModelData[] modules, ChuteAnimationState state, float progress, float randomization, float lerpDps)
 {
     foreach (ParachuteModelData data in modules) { data.updateDeployAnimation(state, progress, randomization, lerpDps); }
 }
 protected override void loadConfigData(ConfigNode node)
 {
     if (configLoaded) { return; }
     configLoaded = true;
     ConfigNode[] drogueNodes = node.GetNodes("DROGUECHUTE");
     ConfigNode[] mainNodes = node.GetNodes("MAINCHUTE");
     int len = drogueNodes.Length;
     drogueChuteModules = new ParachuteModelData[len];
     for (int i = 0; i < len; i++){ drogueChuteModules[i] = new ParachuteModelData(drogueNodes[i], drogueRetractedScale, drogueSemiDeployedScale, drogueFullDeployedScale, i, false); }
     len = mainNodes.Length;
     mainChuteModules = new ParachuteModelData[len];
     for (int i = 0; i < len; i++){ mainChuteModules[i] = new ParachuteModelData(mainNodes[i], mainRetractedScale, mainSemiDeployedScale, mainFullDeployedScale, i, true); }
     cubeToNameMap.Clear();
     cubeToNameMap.Add(ChuteDragCube.RETRACTED, retractedDragCubeName);
     cubeToNameMap.Add(ChuteDragCube.DROGUESEMI, drogueSemiDragCubeName);
     cubeToNameMap.Add(ChuteDragCube.DROGUEFULL, drogueFullDragCubeName);
     cubeToNameMap.Add(ChuteDragCube.MAINSEMI, mainSemiDragCubeName);
     cubeToNameMap.Add(ChuteDragCube.MAINFULL, mainFullDragCubeName);
 }
 private void updateDeployAnimation(ParachuteModelData[] modules, ChuteAnimationState state, float progress)
 {
     updateDeployAnimation(modules, state, progress, wobbleMultiplier, lerpDegreePerSecond);
 }
        private void loadConfigData(ConfigNode node)
        {
            if (configLoaded) { return; }
            configLoaded = true;
            ConfigNode[] drogueNodes = node.GetNodes("DROGUECHUTE");
            ConfigNode[] mainNodes = node.GetNodes("MAINCHUTE");
            int len = drogueNodes.Length;
            drogueChuteModules = new ParachuteModelData[len];
            for (int i = 0; i < len; i++){ drogueChuteModules[i] = new ParachuteModelData(drogueNodes[i], drogueRetractedScale, drogueSemiDeployedScale, drogueFullDeployedScale, i, false); }
            len = mainNodes.Length;
            mainChuteModules = new ParachuteModelData[len];
            for (int i = 0; i < len; i++){ mainChuteModules[i] = new ParachuteModelData(mainNodes[i], mainRetractedScale, mainSemiDeployedScale, mainFullDeployedScale, i, true); }

            mainAttachPos = Vector3.zero;
            foreach(ParachuteModelData pmd in mainChuteModules) { mainAttachPos += pmd.localPosition; }
            mainAttachPos.z = -mainAttachPos.z;//TODO -- fix inverted Z on these things...
            drogueAttachPos = Vector3.zero;
            foreach (ParachuteModelData pmd in drogueChuteModules) { drogueAttachPos += pmd.localPosition; }
            drogueAttachPos.z = -drogueAttachPos.z;//TODO -- fix inverted Z on these things...
        }