// Use this for initialization void Start() { tScript = this.GetComponent <Teleporter>(); cScript = this.GetComponent <Controller>(); hScript = this.GetComponent <Hoverboard>(); gScript = this.GetComponent <Grappling>(); pScript = this.GetComponent <PlatformMvt>(); sScript = this.GetComponent <SwingingArms>(); zScript = this.GetComponent <PinchZoom>(); jScript = this.GetComponent <JetPack>(); spScript = this.GetComponent <SkiPole>(); eScript = this.GetComponent <Soar_Earth>(); TeleMsg = GameObject.Find("ModeUpdate/Canvas/TeleMsg"); ControlMsg = GameObject.Find("ModeUpdate/Canvas/ControlMsg"); HoverMsg = GameObject.Find("ModeUpdate/Canvas/HoverMsg"); GrappleMsg = GameObject.Find("ModeUpdate/Canvas/GrappleMsg"); PlatformMsg = GameObject.Find("ModeUpdate/Canvas/PlatformMsg"); SwingingMsg = GameObject.Find("ModeUpdate/Canvas/SwingingMsg"); PinchMsg = GameObject.Find("ModeUpdate/Canvas/PinchMsg"); JetMsg = GameObject.Find("ModeUpdate/Canvas/JetMsg"); SkiMsg = GameObject.Find("ModeUpdate/Canvas/SkiMsg"); EarthMsg = GameObject.Find("ModeUpdate/Canvas/EarthMsg"); TeleInstr = GameObject.Find("ModeUpdate/Canvas/TeleInstr"); ControlInstr = GameObject.Find("ModeUpdate/Canvas/ControlInstr"); HoverInstr = GameObject.Find("ModeUpdate/Canvas/HoverInstr"); GrappleInstr = GameObject.Find("ModeUpdate/Canvas/GrappleInstr"); PlatformInstr = GameObject.Find("ModeUpdate/Canvas/PlatformInstr"); SwingingInstr = GameObject.Find("ModeUpdate/Canvas/SwingingInstr"); PinchInstr = GameObject.Find("ModeUpdate/Canvas/PinchInstr"); JetInstr = GameObject.Find("ModeUpdate/Canvas/JetInstr"); SkiInstr = GameObject.Find("ModeUpdate/Canvas/SkiInstr"); EarthInstr = GameObject.Find("ModeUpdate/Canvas/EarthInstr"); Timer = GameObject.Find("ModeUpdate/Canvas/Timer"); Body = this.GetComponent <Rigidbody>(); }
void Start() { isPlaying = true; InitObj(); networkAnimator = GetComponentInChildren <Animator>(); if (!cameraTransform) { cameraTransform = transform; } if ((playerType == PlayerType.PC || playerType == PlayerType.VR) && isLocalPlayer) { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; Grappling left = Instantiate(grapplePrefab).GetComponent <Grappling>(); Grappling right = Instantiate(grapplePrefab).GetComponent <Grappling>(); left.player = gameObject; right.player = gameObject; left.playerAnchor = leftController.transform; right.playerAnchor = rightController.transform; left.animController = networkAnimator; right.animController = networkAnimator; left.button = "FireL"; right.button = "FireR"; left.otherGrappling = right; right.otherGrappling = left; CanvasManager.Instance.SetUpLeftHookshot(left); CanvasManager.Instance.SetUpRightHookshot(right); if (playerType == PlayerType.PC) { //CanvasManager.Instance.SetUpLeftHookshot(left); //CanvasManager.Instance.SetUpRightHookshot(right); left.cameraAnchor = player.cameraToEnable.transform; right.cameraAnchor = player.cameraToEnable.transform; } else { //left.spawnPos = leftController.transform; //right.spawnPos = rightController.transform; left.cameraAnchor = player.camerasToDisable[0].transform; right.cameraAnchor = player.camerasToDisable[0].transform; left.VR = true; right.VR = true; string device = XRDevice.model; if (device.Contains("Oculus")) { left.button = "FireL1"; right.button = "FireR1"; } } } }
public void SetUpRightHookshot(Grappling grapplingHook) { rightHookshot.SetActive(true); rightHookshot.GetComponent <GrapplingUI>().grappling = grapplingHook; }
public void SetUpLeftHookshot(Grappling grapplingHook) { leftHookshot.SetActive(true); leftHookshot.GetComponent <GrapplingUI>().grappling = grapplingHook; }
private void Start() { Instance = this; lr = GetComponentInChildren <LineRenderer>(); lr.positionCount = 0; }