Exemple #1
0
    public override void init()
    {
        init_pre();
        ui       = Utility.get_UI(transform.parent.gameObject);
        ui_champ = Utility.get_UI(transform.parent.gameObject) as UI_Champion;
        rb       = GetComponent <Rigidbody> ();

        if (!netID.isLocalPlayer && isPlayer)
        {
            return;
        }

        death_timer = new Utility.Timer(0f);
        death_timer.change_max_timer(2f);         //TODO should not be a fixed value;
        death_timer.reset_timer();

        //if (transform.parent.FindChild ("NavUnit") != null) {
        //	navagent = transform.parent.FindChild ("NavUnit").gameObject.GetComponent<NavMeshAgent> ();
        //	if (navagent != null)
        //		navagent.transform.SetParent (null);
        //}
        //navagent.updateRotation = false;
        //navagent.updatePosition = false;

        //init stats
        flags.init();
        c_flags.init();
        base_u_stats.init();
        bonus_u_stats.init();
        u_stats_growth.init();
        base_c_stats.init();
        runtime_c_stats.init();
        status = new List <Status> ();

        load_garen_base_stats();
        init_garen_skills();
        init_post();

        /*
         *      //init runtime stats
         *      runtime_u_stats = base_u_stats;
         *      update_attack_speed ();
         *      update_movement_speed ();
         *
         *      //set suto attack timers
         *      autoAtkTimer = new Utility.Timer(runtime_u_stats.attack_speed);
         *      autoAtkTimer.start_timer ();
         *      //rb.detectCollisions = true;
         *      //init appearances
         *      //load special FX
         *
         *      //Unity stuff
         *      self_col = GetComponent<Collider> ();
         *      init_AtkTarget ();
         *
         *      init_resources ();
         */
        //navagent.updatePosition = false;
    }