Advertisement
dronkowitz

TriangleDive.cs

Sep 8th, 2021 (edited)
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class TriangleDive : MonoBehaviour
  6. {
  7.     public bool diving = false;
  8.     public bool triangleColorForm;
  9.     // Start is called before the first frame update
  10.     void Start()
  11.     {
  12.        
  13.     }
  14.  
  15.     // Update is called once per frame
  16.     void Update()
  17.     {
  18.        
  19.     }
  20.  
  21.     public void StartTriangleDive(GameObject player)
  22.     {
  23.         diving = true;
  24.         player.GetComponentInChildren<CharacterAnimationController>().anim.Play("Triangle Dive");
  25.     }
  26.     public void OnTriggerStay(Collider other)
  27.     {
  28.         if (other.GetComponent<NewPlayerMovement>()== true)
  29.         {
  30.             if (Input.GetKeyDown(KeyCode.Space) && diving == false)
  31.             {
  32.                 StartTriangleDive(other.gameObject);
  33.             }
  34.         }
  35.     }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement