Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        gamePadState     = ControllerManager.Instance.GamePadStates[kart.numeroJoueur - 1];
        lastGamePadState = ControllerManager.Instance.LastGamePadStates[kart.numeroJoueur - 1];
        m_input          = new KartInput(gamePadState, lastGamePadState);

        coeffInitSpeed = speedCoeff;

        foreach (Transform child in transform)
        {
            if (child.name == "kartSmoke")
            {
                smoke.Add(child.gameObject);
                continue;
            }
            if (child.name != "steering")
            {
                continue;
            }
            wheels["steering"] = child;
            foreach (Transform w in child.transform)
            {
                wheels[w.name] = w;
            }
        }

        kart_script = GetComponent <KartScript> ();
    }
Exemplo n.º 2
0
    void Start()
    {
        rb          = GetComponent <Rigidbody>();
        ki          = GetComponent <KartInput>();
        groundCheck = GetComponentInChildren <GroundCheck>();

        // set center of mass
        rb.centerOfMass = centerOfMass.localPosition;
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        gamePadState     = ControllerManager.Instance.GamePadStates[PlayerIndex];
        lastGamePadState = ControllerManager.Instance.LastGamePadStates[PlayerIndex];
        m_input          = new KartInput(gamePadState, lastGamePadState);

        KartState  = new KartState();
        m_animator = GetComponent <Animator>();
        KartRigidbody.transform       = transform;
        KartRigidbody.position        = transform.position;
        KartTransformer.KartRigidbody = KartRigidbody;

        KartRigidbody.KartTransformer = KartTransformer;
        KartRigidbody.Initialize();

        WeaponPrefab = new List <GameObject>();

        TraceL = GetComponentsInChildren <SlidingTrace>()[0];
        TraceR = GetComponentsInChildren <SlidingTrace>()[1];
    }
Exemplo n.º 4
0
 void Start()
 {
     inventory = gameObject.GetComponent<InventoryScript>();
     input = gameObject.GetComponent<KartInput>();
 }
Exemplo n.º 5
0
 void Start()
 {
     currentWeapon = WEAPON.noWeapon;                      // Set to not have weapon at the beginning
     weaponAmount  = Enum.GetNames(typeof(WEAPON)).Length; // Initialize the amount of weapons
     input         = gameObject.GetComponent <KartInput>();
 }
Exemplo n.º 6
0
 void Start()
 {
     inventory = gameObject.GetComponent<InventoryScript>();
     input = gameObject.GetComponent<KartInput>();
 }
Exemplo n.º 7
0
 void Start()
 {
     currentWeapon = WEAPON.noWeapon; // Set to not have weapon at the beginning
     weaponAmount = Enum.GetNames(typeof(WEAPON)).Length; // Initialize the amount of weapons
     input = gameObject.GetComponent<KartInput>();
 }