Пример #1
0
        private void DrawCyclopsDebugMenu()
        {
            if (GUILayout.Button("Destroy Cyclops static mesh"))
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray4, out RaycastHit raycastHit4))
                {
                    if (raycastHit4.rigidbody.gameObject.name.ToLower().Contains("cyclops"))
                    {
                        Transform transform = raycastHit4.rigidbody.gameObject.transform.Find("CyclopsMeshStatic");
                        Log.Print("Size 1: " + transform.GetComponentInChildren <MeshFilter>().mesh.triangles.Length);
                        Log.Print("Size 2: " + transform.GetComponentInChildren <MeshFilter>().mesh.vertices.Length);
                        Destroy(transform.gameObject);
                    }
                }
            }

            if (GUILayout.Button("Cyclops Engine RPM SFX Manager"))
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray4, out RaycastHit raycastHit4))
                {
                    if (raycastHit4.rigidbody.gameObject.name.ToLower().Contains("cyclops"))
                    {
                        EngineRpmSFXManager engine = raycastHit4.rigidbody.GetComponentInChildren <EngineRpmSFXManager>();
                        if (engine == null)
                        {
                            Utilities.Log.Print("EngineRpmSFXManager not found");
                            return;
                        }

                        Log.Print("engineRpmSFX: " + engine.engineRpmSFX?.asset?.path);
                        Log.Print("stopSoundInterval: " + engine.engineRpmSFX?.stopSoundInterval);
                        Log.Print("engineRevUp: " + engine.engineRevUp?.asset?.path);
                        Log.Print("rampUpSpeed: " + engine.rampUpSpeed);
                        Log.Print("rampDownSpeed: " + engine.rampDownSpeed);
                    }
                }
            }

            if (GUILayout.Button("Cyclops render materials"))
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray4, out RaycastHit raycastHit4))
                {
                    if (raycastHit4.rigidbody.gameObject.name.ToLower().Contains("cyclops"))
                    {
                        //Transform gggg1 = raycastHit4.rigidbody.gameObject.transform.Find("CyclopsMeshStatic").transform.Find("undamaged").Find("cyclops_LOD0").Find("cyclops_submarine_exterior");
                        Transform gggg1 = raycastHit4.rigidbody.gameObject.transform.Find("CyclopsMeshStatic").transform.Find("undamaged").Find("cyclops_LOD0").Find("Cyclops_submarine_exterior_glass");
                        //Transform gggg1 = raycastHit4.rigidbody.gameObject.transform.Find("CyclopsMeshStatic").transform.Find("undamaged").Find("cyclops_LOD0").Find("cyclops_submarine_exterior_decals");
                        //Transform gggg1 = raycastHit4.rigidbody.gameObject.transform.Find("CyclopsMeshStatic").transform.Find("undamaged").Find("cyclops_LOD0");

                        /*foreach (MeshRenderer mr in gggg1.gameObject.GetComponentsInChildren<MeshRenderer>())
                         * {
                         *  Utilities.Log.Print("Gameobject: " + mr.gameObject.name);
                         *  foreach (Material mat2 in mr.materials)
                         *  {
                         *      Utilities.Log.Print("Material: " + mat2.name);
                         *      Utilities.Log.Print("keywords: " + mat2.shaderKeywords.Length);
                         *      foreach(var s in mat2.shaderKeywords)
                         *      {
                         *          Utilities.Log.Print("Keyword: " + s);
                         *      }
                         *      Utilities.Log.Print("-");
                         *  }
                         *  Utilities.Log.Print("--");
                         * }*/

                        Log.Print("Materials count: " + gggg1.GetComponent <MeshRenderer>().materials.Length);
                        Material mat = gggg1.GetComponent <MeshRenderer>().material;
                        mat.PrintAllMarmosetUBERShaderProperties();
                    }
                }
            }

            if (GUILayout.Button("Cyclops Oxygen Manager"))
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray4, out RaycastHit raycastHit4))
                {
                    if (raycastHit4.rigidbody.gameObject.name.ToLower().Contains("cyclops"))
                    {
                        OxygenManager[] oxygenManager = raycastHit4.rigidbody.GetComponentsInChildren <OxygenManager>();
                        Log.Print("Oxygen Manager Found Count " + oxygenManager.Length);
                    }
                }
            }

            if (GUILayout.Button("Cyclops Depth Cleaer"))
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray4, out RaycastHit raycastHit4))
                {
                    if (raycastHit4.rigidbody.gameObject.name.ToLower().Contains("cyclops"))
                    {
                        SubRoot      subRoot = raycastHit4.rigidbody.GetComponent <SubRoot>();
                        MeshRenderer mr      = subRoot.depthClearer as MeshRenderer;
                        Log.Print("DepthClearer type: " + subRoot.depthClearer.GetType());
                        Log.Print("DepthClearer name: " + subRoot.depthClearer.name);
                        Log.Print("DepthClearer material: " + subRoot.depthClearer.material);
                        Log.Print("DepthClearer mesh: " + subRoot.depthClearer.GetComponent <MeshFilter>().mesh);
                        Log.Print("DepthClearer mesh name: " + subRoot.depthClearer.GetComponent <MeshFilter>().mesh.name);
                        Log.Print("DepthClearer Children count: " + subRoot.depthClearer.transform.childCount);
                        Log.Print("DepthClearer transform pos: " + subRoot.depthClearer.transform.localPosition);
                        Log.Print("DepthClearer transform size: " + subRoot.depthClearer.transform.localScale);
                        Log.Print("DepthClearer transform Parent: " + subRoot.depthClearer.transform.parent?.name);
                        subRoot.depthClearer.material.color = new Color(1f, 0f, 0f, 1f);
                        Log.Print("DepthClearer mat color: " + subRoot.depthClearer.material.color);
                        Log.Print("DepthClearer enabled?: " + subRoot.depthClearer.enabled);

                        Log.Print("DepthClearer Component cound: " + subRoot.depthClearer.GetComponents(typeof(Component)).Length);
                        foreach (Component c in subRoot.depthClearer.GetComponents(typeof(Component)))
                        {
                            Utilities.Log.Print("Component: " + c);
                        }
                    }
                }
            }

            if (GUILayout.Button("Cyclops Ladder"))
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray4, out RaycastHit raycastHit4))
                {
                    if (raycastHit4.rigidbody.gameObject.name.ToLower().Contains("cyclops"))
                    {
                        Utilities.Log.Print(raycastHit4.rigidbody.gameObject.name);
                        foreach (SkinnedMeshRenderer smr in raycastHit4.rigidbody.gameObject.GetComponentsInChildren <SkinnedMeshRenderer>())
                        {
                            if (smr.gameObject.name.ToLower().Equals("submarine_ladder_04") || smr.gameObject.name.ToLower().Equals("cyclops_ladder_long") ||
                                smr.gameObject.name.ToLower().Equals("cyclops_ladder_short_right") || smr.gameObject.name.ToLower().Equals("cyclops_ladder_short_left") ||
                                smr.gameObject.name.ToLower().Equals("submarine_ladder_02"))
                            {
                                Utilities.Log.Print("Mesh: " + smr.gameObject.GetComponent <SkinnedMeshRenderer>()?.sharedMesh?.name);
                                Utilities.Log.Print("Bones Length: " + smr.gameObject.GetComponent <SkinnedMeshRenderer>()?.bones?.Length);
                                smr.gameObject.GetComponent <SkinnedMeshRenderer>()?.material?.PrintAllMarmosetUBERShaderProperties();
                            }
                        }
                    }
                }
            }

            if (GUILayout.Button("Cyclops Force Damage Point"))
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray4, out RaycastHit raycastHit4))
                {
                    if (raycastHit4.rigidbody.gameObject.name.ToLower().Contains("cyclops"))
                    {
                        CyclopsExternalDamageManager damage = raycastHit4.rigidbody.GetComponentInChildren <CyclopsExternalDamageManager>();
                        if (damage == null)
                        {
                            Log.Print("CyclopsExternalDamageManager not found");
                            return;
                        }

                        MethodInfo mi = SMLHelper.V2.Utility.ReflectionHelper.GetInstanceMethod(damage, "CreatePoint");
                        if (mi == null)
                        {
                            Log.Print("CreatePoint method not found");
                            return;
                        }

                        mi.FastInvoke(damage);
                    }
                }
            }

            if (GUILayout.Button("Cyclops Print Damage Info"))
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray4, out RaycastHit raycastHit4))
                {
                    if (raycastHit4.rigidbody.gameObject.name.ToLower().Contains("cyclops"))
                    {
                        CyclopsExternalDamageManager damage = raycastHit4.rigidbody.GetComponentInChildren <CyclopsExternalDamageManager>();
                        if (damage == null)
                        {
                            Log.Print("CyclopsExternalDamageManager not found");
                            return;
                        }

                        CyclopsDamagePoint[] damagePoints = raycastHit4.rigidbody.gameObject.GetComponentsInChildren <CyclopsDamagePoint>();
                        foreach (var dp in damagePoints)
                        {
                            dp.gameObject.GetComponentInChildren <LiveMixin>().PrintAllLiveMixinDetails();
                            Log.Print(" ");
                        }
                    }
                }
            }

            if (GUILayout.Button("CyclopsDestructionevent information."))
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray4, out RaycastHit raycastHit4))
                {
                    if (raycastHit4.rigidbody.gameObject.name.ToLower().Contains("cyclops"))
                    {
                        CyclopsDestructionEvent dm = raycastHit4.rigidbody.GetComponentInChildren <CyclopsDestructionEvent>();
                        if (dm == null)
                        {
                            Log.Print("Cyclop's CyclopsDestructionEvent not found.");
                            return;
                        }

                        Utilities.Log.Print("explodeSFX: " + dm.fxControl);
                    }
                }
            }

            if (GUILayout.Button("Cyclops PingInstance information."))
            {
                Ray ray4 = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray4, out RaycastHit raycastHit4))
                {
                    if (raycastHit4.rigidbody.gameObject.name.ToLower().Contains("cyclops"))
                    {
                        PingInstance pi = raycastHit4.rigidbody.GetComponentInChildren <PingInstance>();
                        if (pi == null)
                        {
                            Log.Print("Cyclop's PingInstance not found.");
                            return;
                        }

                        Log.Print("colorIndex: " + pi.colorIndex);
                        Log.Print("currentVersion: " + pi.currentVersion);
                        Log.Print("displayPingInManager: " + pi.displayPingInManager);
                        Log.Print("maxDist: " + pi.maxDist);
                        Log.Print("minDist: " + pi.minDist);
                        Log.Print("origin: " + pi.origin);
                        Log.Print("pingType: " + pi.pingType);
                        Log.Print("visible: " + pi.visible);
                    }
                }
            }
        }
Пример #2
0
 public static bool Prefix(CyclopsDestructionEvent __instance)
 {
     DeathRun.setCause("Went Down w/ Cyclops");
     return(true);
 }