SHARE
TWEET

Untitled

a guest Jun 18th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class BlueCollider : MonoBehaviour {
  6.     Collider2D m_Collider;
  7.  
  8.     public float width;
  9.  
  10.     void Start()
  11.     {
  12.         //Fetch the GameObject's Collider (make sure it has a Collider component)
  13.         m_Collider = GetComponent<Collider2D>();
  14.         width = GetComponent<BoxCollider2D>().size.x;
  15.     }
  16.  
  17.     void Update()
  18.     {
  19.         if (PlayerController.playerColor== 3)
  20.         {
  21.             //m_Collider.enabled = false;
  22.             m_Collider.isTrigger = true;
  23.  
  24.         }
  25.         else
  26.         {
  27.             //m_Collider.enabled = true;
  28.             m_Collider.isTrigger = false;
  29.  
  30.         }
  31.     }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top