Installation
Follow these steps to install OOTII plugins in your Unity project:
- Download the package from the Asset Store or your account
- Open your Unity project
- Go to Assets → Import Package → Custom Package
- Select the OOTII package file and click "Open"
- Click "Import" to add all files to your project
Initial Setup
After importing, configure your project:
// Example: Setting up Animation System
using OOTII.Animation;
AnimationController controller = gameObject.AddComponent<AnimationController>();
controller.InitializeStateMachine();
controller.AddState("Idle", idleClip);
controller.AddState("Run", runClip);
controller.SetDefaultState("Idle");
First Steps
Quick tutorial to get your first system working:
- Create a new GameObject in your scene
- Add the appropriate OOTII component
- Configure the settings in the Inspector
- Test your setup by pressing Play
Animation System Overview
The OOTII Animation System provides a powerful state machine for managing character animations. It supports:
- Complex state transitions with conditions
- Smooth blending between animations
- Layer-based animation control
- Event callbacks and triggers
State Machine Guide
// Creating states
controller.AddState("Walk", walkClip);
controller.AddTransition("Idle", "Walk", () => inputSpeed > 0);
controller.AddTransition("Walk", "Run", () => inputSpeed > 5);
controller.AddTransition("Run", "Idle", () => inputSpeed == 0);
Animation Blending
Control how animations blend together for smooth transitions:
// Set blend mode
controller.SetBlendMode(BlendMode.Linear);
controller.SetBlendTime(0.25f); // 0.25 second crossfade
Animation Events
Trigger custom code at specific points in your animations:
// Register event listener
controller.OnAnimationEnd += () => {
Debug.Log("Animation finished");
};
controller.OnStateChange += (oldState, newState) => {
Debug.Log($"Changed from {oldState} to {newState}");
};
Camera Controller Overview
The Camera Controller provides flexible camera management with multiple modes and collision detection.
Camera Modes
Choose from several built-in camera modes:
- Third-Person: Follow camera behind the player
- Orbital: Camera orbits around target
- Isometric: Fixed angle bird's-eye view
- Cinematic: Smooth camera paths
Collision Detection
Automatic collision avoidance keeps your camera from clipping through geometry:
// Enable collision detection
cameraController.EnableCollisionDetection(true);
cameraController.SetCollisionLayers("Default", "Player");
cameraController.SetCollisionDistance(0.2f);
Combat Mechanics Overview
Complete framework for managing combat interactions in your game.
Hitbox System
Define and manage hit detection areas:
// Create a hitbox
Hitbox hitbox = weaponObject.AddComponent<Hitbox>();
hitbox.SetShape(HitboxShape.Sphere);
hitbox.SetRadius(1.0f);
hitbox.OnHit += HandleDamage;
Damage System
Calculate and apply damage with various modifiers:
// Apply damage
DamageInfo damage = new DamageInfo();
damage.baseDamage = 25f;
damage.damageType = DamageType.Physical;
damage.source = attacker;
target.TakeDamage(damage);
Core Classes
| Class | Description |
|---|---|
| AnimationController | Main controller for animation state machine |
| CameraController | Manages camera movement and behavior |
| CombatSystem | Coordinates combat interactions |
| Hitbox | Defines hit detection areas |
Common Methods
Frequently used methods across OOTII systems:
// Animation
controller.PlayState(string stateName);
controller.SetParameterValue(string paramName, float value);
controller.TransitionTo(string targetState);
// Camera
cameraController.SetTarget(Transform target);
cameraController.SetMode(CameraMode mode);
// Combat
combatSystem.DealDamage(GameObject target, float amount);
Common Properties
Properties you'll frequently access:
// Current state info
string currentState = controller.CurrentStateName;
float stateProgress = controller.GetStateProgress();
// Camera settings
Vector3 cameraPosition = cameraController.Position;
float cameraDistance = cameraController.Distance;
// Combat stats
float health = target.Health;
float maxHealth = target.MaxHealth;