Пример #1
0
    //TODO: uncomment and fix behavior for animation
    //public Animator animator;


    void Start()
    {
        this.CurrentPhase     = Phase.None;
        this.DistanceToGround = this.GetComponent <BoxCollider2D>().bounds.extents.y;
        this.Width            = this.GetComponent <BoxCollider2D>().bounds.extents.x;
        _GrapplingHook        = this.GetComponent <GrapplingHook>();
    }
Пример #2
0
    public void init()
    {
        pos          = Map.grid.grid_to_world(Map.grid.world_to_grid(transform.position));
        current_node = Map.grid.get_node(Map.grid.world_to_grid(pos));

        controller = GetComponent <PlatformCollision>();
        controller.init();
        player_movement = GetComponent <PlayerMovement>();
        player_movement.init();

        Transform weapon_obj = transform.parent.FindChild("weapon");

        if (weapon_obj == null)
        {
            Debug.LogError("'weapon' object cannot be found in player parent's children");
        }
        weapon_inventory = weapon_obj.GetComponent <WeaponInventory>();
        weapon_inventory.init(this);
        weapon_control = weapon_obj.GetComponent <PlayerWeaponControl>();
        weapon_control.init();

        grappling_hook = GetComponent <GrapplingHook>();
        grappling_hook.init();
        health = GetComponent <GenericHealth>();
        health.init(this);
    }
Пример #3
0
    public void OnSceneGUI()
    {
        if (myTarget == null)
        {
            myTarget        = (GrapplingHook)target;
            oldTimeToChange = myTarget.timeToChangeLength;
            oldSpeed        = myTarget.changeSpeed;
        }

        Color c = Color.green;

        c.a           = 0.1f;
        Handles.color = c;
        Handles.DrawSolidDisc(((GrapplingHook)target).transform.position, Vector3.forward, ((GrapplingHook)target).range);

        if (oldTimeToChange != myTarget.timeToChangeLength)
        {
            float oldChangeSpeed = myTarget.changeSpeed;
            myTarget.changeSpeed *= (myTarget.timeToChangeLength / oldTimeToChange);
            if (float.IsNaN(myTarget.changeSpeed))
            {
                myTarget.changeSpeed = oldChangeSpeed;
            }
        }
        if (oldSpeed != myTarget.changeSpeed && myTarget.changeSpeed < 0)
        {
            myTarget.changeSpeed = oldSpeed;
        }
        if (oldTimeToChange != myTarget.timeToChangeLength && myTarget.timeToChangeLength < 0)
        {
            myTarget.timeToChangeLength = oldTimeToChange;
        }
        oldSpeed        = myTarget.changeSpeed;
        oldTimeToChange = myTarget.timeToChangeLength;
    }
        public static void Postfix(GrapplingHook __instance, Collision collisionInfo)
        {
            var target = __instance.GetTargetRigidbody(collisionInfo.gameObject);

            if (target == null)
            {
                return;
            }

            var creature = target.GetComponent <Creature>();

            if (creature == null)
            {
                return;
            }

            var mixin = creature.GetComponent <LiveMixin>();

            if (mixin == null)
            {
                return;
            }

            if (QMultiModSettings.Instance.ExosuitGrapplingArmDamage != 0f) // to avoid potential event triggers
            {
                mixin.TakeDamage(QMultiModSettings.Instance.ExosuitGrapplingArmDamage, creature.transform.position, DamageType.Normal, null);
            }
        }
Пример #5
0
        /// <summary>
        /// initializes all parameters prior to a dash and triggers the pre dash feedbacks
        /// </summary>
        public virtual void InitiateGrapple()
        {
            // we start our sounds
            PlayAbilityStartSfx();
            PlayAbilityUsedSfx();

            // we initialize our various counters and checks
            CooldownTimeStamp = Time.time + grappleCooldown;

            ComputeGrappleDirection();
            CheckFlipCharacter();

            RaycastHit2D hit = MMDebug.RayCast(transform.position, GrappleDirection, grappleDistance, _controller.PlatformMask, Color.blue, true);

            if (hit.collider == null)
            {
                return;
            }

            GameObject    go   = Instantiate(grapplePrefab, hit.point, new Quaternion(), hit.transform.parent);
            GrapplingHook hook = go.GetComponent <GrapplingHook>();

            hook.hasGrip = hasGrip;
            hook.source  = gameObject;
            hook.DeployHook();

            // we play our exit sound
            StopAbilityUsedSfx();
            PlayAbilityStopSfx();
        }
Пример #6
0
    void Start()
    {
        flashlight            = GetComponentInChildren <FlashlightToggle>();
        explain               = GetComponentInChildren <ExplainItems>();
        grapplingHook         = GetComponent <GrapplingHook>();
        fpc                   = GetComponent <FirstPersonController>();
        grapplingHook.enabled = false;

        Unlocks.OnGrapplingHookChanged.AddListener(() =>
        {
            UpdateGrapplingHook();
        });

        Unlocks.OnDoubleJumpChanged.AddListener(() =>
        {
            UpdateDoubleJump();
        });

        Unlocks.OnFlashlightChanged.AddListener(() =>
        {
            UpdateFlashlight();
        });
        UpdateDoubleJump();
        UpdateGrapplingHook();
        UpdateFlashlight();
    }
Пример #7
0
 void Start()
 {
     // PrevRotation = this.gameObject.transform.rotation;
     this.CurrentPhase     = Phase.None;
     this.DistanceToGround = this.GetComponent <BoxCollider2D>().bounds.extents.y;
     _GrapplingHook        = this.GetComponent <GrapplingHook>();
 }
Пример #8
0
    void MovementSound()
    {
        //KostinKoodi
        RaycastHit movementRayHit;

        if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.down), out movementRayHit, transform.lossyScale.y + 0.5f, LayerMask.GetMask("Geometry")))
        {
            Color32 bloodColor = new Color32(138, 3, 3, 50);
            //Debug.Log("Asd" + GetPixelColor(movementRayHit));
            if (GetPixelColor(movementRayHit).ColorEq(bloodColor))
            {
                walkingOnBlood = true;
            }
            else
            {
                walkingOnBlood = false;
            }
        }

        GrapplingHook grapplingHook = transform.Find("Main Camera").GetComponent <GrapplingHook>();

        if (movingWithInput == true && dodging == false && grounded == true && !grapplingHook.newGrapplingHook)
        {
            FMODUnity.RuntimeManager.PlayOneShotAttached("event:/SX/Player/Small/Player_small_movement", gameObject);

            if (walkingOnBlood)
            {
                FMODUnity.RuntimeManager.PlayOneShotAttached("event:/SX/Blood/Sx_blood_footsteps", gameObject);
            }
        }
    }
Пример #9
0
    // Start is called before the first frame update
    void Start()
    {
        move       = GetComponent <PlayerMove>();
        jump       = GetComponent <PlayerJump>();
        climb      = GetComponent <PlayerClimb>();
        playerMask = GetComponent <Masks>();
        playerItem = GetComponent <Item>();

        maskController = FindObjectOfType <MaskController>();
        inventory      = FindObjectOfType <Inventory>();
        speech         = FindObjectOfType <SpeechScript>();
        anim           = GetComponent <Animator>();
        grapple        = FindObjectOfType <GrapplingHook>();


        hasJumped     = false;
        hasWallJumped = false;
        isClimbing    = false;
        isZipping     = false;
        moving        = true;
        launched      = false;
        hasRune       = false;

        GetComponent <DistanceJoint2D>().enabled = false;
        maskInventory = new List <string>();
        itemInventory = new List <string>();

        maskCounter = 0;
        itemCounter = 0;

        knockbackCount = knockbackLength;
    }
Пример #10
0
    // Start is called before the first frame update
    void Awake()
    {
        #region Singelton check
        if (Instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            Instance = this;
        }
        #endregion
        DontDestroyOnLoad(gameObject);
        throwScript   = GetComponent <Throw>();
        move          = GetComponent <PlayerMovement>();
        animeScript   = GetComponent <PlayerAnimationScript>();
        summon        = GetComponent <Summon>();
        grapplingHook = GetComponent <GrapplingHook>();
        coll          = GetComponent <Collision>();
        pickUp        = GetComponent <PickUp>();
        SetCameraToFollowPlayer();
        maxHealth = health;

        scripts.Add(throwScript);
        scripts.Add(summon);
        scripts.Add(grapplingHook);
    }
Пример #11
0
    // Use this for initialization
    void Start()
    {
        activeObject = false;
        playerState  = 1;
        maxHealth    = 5;
        thiefHealth  = maxHealth;
        wizardHealth = maxHealth;
        knightHealth = 8;

        knightAlive    = true;
        thiefAlive     = true;
        wizardAlive    = true;
        deathConfirmed = false;
        spawnSmoke     = false;
        wizardChild    = gameObject.transform.GetChild(0).GetChild(0).gameObject;
        thiefChild     = gameObject.transform.GetChild(1).GetChild(0).gameObject;
        knightChild    = gameObject.transform.GetChild(2).GetChild(0).gameObject;

        grapple = GetComponent <GrapplingHook>();
        bow     = GetComponent <Bow>();
        mouseFunctionsSummonableCube = summonableCube.GetComponent <MouseFunctions>();
        playerRigidbody = gameObject.GetComponent <Rigidbody>();
        knightFunctions = gameObject.GetComponent <KnightFunctions>();

        particleCube   = summonableCube.GetComponent <ParticleSystem>();
        playerMovement = gameObject.GetComponent <PlayerMovement>();

        thiefSpeed  = 10;
        knightSpeed = 10;
        wizardSpeed = 10;
    }
Пример #12
0
 private void Start()
 {
     Camera.main.gameObject.GetComponent <CameraBehavior>().target = this.transform.parent.Find("Waist").transform;
     targetMouse = GetComponent <TargetMouse>();
     gHook       = GetComponent <GrapplingHook>();
     rLauncher   = GetComponent <RocketLauncher>();
 }
Пример #13
0
 void Start()
 {
     hook        = GetComponentInChildren <GrapplingHook>();
     animator    = GetComponent <Animator>();
     spawnEffect = gameObject.GetComponentInChildren <SpawnEffect>();
     //doubleJumpParticle = GameObject.Find ("doubleJump").GetComponent<DoubleJumpParticle> ();
     spawn = transform.position;
 }
Пример #14
0
    void Start()
    {
        ropeObject = GameObject.Find("Rope");
        rope       = ropeObject.GetComponent <LineRenderer>();
//		rope.SetWidth(0.3f, 0.3f);
//		rope.enabled = false;
        grapplingHook = gameObject.GetComponent <GrapplingHook>();
    }
Пример #15
0
 // Start is called before the first frame update
 void Start()
 {
     rb            = GetComponent <Rigidbody2D>();
     grapplingHook = GetComponent <GrapplingHook>();
     playerCon     = GetComponentInParent <PlayerController>();
     playerNum     = playerCon.playerNum;
     moveDir       = playerCon.moveDir;
 }
    private void InitHookObject(PlayerPickupsModule pPickupsModule)
    {
        GrapplingHook pHook = Instantiate(m_pHookPrefab);

        pPickupsModule.m_pMaster.m_pInventorySlotsModule.EquipItemInSlot(pHook.transform, EInventorySlot.BELT, false);

        pPickupsModule.SetVariable(c_sVariableName_pGrapplingHookObject, pHook);
    }
Пример #17
0
 // Start is called before the first frame update
 void Start()
 {
     player     = FindObjectOfType <PlayerInput>();
     health     = FindObjectOfType <HealthManager>();
     grapple    = FindObjectOfType <GrapplingHook>();
     playerMove = FindObjectOfType <PlayerMove>();
     herbs      = 0;
 }
Пример #18
0
 void Start()
 {
     hook = GetComponentInChildren<GrapplingHook>();
     animator = GetComponent<Animator>();
     spawnEffect = gameObject.GetComponentInChildren<SpawnEffect>();
     //doubleJumpParticle = GameObject.Find ("doubleJump").GetComponent<DoubleJumpParticle> ();
     spawn = transform.position;
 }
Пример #19
0
 // Start is called before the first frame update
 void Start()
 {
     playerMove = FindObjectOfType <PlayerMove>();
     player     = FindObjectOfType <PlayerInput>();
     inventory  = FindObjectOfType <Inventory>();
     loader     = FindObjectOfType <LevelLoader>();
     grappling  = FindObjectOfType <GrapplingHook>();
 }
Пример #20
0
    // Update is called once per frame
    void Update()
    {
        var vertical   = Input.GetAxisRaw("Vertical");
        var horizontal = Input.GetAxisRaw("Horizontal");

        // Cannot go Up if not in the water
        if (!m_entity.InWater())
        {
            vertical = Mathf.Clamp(vertical, -1.0f, 0f);
        }

        //Debug.Log("Vertical " + vertical);

        m_entity.SetMoveDirection(new Vector3(horizontal, vertical, 0), true);

        // Grappling hook
        if (Input.GetKeyDown(KeyCode.Mouse1) && PlayerLevel >= 1)
        {
            Vector3 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            Vector3 dir3          = mousePosition - transform.position;
            Vector2 dir           = new Vector2(dir3.x, dir3.y).normalized;

            foreach (Transform child in grapplingHookParent)
            {
                Destroy(child.gameObject);
            }

            GameObject hook = Instantiate(grapplingHook, transform.position + (Vector3)dir * 0.3f, Quaternion.identity, grapplingHookParent);
            m_lastHook = hook.GetComponent <GrapplingHook>();
            m_lastHook.SetMoveDirection(dir);
            if (PlayerLevel == 1)
            {
                m_lastHook.SetHookSpeed(level1HookSpeed);
            }
            else if (PlayerLevel >= 2)
            {
                m_lastHook.SetHookSpeed(level2HookSpeed);
            }
        }

        // If a movement key is pressed, delete latched hook
        if (
            Input.GetKey(KeyCode.W) ||
            Input.GetKey(KeyCode.A) ||
            Input.GetKey(KeyCode.S) ||
            Input.GetKey(KeyCode.D) ||
            Input.GetKey(KeyCode.LeftArrow) ||
            Input.GetKey(KeyCode.RightArrow) ||
            Input.GetKey(KeyCode.UpArrow) ||
            Input.GetKey(KeyCode.DownArrow)
            )
        {
            if (m_lastHook != null)
            {
                m_lastHook.DeleteIfLatched();
            }
        }
    }
Пример #21
0
 // Use this for initialization
 void Start()
 {
     Time.timeScale = 1;
     isPaused       = false;
     player         = GameObject.Find("KodamaPlayer").GetComponent <Transform>();
     grapplingHook  = GameObject.Find("Grappling Hook").GetComponent <Transform>();
     playerScript   = GameObject.Find("KodamaPlayer").GetComponent <Player>();
     grappleScript  = GameObject.Find("Grappling Hook").GetComponent <GrapplingHook>();
 }
Пример #22
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Hookable")
     {
         GrapplingHook hook = player.GetComponent <GrapplingHook>();
         hook.hooked       = true;
         hook.hookedObject = other.gameObject;
     }
 }
Пример #23
0
 // Use this for initialization
 void Start()
 {
     Time.timeScale = 1;
     isPaused = false;
     player = GameObject.Find("KodamaPlayer").GetComponent<Transform>();
     grapplingHook = GameObject.Find("Grappling Hook").GetComponent<Transform>();
     playerScript = GameObject.Find("KodamaPlayer").GetComponent<Player>();
     grappleScript = GameObject.Find("Grappling Hook").GetComponent<GrapplingHook>();
 }
    private void PutHookBackInBelt(GrapplingHook pHook, PlayerCharacter pPlayer)
    {
        pHook.m_pRopeEnd.SetParent(pHook.m_pRopeObject.transform);
        pHook.m_pRopeEnd.localPosition = Vector3.zero;
        pHook.m_pRopeObject.SetActive(false);

        pPlayer.m_pInventorySlotsModule.EquipItemInSlot(pHook.transform, EInventorySlot.BELT, false);
        pHook.transform.localPosition = m_pHookPrefab.transform.localPosition;
        pHook.transform.localRotation = m_pHookPrefab.transform.localRotation;
    }
Пример #25
0
    public override void LandHit(RaycastHit hit, Vector3 hitPosition)
    {
        base.LandHit(hit, hitPosition);

        grapplingHook = GetOwningGun().GetComponent <GrapplingHook>();
        if ((grapplingHook != null) && (hit.transform != null))
        {
            grapplingHook.RegisterHit(hit.transform.gameObject, hitPosition);
        }
    }
Пример #26
0
        private void OnCollisionEnter(Collision collisionInfo)
        {
            SeaMoth componentInParent = collisionInfo.gameObject.GetComponentInParent <SeaMoth>();

            GrapplingHook component = collisionInfo.gameObject.GetComponent <GrapplingHook>();

            if (staticAttached || (fixedJoint && fixedJoint.connectedBody) || componentInParent != null || component != null)
            {
                return;
            }

            Rigidbody targetRigidbody = GetTargetRigidbody(collisionInfo.gameObject);

            rb.velocity = Vector3.zero;

            if (targetRigidbody != null && JointHelper.ConnectFixed(gameObject, targetRigidbody))
            {
                staticAttached = false;
            }
            else
            {
                staticAttached = true;
                rb.isKinematic = true;
            }

            Utils.PlayFMODAsset(hitSound, transform, 5f);

            Vector3 vector = default(Vector3);

            int num = 0;

            for (int i = 0; i < collisionInfo.contacts.Length; i++)
            {
                ContactPoint contactPoint = collisionInfo.contacts[i];
                if (num == 0)
                {
                    vector = contactPoint.normal;
                }
                else
                {
                    vector += contactPoint.normal;
                }
                num++;
            }
            if (num > 0)
            {
                vector /= num;
                Vector3 eulerAngles = Quaternion.LookRotation(transform.forward, vector).eulerAngles;
                eulerAngles.z        -= 90f;
                transform.eulerAngles = eulerAngles;
            }
            VFXSurface component2 = collisionInfo.gameObject.GetComponent <VFXSurface>();

            VFXSurfaceTypeManager.main.Play(component2, VFXEventTypes.impact, transform.position, transform.rotation, null);
        }
    private void InitAnticipation(PlayerPickupsModule pPickupsModule)
    {
        pPickupsModule.SetVariable(c_sVariableName_fGrapplingHookCurrentStepStartTime, Time.time);
        pPickupsModule.m_pMaster.SetBehaviourFrozen(true);

        GrapplingHook pHook = (GrapplingHook)(pPickupsModule.GetVariable(c_sVariableName_pGrapplingHookObject));

        pPickupsModule.m_pMaster.m_pInventorySlotsModule.EquipItemInSlot(pHook.transform, EInventorySlot.HAND, false);

        pPickupsModule.SetVariable(c_sVariableName_eGrapplingHookCurrentStep, EGrapplingHookEffectStep.ANTICIPATION);
    }
Пример #28
0
    void Awake()
    {
        m_animator = GetComponent <Animator>();
        if (m_animator == null)
        {
            Debug.Log("Animator could not be found");
        }
        ground_animator = m_animator.runtimeAnimatorController;

        m_rigidbody = GetComponent <Rigidbody>();
        if (m_rigidbody == null)
        {
            Debug.Log("Rigid body could not be found");
        }


        playerAudio = GetComponent <AudioSource>();

        m_collider = GetComponent <Collider>();
        if (m_collider == null)
        {
            Debug.Log("Collider could not be found for player object.");
        }

        Sword = GameObject.FindGameObjectsWithTag("Sword");
        if (Sword.Length == 0)
        {
            Debug.LogWarning("No sword");
        }
        else
        {
            foreach (GameObject s in Sword)
            {
                s.SetActive(false);
            }
        }
        Hook = GameObject.FindGameObjectWithTag("Hook");
        if (!Hook)
        {
            Debug.LogWarning("No hook found");
        }
        grapplingHook = GetComponent <GrapplingHook>();
        if (!grapplingHook)
        {
            Debug.LogWarning("No script grappling found");
        }

        mainCamera = Camera.main;
        if (mainCamera == null)
        {
            Debug.LogWarning("No main camera");
        }
    }
Пример #29
0
    private void Respawn()
    {
        transform.position = respawnPoint.position;
        health             = maxHealth;
        gameObject.GetComponent <Rigidbody>().velocity = Vector3.zero; // reset velocity to stop pre respawn movement
        GrapplingHook grapplingHook = GetComponentInChildren <GrapplingHook>();

        if (grapplingHook)
        {
            grapplingHook.StopGrapple();
        }
    }
 private void OnCollisionEnter(Collision other)
 {
     if (GameObject.Equals(other.gameObject, GameObject.Find("Cat Lite")))
     {
         catmovement.gameover = true;
         GrapplingHook hook = GameObject.FindGameObjectWithTag("Player").GetComponent <GrapplingHook>();
         if (hook.hooked == true)
         {
             hook.ReturnHook();
         }
     }
 }
Пример #31
0
 private void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     if (player)
     {
         grappling = player.GetComponent <GrapplingHook>();
     }
     if (!grappling)
     {
         Debug.LogWarning("No grappling hook script found");
     }
 }
Пример #32
0
 private void Awake()
 {
     mc              = GetComponent <MovementController>();
     mc.OnLanding   += OnLanding;
     cam             = Camera.main;
     health          = GetComponent <Health>();
     health.OnDeath += OnDeath;
     fps             = cam.GetComponent <FirstPersonCamera>();
     digger          = GetComponent <Digger>();
     audioSource     = GetComponent <AudioSource>();
     grapplingHook   = GetComponent <GrapplingHook>();
     digger.DigSize  = DigSize;
 }
Пример #33
0
    public void Start()
    {
        if (TutorialCamera.Enabled())
        {
            enabled = false;
            return;
        }
        else
        {
            enabled = true;

            initialCameraPosition = transform.position;
            initialCameraRotation = transform.rotation;

            AmbientNoise.Play();

            PauseButton.paused = false;

            player = GameObject.Find("Player");
            grapplingHook = player.GetComponent<GrapplingHook>();
            playerMovements = player.GetComponent<PlayerMovements>();

            //ControlManager.Disabled = true;
            if (!GameRecorder.playingBack)
            {
                GameRecorder.StopPlayback();

                if (LevelSelectGUI.currentLevel != null)
                    GUIController.ShowText("LevelName", LevelSelectGUI.currentLevel.name);

        #if UNITY_ANDROID || UNITY_IPHONE
                GUIController.ShowText("Text", "Tap to begin");
        #else
                GUIController.ShowText("Text", "Click to begin");
        #endif

                GUIController.GUILevelPause();
                GUIController.HideText("Paused");
            }

            EnableCameraController();
        }
    }
Пример #34
0
    public void init()
    {
        pos = Map.grid.grid_to_world(Map.grid.world_to_grid(transform.position));
        current_node = Map.grid.get_node(Map.grid.world_to_grid(pos));

        controller = GetComponent<Controller2D>();
        controller.init();
        player_movement = GetComponent<PlayerMovement>();
        player_movement.init();

        Transform weapon_obj = transform.parent.FindChild("weapon_base");
        if (weapon_obj == null) Debug.LogError("'weapon_base' object cannot be found in player parent's children");
        inventory = weapon_obj.GetComponent<WeaponInventory>();
        inventory.init(this);
        weapon_control = weapon_obj.GetComponent<PlayerWeaponControl>();
        weapon_control.init();

        grappling_hook = GetComponent<GrapplingHook>();
        grappling_hook.init();
        health = GetComponent<GenericHealth>();
        health.init(this);
    }
Пример #35
0
	public  void OnSceneGUI ()
	{
        if (myTarget == null)
        {
            myTarget = (GrapplingHook)target;
            oldTimeToChange = myTarget.timeToChangeLength;
            oldSpeed = myTarget.changeSpeed;
        }
        
		Color c =Color.green;
		c.a=0.1f;
		Handles.color=c;
		Handles.DrawSolidDisc(((GrapplingHook)target).transform.position,Vector3.forward,((GrapplingHook)target).range);

        if (oldTimeToChange != myTarget.timeToChangeLength)
        {
            float oldChangeSpeed = myTarget.changeSpeed;
            myTarget.changeSpeed *= (myTarget.timeToChangeLength / oldTimeToChange);
            if (float.IsNaN(myTarget.changeSpeed))
            {
                myTarget.changeSpeed = oldChangeSpeed;
            }
        }
        if(oldSpeed!=myTarget.changeSpeed&&myTarget.changeSpeed<0){
            myTarget.changeSpeed = oldSpeed;
        }
        if (oldTimeToChange != myTarget.timeToChangeLength && myTarget.timeToChangeLength < 0)
        {
            myTarget.timeToChangeLength = oldTimeToChange;
        }
        oldSpeed = myTarget.changeSpeed;
            oldTimeToChange = myTarget.timeToChangeLength;
        



	
	}
Пример #36
0
 void Start()
 {
     grapplingHook = GameObject.Find("Player").GetComponent<GrapplingHook>();
 }
Пример #37
0
 public void getHook()
 {
     hook = GetComponentInChildren<GrapplingHook>();
 }
Пример #38
0
    void Start()
    {
        hasFinished = false;

        player = GameObject.Find("Player");
        grapplingHook = player.GetComponent<GrapplingHook>();

        if (playerWarningPrefab != null)
            playerWarning = GameObject.Instantiate(playerWarningPrefab) as GameObject;
    }
Пример #39
0
 void Awake()
 {
     grapplingHook = gameObject.GetComponent<GrapplingHook>();
     playerMovement = gameObject.GetComponent<PlayerMovements>();
 }
Пример #40
0
    void Awake()
    {
        instance = this;
        grappleScript = GetComponent<GrapplingHook>();

        if (enableLine && lineRenderer == null)
        {
            GameObject obj = new GameObject("Trail renderer");
            linePoints = new Queue<Vector3>();
            lineRenderer = obj.AddComponent<LineRenderer>();
            lineRenderer.material.shader = Shader.Find("Particles/Additive");
            lineRenderer.SetColors(Color.clear, lineColour);
            points = 1;
            lineRenderer.SetVertexCount(points);
            lineRenderer.SetWidth(0.3f, 0.3f);
            lineRenderer.enabled = true;
        }
    }
Пример #41
0
 public void Start()
 {
     myTarget = (GrapplingHook)target;
 }