Skip to content

Instantly share code, notes, and snippets.

View arif-pandu's full-sized avatar
🏠
Working from home

Mapandu arif-pandu

🏠
Working from home
  • Cilacap, Central Java, Indonesia
  • X @mapen_
View GitHub Profile
@tranductam2802
tranductam2802 / main.dart
Last active August 5, 2021 18:22
A TabBar supported for bubble view style and wheel scroll
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() async =>
runApp(MaterialApp(debugShowCheckedModeBanner: false, home: DemoScreen()));
class DemoScreen extends StatefulWidget {
@override
_DemoScreenState createState() => _DemoScreenState();
}
@slightfoot
slightfoot / page_turn.dart
Created September 9, 2019 21:28
Page Turn Effect - By Simon Lightfoot. Replicating this behaviour. https://www.youtube.com/watch?v=JqvtZwIJMLo
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@muddassirm
muddassirm / LoadJson3.dart
Created August 24, 2018 18:30
Display JSON data in Flutter : Using a FutureBuilder
import 'package:flutter/material.dart';
import 'dart:convert';
import 'dart:async' show Future;
import 'package:flutter/services.dart' show rootBundle;
class Student {
String studentId;
String studentName;
int studentScores;
@sebtoun
sebtoun / JsonSerialisableScriptableObject.cs
Last active February 27, 2024 17:25
Unity's ScriptableObjects that easily serialize to JSON
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using UnityEngine;
public class JsonSerialisableScriptableObject<T> : ScriptableObject where T : JsonSerialisableScriptableObject<T>
{
@yasirkula
yasirkula / CircleGraphic.cs
Last active July 10, 2024 08:55
Create circles/ellipses in Unity UI system in one of three modes: FillInside, FillOutside and Edge.
using UnityEngine;
using UnityEngine.UI;
#if UNITY_EDITOR
using UnityEditor;
// Custom Editor to order the variables in the Inspector similar to Image component
[CustomEditor( typeof( CircleGraphic ) ), CanEditMultipleObjects]
public class CircleGraphicEditor : Editor
{
@GibsS
GibsS / RoundedRectGraphic.cs
Last active October 9, 2023 21:13
A Unity Canvas UI Graphic for a rectangle with rounded edges
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
[ExecuteInEditMode]
public class RoundRectGraphic : Graphic {
[Range(0, 200)]
public int radius;
public bool hasTop;
@IJEMIN
IJEMIN / PlayCloudDataManager.cs
Last active November 7, 2023 12:08
Unity Google Cloud Saved Game Data Manager Script
// code reference: http://answers.unity3d.com/questions/894995/how-to-saveload-with-google-play-services.html
// you need to import https://github.com/playgameservices/play-games-plugin-for-unity
using UnityEngine;
using System;
using System.Collections;
//gpg
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using GooglePlayGames.BasicApi.SavedGame;
//for encoding
@nnm-t
nnm-t / ConvertToSprite.cs
Last active July 20, 2024 09:24
Convert Texture2D To Sprite
using UnityEngine;
public static class ConvertToSpriteExtensiton
{
public static Sprite ConvertToSprite(this Texture2D texture)
{
return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
}
}
@haakov
haakov / FpsController.cs
Created April 1, 2017 13:36
Unity3D FPS Controller
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FpsController : MonoBehaviour {
public float mouseSensitivityX = 1.0f;
public float mouseSensitivityY = 1.0f;
public float walkSpeed = 10.0f;
@michidk
michidk / OutlineShader.shader
Last active May 28, 2024 17:13
An outline shader made for Unity with the help of @OverlandGame. It adjusts the size of the outline to automatically accomodate screen width and camera distance.
// An outline shader made for Unity with the help of @OverlandGame by @miichidk
// It adjusts the size of the outline to automatically accomodate screen width and camera distance.
// See how it looks here: https://twitter.com/OverlandGame/status/791035637583388672
// How to use: Create a material which uses this shader, and apply this material to any meshrenderer as second material.
Shader "OutlineShader"
{
Properties
{
_Width ("Width", Float ) = 1
_Color ("Color", Color) = (1,1,1,1)