Skip to content

khalishzhafran/utils-interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity Initialization Interface Utilities

This package provides generic initialization interfaces for Unity projects:

  • IInitializable: Basic interface for objects that can be initialized.
  • IInitializable<T>: Interface for objects that can be initialized with specific data.

Features

  • Standardizes initialization patterns for Unity components and systems
  • Supports both parameterless and data-driven initialization
  • Simple, reusable, and easy to integrate into your own classes

Usage

IInitializable

Implement IInitializable for objects that require a simple initialization step:

using ran.utilities;

public class GameManager : IInitializable
{
	public bool IsInitialized { get; private set; }

	public void Initialize()
	{
		// Initialization logic here
		IsInitialized = true;
	}
}

IInitializable

Implement IInitializable<T> for objects that require initialization with data:

using ran.utilities;

public class Player : IInitializable<PlayerData>
{
	public PlayerData Data { get; private set; }
	public bool IsInitialized { get; private set; }

	public void Initialize(PlayerData data)
	{
		Data = data;
		// Initialization logic using data
		IsInitialized = true;
	}
}

API Reference

IInitializable

  • IsInitialized: Indicates if the object has been initialized
  • Initialize(): Performs initialization logic

IInitializable

  • Data: The data used for initialization
  • IsInitialized: Indicates if the object has been initialized
  • Initialize(T data): Performs initialization logic with the provided data

Installation

Option 1: Unity Git Package Manager (Recommended)

Add the following line to your project's manifest.json dependencies:

"com.ran-utils.interface": "https://github.com/khalishzhafran/utils-interface.git"

This will automatically fetch and update the package via Unity's Package Manager.

Option 2: Manual Copy

Copy the Runtime/Interface folder into your Unity project's Assets directory.

License

Copyright (c) 2025 Ran. Free to use, modify, and distribute for personal and commercial projects as long as this notice remains intact.

About

A collection of interface utilities for Unity.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages