Пример #1
0
    void Start()
    {
        HumanoidClass human = new HumanoidClass();
        HumanoidClass enemy = new EnemyClass();
        HumanoidClass orc   = new OrcClass();

        //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();
        enemy.Yell();
        orc.Yell();
    }