void Start()


    {
        GameObject startfloor  = Instantiate(floorprefab, new Vector3(0, 0, 0), Quaternion.identity);
        GameObject startfloor2 = Instantiate(floorprefab, new Vector3(0, 0, 40), Quaternion.identity);

        initialPosition = transform.position;
        rigidBody       = GetComponent <Rigidbody>();
        SetInfoBoard();
        collSetup = gameObject.AddComponent <ColliderSetup>();
        time      = Time.deltaTime;
    }
Exemplo n.º 2
0
    void Start()
    {
        mainCamera   = Camera.main;
        rigidBody    = gameObject.GetComponent <Rigidbody>();
        rendererBall = gameObject.GetComponent <Renderer>();

        sphereCollider = GetComponent <SphereCollider>();
        sphereCollider.material.bounciness    = 0.3f;
        sphereCollider.material.bounceCombine = PhysicMaterialCombine.Maximum;
        collSetup = sphereCollider.gameObject.AddComponent <ColliderSetup>();

        initialPosition = transform.position;

        randomAction = RandomAction.CreateInstance(gameObject, 120, 300);
        randomAction.ActionAdd(ColorChange);
    }