Skip to content

Instantly share code, notes, and snippets.

View aomnes's full-sized avatar

Antoine OMNES aomnes

View GitHub Profile
#if UNITY_EDITOR
//-------------------------------------------------------------------------
[UnityEditor.CustomEditor( typeof( UIElement ) )]
public class UIElementEditor : UnityEditor.Editor
{
//-------------------------------------------------
// Custom Inspector GUI allows us to click from within the UI
//-------------------------------------------------
public override void OnInspectorGUI()
{
@aomnes
aomnes / ReadOnlyAttribute.cs
Created December 14, 2018 13:44
Creat attribute [ReadOnly] with unity editor
using UnityEditor;
using UnityEngine;
public class ReadOnlyAttribute : PropertyAttribute
{
}
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
public class ReadOnlyDrawer : PropertyDrawer
@aomnes
aomnes / getListOnTrigger.js
Last active December 10, 2018 22:01
unity get list on trigger
//Has to go at the top of your file
#pragma strict
import System.Collections.Generic;
//The list of colliders currently inside the trigger
var TriggerList : List.<Collider> = new List.<Collider>();
//called when something enters the trigger
function OnTriggerEnter(other : Collider)
{
using System.Linq;
using UnityEngine;
public class AutoReferencer<T> : MonoBehaviour where T : AutoReferencer<T> {
#if UNITY_EDITOR
// This method is called once when we add component do game object
protected new virtual void Reset()
{
// Magic of reflection
using UnityEngine;
public class Singleton<T> : MonoBehaviour where T : Singleton<T>
{
protected static T instance;
/**
Returns the instance of this singleton.
*/
public static T Instance
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_144, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.1", arch: "x86_64", family: "mac"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.enterprise.inject.* < plexus.core
[DEBUG] Imported: javax.enterprise.util.* < plexus.core
@aomnes
aomnes / solution.go
Last active June 21, 2017 10:33
Test Stage
package main
import "fmt"
func main() {
var count int = 0
s := make([]bool, 120)
for i := 1; i <= 120; i++ {
for j := 0; j < 120; j += i {
@aomnes
aomnes / process.java
Created June 11, 2017 13:39
Exemple processus java
public void actionPerformed(ActionEvent arg0) {
ZDialog zd = new ZDialog(null, "General.io", true);
System.out.print(ZDialog.nb_ouverture);
nb_partie = ZDialog.nb_ouverture;
nom_a = zd.get_nom_r();
nom_b = zd.get_nom_b();
actualiser_param();
ZDialogInfo zInfo = zd.showZDialog();
JOptionPane jop = new JOptionPane();
jop.showMessageDialog(null, zInfo.toString(), "Data Game", JOptionPane.INFORMATION_MESSAGE);
package view.thread;
import javax.swing.JOptionPane;
import controler.G_Joueur;
import view.form.Fenetre;
import view.form.FenetreJeu;
import javax.swing.*;
public class VerifGagnant extends JFrame implements Runnable {
@aomnes
aomnes / MainThread.java
Created June 5, 2017 14:40
Thread return idée
package view.form;
/**
* Created by antoineomnes on 05/06/2017.
*/
class MainThread {
public void startMyThread() {
Object requiredObject = new Object(); //Map/List/OwnClass
Thread myThread = new Thread(new RunnableObject(requiredObject)).start();
myThread.join();