示例#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> ();
    }
示例#2
0
    void Start()
    {
        rb          = GetComponent <Rigidbody>();
        ki          = GetComponent <KartInput>();
        groundCheck = GetComponentInChildren <GroundCheck>();

        // set center of mass
        rb.centerOfMass = centerOfMass.localPosition;
    }
示例#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];
    }
示例#4
0
 void Start()
 {
     inventory = gameObject.GetComponent<InventoryScript>();
     input = gameObject.GetComponent<KartInput>();
 }
示例#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>();
 }
示例#6
0
 void Start()
 {
     inventory = gameObject.GetComponent<InventoryScript>();
     input = gameObject.GetComponent<KartInput>();
 }
示例#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>();
 }