示例#1
0
    public PSZipLine(PlayerController _pc) : base()
    {
        pc  = _pc;
        zip = pc.zipLine;

        pc.rigidbody2d.gravityScale = 0;
        pc.rigidbody2d.velocity     = Vector2.zero;
        tirolinaSize   = zip.endPoint.position.x - pc.transform.position.x;
        pc.model.speed = pc.model.normalSpeed;

        pc.animator.SetBool("B-ZipLine", true);
        pc.animator.SetTrigger("T-ZipLine");
        gc.audioController.PlaySound("zipLine");
    }
示例#2
0
文件: IgorZip.cs 项目: fbizuneh/Igor
        public static void UnzipFileWindows(IIgorModule ModuleInst, string ZipFilename, string DirectoryToUnzipTo, bool bUpdateBuildProducts)
        {
            string ZipParams = "/c unzip -o \"" + ZipFilename + "\"";

            if (DirectoryToUnzipTo != "")
            {
                ZipParams += " -d \"" + DirectoryToUnzipTo + "\"";
            }

            string ZipOutput = "";
            string ZipError  = "";

            if (IgorRuntimeUtils.RunProcessCrossPlatform(ModuleInst, "", "c:\\windows\\system32\\cmd.exe", ZipParams, Path.GetFullPath("."), "Unzipping the archive " + ZipFilename + " to folder " + DirectoryToUnzipTo, false) == 0)
            {
                IgorDebug.Log(ModuleInst, "Zip file " + ZipFilename + " unzipped successfully!\nOutput:\n" + ZipOutput + "\nError\n" + ZipError);

                if (bUpdateBuildProducts)
                {
                    if (IgorRuntimeUtils.RunProcessCrossPlatform(ModuleInst, "", "c:\\windows\\system32\\cmd.exe", "/c unzip -v \"" + ZipFilename + "\"", Path.GetFullPath("."), "Listing the contents of " + ZipFilename, ref ZipOutput, ref ZipError, false) == 0)
                    {
                        IgorDebug.Log(ModuleInst, "Zip " + ZipFilename + " contents are:\nOutput:\n" + ZipOutput + "\nError\n" + ZipError);

                        List <string> NewProducts = new List <string>();

                        string[] Lines = ZipOutput.Split(new char[] { '\n', '\r' });

                        foreach (string ZipLine in Lines)
                        {
                            if (ZipLine.Contains("Defl") || ZipLine.Contains("Stored"))
                            {
                                if (!ZipLine.EndsWith("/"))
                                {
                                    NewProducts.Add(ZipLine.Substring(ZipLine.LastIndexOf(' ') + 1));
                                }
                            }
                        }

                        IgorCore.SetNewModuleProducts(NewProducts);
                    }
                }
            }
        }
示例#3
0
 public ZipLineTeleport(ZipLine target) : base(target)
 {
 }
    // Update is called once per frame
    void Update()
    {
        RaycastHit interactable;

        if (Physics.Raycast(cameraCam.position, cameraCam.forward, out interactable, 30.0f))
        {
            if (interactable.transform.GetComponent <GiantCrossbow> ())
            {
                canSee = true;
            }
            else if (interactable.transform.GetComponent <ZipLine> ())
            {
                canSee = true;
            }
            else
            {
                canSee = false;
            }
        }

        if (Input.GetKeyUp(KeyCode.F))
        {
            if (controls.enabled && crossbow == null)
            {
                RaycastHit hit;

                if (Physics.Raycast(cameraCam.position, cameraCam.forward, out hit, 30.0f))
                {
                    crossbow = hit.transform.GetComponent <GiantCrossbow> ();

                    if (crossbow != null)
                    {
                        crossbow.madeActive = controls;
                        crossbow.isUsed     = true;
                        controls.enabled    = false;
                        crossbow.cam        = hit.transform.GetComponentInChildren <Camera>();
                    }
                    ZipLine zippy = hit.transform.GetComponent <ZipLine>();
                    if (zippy != null)
                    {
                        zippy.Traveller(this.transform);
                        zippy.travelling    = true;
                        controls.enabled    = false;
                        zippy.justActivated = true;
                    }

                    BoulderInteract bold = hit.transform.GetComponent <BoulderInteract> ();

                    if (bold != null)
                    {
                        bold.Launch();
                    }


                    GasValve gassy = hit.transform.GetComponent <GasValve> ();

                    if (gassy != null)
                    {
                        gassy.ActivateGas();
                        sonVoice.GasVoice();
                        print("Something");
                    }
                }
            }


            else
            {
                crossbow         = null;
                controls.enabled = true;
            }
        }
    }    //end of Update
示例#5
0
 public override void Initialize()
 {
     base.Initialize();
     linkedTo = GameManager.instance.FindLocalIdeable(netIdLinkedTo).GetComponent <ZipLine>();
     GetComponentInChildren <ZiplineFX>().ConnectZipline(linkedTo.GetComponentInChildren <ZiplineFX>());
 }