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
@arif-pandu
arif-pandu / RoundedRect.cs
Created July 5, 2024 15:58
Unity procedural UI component, Rounded Rect script
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof(CanvasRenderer))]
public class RoundedRect : Graphic
{
[SerializeField] private float m_CornerRadius = 10f;
[SerializeField] private float m_BorderWidth = 1f;
[SerializeField] private Color m_BorderColor = Color.black;
[SerializeField] private int m_CornerSegments = 20;
import pandas as pd
import matplotlib.pyplot as plt
def plot_scaled_graph_with_values(frame_0, frame_7, data):
"""
Plots the graph with the given data, scaling the values at frame 0 and frame 7,
and prints the scaled values per frame.
Parameters:
- frame_0: tuple (x0, y0, z0) values at frame 0
@arif-pandu
arif-pandu / UICircleRenderer.cs
Created May 22, 2024 04:41
Procedural circle UI component on Unity
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(UICircleRenderer)), CanEditMultipleObjects]
public class CircleGraphicEditor : Editor
{
## Put this file OUTSIDE Editor folder
using UnityEngine;
public class ReadOnlyAttribute : PropertyAttribute { }
using System;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using GooglePlayGames.BasicApi.SavedGame;
using UnityEngine;
public class GooglePlayUserDataManager : MonoBehaviour
{
[SerializeField] public UITest theUI;
@arif-pandu
arif-pandu / ColorFieldDrawer.cs
Last active December 3, 2023 02:06
Unity Color Option Drawer with AppColor Enum Dictionary
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
#region Color Enum
enum AppColor
{
Custom,
White,
Red,
@arif-pandu
arif-pandu / blender_extract_collection_inside_collection.py
Created October 2, 2023 21:34
Blender Script to Extract Collection children with type of Collection instances into new Collection and categorized as individual object
import bpy
# Name of the main collection
main_collection_name = "MainCollection"
new_collection_name = "NewCollection"
# Get the main collection by name
main_collection = bpy.data.collections.get(main_collection_name)
if main_collection:
@arif-pandu
arif-pandu / windows_resize_listener.dart
Created August 31, 2023 00:45
Listening physical windows size for Flutter build web. Listen with and without debouncer
import 'dart:async';
import 'package:rxdart/rxdart.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'dart:html' as html;
class WindowResizeListener extends StatefulWidget {
final Widget child;
const WindowResizeListener({super.key, required this.child});
@override
@arif-pandu
arif-pandu / ColorCombination.cs
Created August 24, 2023 05:50
Combine 2 HSL Colors in C#
using UnityEngine;
using System.Collections.Generic;
public class ColorCombination : MonoBehaviour
{
public Material newMaterial;
private void OnCollisionEnter(Collision collision)
{
Renderer renderer = collision.gameObject.GetComponent<Renderer>();
@arif-pandu
arif-pandu / gameplay.dart
Created February 19, 2023 00:54
Droplets
import 'package:flame/game.dart';
import 'package:flutter/material.dart';
class GameplayScreen extends StatelessWidget {
const GameplayScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: GameWidget(