Beispiel #1
0
    public override void Start()
    {
        this.range = 2;

        current_map = GetLinkedObject("current_map");
        if (current_map == null)
        {
            Debug.Log("Map GameObject in Enemy spear is NULL");
        }

        rand = new System.Random();

        mov = GetComponent <Movement_Action>();
        if (mov == null)
        {
            Debug.Log("Script movement action in Enemy spear is NULL");
        }

        GameObject Temp_go = GetLinkedObject("enemies_manager");

        if (Temp_go == null)
        {
            Debug.Log("Gameobject enemies_manager not found");
        }
        else
        {
            EnemiesManager enemy_manager = Temp_go.GetComponent <EnemiesManager>();

            if (enemy_manager == null)
            {
                Debug.Log("EnemySpear_BT: enemies_manager is not detected");
            }
            else
            {
                enemy_manager.AddLanceEnemy(gameObject);
            }
        }

        if (texture_type == 0)
        {
            enemy_mat_sword = GetMaterialByName("Alpha1_SpearEnemy_Material_21_04");
        }
        else if (texture_type == 1)
        {
            enemy_mat_sword = GetMaterialByName("Alpha1_SpearEnemy2_Material_21_04");
        }

        spear_name = GetLinkedObject("spear_name");

        base.Start();
        base.DeactivateHUD(spear_name);
    }