Moving to flex, Hoping it would fix platform

This commit is contained in:
2022-01-29 23:28:34 +05:30
parent 891318680d
commit f3d21f4ec6
100 changed files with 25824 additions and 15313 deletions

46
Assets/Scripts/Door.cs Normal file
View File

@@ -0,0 +1,46 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Door : MonoBehaviour
{
public SpriteRenderer openDoorSprite;
public bool locked;
void Start(){
if(!locked){
openDoorSprite.color = Color.black;
}
}
public void unlock(){
locked=false;
openDoorSprite.color = Color.black;
}
void Update()
{
}
void OnTriggerEnter2D(Collider2D col){
Debug.Log(col.gameObject.name + " Entered");
NetPlayer playerObject = col.GetComponent<NetPlayer>();
if(!locked&& playerObject!=null){
if(playerObject.isLocalPlayer){
col.GetComponent<PlayerController>().inDoor = true;
}
}
}
void OnTriggerExit2D(Collider2D col){
Debug.Log(col.gameObject.name + " Exited");
NetPlayer playerObject = col.GetComponent<NetPlayer>();
if(!locked&& playerObject!=null){
if(playerObject.isLocalPlayer){
col.GetComponent<PlayerController>().inDoor = false;
}
}
}
}