Пример #1
0
    // Use this for initialization
    void Start()
    {
        switch (type)
        {
        case Type.Normal:
            enemyclass = new Normal();
            break;

        case Type.Big:
            enemyclass = new Big();
            break;

        case Type.Small:
            enemyclass = new Small();
            break;
        }

        enemyclass.Init(gameObject);

        hp_gage = transform.FindChild("Canvas").FindChild("Slider").gameObject;
        hp_gage.GetComponent <Slider>().maxValue = enemyclass.m_hp;
        hp_gage.GetComponent <Slider>().value    = 0;
    }