Exemple #1
0
    void Start()
    {
        SetKubs();          //Je définis le tableau des kubs

        //Je récupère le perso
        Perso = GameObject.FindGameObjectWithTag("Player").GetComponent <Controle_Personnage> ();

        //Récupération de la taille du cube
        largeur  = Mathf.RoundToInt(GetCubeSize().x);
        hauteur  = Mathf.RoundToInt(GetCubeSize().y);
        longueur = Mathf.RoundToInt(GetCubeSize().z);

        //Creation du point central pour les centre de rotation
        float milx = (float)(((float)largeur / 2) - 0.5F);
        float mily = (float)(((float)hauteur / 2) - 0.5F);
        float milz = (float)(((float)longueur / 2) - 0.5F);

        centreRot = new Vector3(milx, mily, milz);
    }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     Perso = GameObject.FindGameObjectWithTag("Player").GetComponent <Controle_Personnage> ();
 }