Create an Empty Object abd attach this scripts:

– WarBand.cs


using UnityEngine;
using System.Collections;

public class WarBand : MonoBehaviour // banda 
{
    
void Start()
    	{
   
	Humanoid human = new Humanoid(); // istanzio
        
        Humanoid enemy = new Enemy();
        
        Humanoid orc = new Orc();

        //Notice how each Humanoid variable contains
        //a reference to a different class in the
        //inheritance hierarchy, yet each of them
        //calls the Humanoid Yell() method.
        human.Yell(); // scrive Humanoid version of the Yell() method
        
        enemy.Yell(); // scrive Humanoid version of the Yell() method
        
        orc.Yell();   // scrive Humanoid version of the Yell() method  
    
	}

}

– Humanoid.cs


using UnityEngine;
using System.Collections;

public class Humanoid
{
    
	//Base version of the Yell method
    
	public virtual void Yell() // urlo
    
	{
        
	Debug.Log("Humanoid version of the Yell() method");
    
	}

}

– Enemy.cs


using UnityEngine;
using System.Collections;

public class Enemy : Humanoid
{
    	//This hides the Humanoid version.
    	public override void Yell()
    	{
	base.Yell();
    	Debug.Log("Enemy version of the Yell() method");
    	}
}

– Orc.cs


using UnityEngine;
using System.Collections;

public class Orc : Enemy

{
    
	//This hides the Enemy version.
    
	public override void Yell()
    
	{
  
	base.Yell();     
	Debug.Log("Orc version of the Yell() method");
    
	}

}

Console:
Humanoid version of the Yell() method
-> stampato da human.Yell();

Humanoid version of the Yell() method
-> stampato da enemy.Yell();
Enemy version of the Yell() method

Humanoid version of the Yell() method
-> stampato da orc.Yell();
Enemy version of the Yell() method

Orc version of the Yell() method

For italian people, come funziona?

Abbiamo una ereditarietà tra Humanoids -> Enemy -> Orcs e tre metodi con lo stesso nome
Dichiarando la funzione con la keyword – override – prende il sopravvento questo metodo, se voglio con base.Yell(); posso aggiungere il metodo padre