Ejemplo n.º 1
0
    public void initialize(GameObject paintTrackerGO, GameObject paintSurface, GameObject barrierTracker, GameObject tokenTracker, GameObject tokenSphere)
    {
        paintTracker = paintTrackerGO;
        foreach (Transform child in transform)
        {
            if (child.gameObject.tag == "Player")
            {
                PaintTrail childScript = child.gameObject.GetComponent <PaintTrail>();
                childScript.initialize(paintTrackerGO, paintSurface, barrierTracker, tokenTracker, tokenSphere);

                paintTrailScript = childScript;
            }
        }
    }
Ejemplo n.º 2
0
    // ---------------
    // Runtime
    // ---------------



    public void instantiatePaintTrail()
    {
        // Instantiate a copy of this shape
        GameObject     myCopy = Instantiate(gameObject, transform.position, transform.rotation);
        PaintTrail     myCopyPaintTrailScript     = myCopy.GetComponent <PaintTrail>();
        PaintMaterials myCopyPaintMaterialsScript = myCopy.GetComponent <PaintMaterials>();

        // Change properties to Paint
        myCopyPaintTrailScript.transformIntoPaintTrail();
        myCopyPaintMaterialsScript.setMaterial(paintMatScript.paintMaterial);
        myCopyPaintMaterialsScript.overridePaintMaterials(paintMatScript.shapeMaterial, paintMatScript.paintMaterial, paintMatScript.completedMaterial);

        paintTrackerScript.addPaintTrail(myCopy);
    }
Ejemplo n.º 3
0
    // ----------------------------
    // Initialization
    // ----------------------------

    void Start()
    {
        initializeFlippableShape();

        paintTrailScript     = transform.Find("PlayerMesh").gameObject.GetComponent(typeof(PaintTrail)) as PaintTrail;
        colorFlippableScript = gameObject.GetComponent <ColorFlippable>();



        // SFX
        sfxControllerGO = GameObject.Find("SFX Controller");
        if (sfxControllerGO)
        {
            sfxControllerScript = sfxControllerGO.GetComponent <sfxController>();
        }
    }
Ejemplo n.º 4
0
    // ---------------
    // Editor Mode
    // ---------------


    public void instantiatePaintSurfaceElement(GameObject container)
    {
        Debug.Log("instantiatePaintSurfaceElement");
        // Instantiate a copy of this player shape gameObject
        GameObject myCopy = Instantiate(gameObject, transform.position, transform.rotation, container.transform);

        // Initiallize it as a PaintSurface object
        PaintTrail myCopyPaintTrailScript = myCopy.GetComponent <PaintTrail>();

        myCopyPaintTrailScript.transformIntoPaintSurface();

        // Change material
        PaintMaterials myCopyPaintMaterialsScript = myCopy.GetComponent <PaintMaterials>();

        myCopyPaintMaterialsScript.setMaterial(myCopyPaintMaterialsScript.paintSurfaceMaterial);

        // Create tokens from vertices
        Debug.Log("Create Tokens");
    }
Ejemplo n.º 5
0
    public void paintAllShapesToPaintSurfaceEditor()
    {
        // Retrieve all Shapes from Level
        GameObject[] allPlayerShapes = GameObject.FindGameObjectsWithTag("Player");

        Debug.Log("allPlayerShapes " + allPlayerShapes);
        Debug.Log("allPlayerShapes length " + allPlayerShapes.Length);

        foreach (GameObject child in allPlayerShapes)
        {
            Debug.Log("foreach");
            PaintTrail childPaintTrailScript = child.GetComponent <PaintTrail>();

            if (child.activeSelf && childPaintTrailScript)
            {
                Debug.Log("activeSelf");
                childPaintTrailScript.instantiatePaintSurfaceElement(paintSurfaceContainer);
            }
        }
    }