Fixed issue with friction on wall
This commit is contained in:
11
Assets/Ground Physics Material.physicsMaterial2D
Normal file
11
Assets/Ground Physics Material.physicsMaterial2D
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!62 &6200000
|
||||||
|
PhysicsMaterial2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: Ground Physics Material
|
||||||
|
friction: 0.01
|
||||||
|
bounciness: 0
|
||||||
8
Assets/Ground Physics Material.physicsMaterial2D.meta
Normal file
8
Assets/Ground Physics Material.physicsMaterial2D.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2f4cfc102a4fc9c409ffc028af1b6389
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 6200000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class PlayerContact : MonoBehaviour
|
|
||||||
{
|
|
||||||
public Player player;
|
|
||||||
|
|
||||||
// Start is called before the first frame update
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 47ff2cdf170756a4792387a95db53a5f
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -49,6 +49,7 @@ public class EventControls : MonoBehaviour
|
|||||||
currentPlayerCollider = playerCollider;
|
currentPlayerCollider = playerCollider;
|
||||||
currentEnemyCollider = enemyCollider;
|
currentEnemyCollider = enemyCollider;
|
||||||
|
|
||||||
|
enemyCollider.gameObject.GetComponent<SpriteRenderer>().enabled = false;
|
||||||
player.StartEncounter();
|
player.StartEncounter();
|
||||||
Physics2D.IgnoreCollision(playerCollider, enemyCollider, true);
|
Physics2D.IgnoreCollision(playerCollider, enemyCollider, true);
|
||||||
|
|
||||||
@@ -205,7 +206,10 @@ public class EventControls : MonoBehaviour
|
|||||||
if (currentEnemyCollider != null)
|
if (currentEnemyCollider != null)
|
||||||
Physics2D.IgnoreCollision(currentPlayerCollider, currentEnemyCollider, false);
|
Physics2D.IgnoreCollision(currentPlayerCollider, currentEnemyCollider, false);
|
||||||
if (!isInBattle)
|
if (!isInBattle)
|
||||||
|
{
|
||||||
|
currentEnemyCollider.gameObject.GetComponent<SpriteRenderer>().enabled = true;
|
||||||
player.EndEncounter();
|
player.EndEncounter();
|
||||||
|
}
|
||||||
|
|
||||||
currentPlayerCollider = null;
|
currentPlayerCollider = null;
|
||||||
currentEnemyCollider = null;
|
currentEnemyCollider = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user