Skip to content

Instantly share code, notes, and snippets.

Avatar
😊
I love to code and can do it all day long ;)

Dilmer Valecillos dilmerv

😊
I love to code and can do it all day long ;)
View GitHub Profile
View gist:0b4a33333c5140390a92
//This method goes in your character controller
//CharacterController.cs
void GlueToFloor ()
{
if (Mathf.Abs (move) > 0 || !groundHit || IM.Jump_Button ()) {
this.transform.GetComponent<Rigidbody2D> ().isKinematic = false;
}
else if (groundHit && Mathf.Abs (move) == 0 && !isPlatform) {
this.transform.GetComponent<Rigidbody2D> ().isKinematic = true;
}
View EditorExtensionsThroughExperimentation.cs
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
using System;
public class LevelScreenshot: EditorWindow {
// Quality Settings
enum Quality {
high = 4, Medium = 3, Normal = 2, Low = 1
View GlueToStairs.cs
void GlueToStairs ()
{
if (!groundHit || IM.Jump_Button () || !isStair || Mathf.Abs(move) > 0)
this.transform.GetComponent<Rigidbody2D> ().isKinematic = false;
else if (groundHit && isStair)
this.transform.GetComponent<Rigidbody2D> ().isKinematic = true;
}
@dilmerv
dilmerv / MAC_Build_Plist_Example.plist
Created Mar 29, 2017
MAC_Build_Plist_Example.plist
View MAC_Build_Plist_Example.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>[YourGameName]</string>
<key>CFBundleGetInfoString</key>
<string>Your Game Name (c) 2017 Dilmer Games. All rights reserved.</string>
@dilmerv
dilmerv / YourGameName.entitlements
Created Mar 29, 2017
YourGameName.entitlements
View YourGameName.entitlements
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.developer.game-center</key>
<true/>
</dict>
</plist>
@dilmerv
dilmerv / MAC_Build_Sign_Game.sh
Created Mar 29, 2017
MAC_Build_Sign_Game.sh
View MAC_Build_Sign_Game.sh
#!/bin/bash
echo "Copying provisioning profile..."
cp ./embedded.provisionprofile ./YourGameName.app/Contents/
echo "Starting Signing..."
codesign -f --deep -s "3rd Party Mac Developer Application: [Your Name]" --entitlements "./YourGameName.entitlements" ./YourGameName.app/Contents/Frameworks/MonoEmbedRuntime/osx/libmono.0.dylib
codesign -f --deep -s "3rd Party Mac Developer Application: [Your Name]" --entitlements "./YourGameName.entitlements" ./YourGameName.app/Contents/Frameworks/MonoEmbedRuntime/osx/libMonoPosixHelper.dylib
codesign -f --deep -s "3rd Party Mac Developer Application: [Your Name]" --entitlements YourGameName.entitlements "./YourGameName.app/"
echo "Done Signing..."
@dilmerv
dilmerv / Build.sh
Created Jul 25, 2017
Build.sh for MAC
View Build.sh
#!/bin/bash
echo "Copying provisioning profile..."
cp ./embedded.provisionprofile ./Cubiques.app/Contents/
echo "Copying plist template..."
cp ./Info.plist ./Cubiques.app/Contents/
echo "Starting Signing..."
codesign -f --deep -s "3rd Party Mac Developer Application: Dilmer Valecillos" --entitlements "./Cubiques.entitlements" ./Cubiques.app/Contents/Frameworks/MonoEmbedRuntime/osx/libmono.0.dylib
codesign -f --deep -s "3rd Party Mac Developer Application: Dilmer Valecillos" --entitlements "./Cubiques.entitlements" ./Cubiques.app/Contents/Frameworks/MonoEmbedRuntime/osx/libMonoPosixHelper.dylib
View vwCustomerUpload.sql
CREATE VIEW [dbo].[vwCustomerUpload]
AS
SELECT
MAX([ocp].[OnlineCustomerPersonID]) as [OnlineCustomerPersonID],
MAX([ocp].[Email]) as [Email],
MAX([ocp].[Password]) as [Password],
MAX([ocp].[DemoID]) as [DemoID],
MAX([ocp].[FirstName]) as [FirstName],
MAX([ocp].[LastName]) as [LastName],
@dilmerv
dilmerv / OculusBuildProcessor.cs
Created Dec 21, 2019
Oculus Build Processor Changes Required to Get Oculus Unity Integration to work with version 12
View OculusBuildProcessor.cs
#if UNITY_ANDROID
using System.Reflection;
using System.Xml;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEditor.Android;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
namespace UnityEditor.XR.Oculus
@dilmerv
dilmerv / PlacementWithManySelectionWithScaleController.cs
Created Feb 5, 2020
Enforcing one object selection and scaling
View PlacementWithManySelectionWithScaleController.cs
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using UnityEngine.XR.ARFoundation;
[RequireComponent(typeof(ARRaycastManager))]
public class PlacementWithManySelectionWithScaleController : MonoBehaviour
{
[SerializeField]