This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CalculateEntityClosestFOV(List<Entity> _listOfEntities) { | |
// We iterate through each item of the Entity list that was passed as an argument | |
foreach (var enemy in _listOfEntities) | |
{ | |
// If entity != null, proceed | |
if (enemy != null) | |
{ | |
// Get its position and set some constants that will create the quadrant around the entity: | |
Vector3 _entityLocation = new Vector3(enemy.entityLocation.x, enemy.entityLocation.y, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; // enables System.Diagnostics.StopWatch | |
using System; // enables System.TimeSPan | |
Stopwatch stopwatch = new Stopwatch(); | |
stopwatch.Start(); | |
// Your function here | |
stopwatch.Stop(); | |
TimeSpan ts = stopwatch.Elapsed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function disable_wpcomtoolbar ( $modules ) { | |
if ( isset( $modules['masterbar'] ) ) { | |
unset( $modules['masterbar'] ); | |
} | |
return $modules; | |
} | |
add_filter( 'jetpack_get_available_modules', 'disable_wpcomtoolbar' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The main problem we try to solve here is that the Main Camera is a game object that is already in place before the Player Entity is generated, so it cannot be assigned as the Player instance is null */ | |
using UnityEngine; | |
public class CameraController : MonoBehaviour | |
{ | |
public Transform target; // The Player Transform | |
private bool isPlayerFound; | |
void Start() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private bool _debug_create_specific_item = true; | |
// DEBUG: When enabled, 100% chance to create a certain item each time x is triggered | |
if (_debug_create_specific_item) | |
{ | |
Debug.Log("###############------+ DEBUG MODE +-----###############"); | |
pickupItemObject = new GameObject("itemName"); | |
itemTag = "itemTag"; | |
SetupPickupItem(pickupItemObject, itemTag, itemSprite); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## in PlayerCollisions.cs , attached to the player game object: | |
public bool isPlayerTakingDamage; | |
public void Start(){ | |
isPlayerTakingDamage = false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* FloatingTextController.cs*/ | |
public class FloatingTextController : MonoBehaviour | |
{ | |
private static FloatingText popupText; | |
private static GameObject canvas; | |
public static void Initialize() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerator MapColorPulse() | |
{ | |
bool isLimitReached = false; | |
map = GameObject.Find("Map"); | |
SpriteRenderer mapRendererComponent = map.GetComponent<SpriteRenderer>(); | |
initialMapAlphaValue = mapRendererComponent.color.a; // 1 | |
//Debug.Log("Initial alpha: " + initialMapAlphaValue); // 1 | |
// Test: Using Find() + new Color for setting up the alpha value: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Advertisements; | |
namespace Ngu | |
{ | |
public class AdManager : MonoBehaviour | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Atomic V1 & V2 */ | |
if( ( defined( 'PRESSABLE_PROXY' ) && PRESSABLE_PROXY ) || ( defined( 'ATOMIC_PROXY' ) && ATOMIC_PROXY ) ) { | |
// Your code here | |
} |
NewerOlder