Sha256: 3781114933c5b5b775c0dcccf2bff204996ceff22b96d58c0b188d513e95a1cd

Contents?: true

Size: 1001 Bytes

Versions: 1

Compression:

Stored size: 1001 Bytes

Contents

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Scrivania : MonoBehaviour
{
    static GameObject scrivania, cameretta;
    static Vector3 pSC, sSC, sSP;
    // Start is called before the first frame update
    static internal void Start()
    {
        cameretta = GameObject.Find("Cameretta");
        scrivania = GameObject.CreatePrimitive(PrimitiveType.Cube);
        scrivania.name = "Scrivania";

        sSP = cameretta.transform.localScale;
        sSC = scrivania.transform.localScale = new Vector3(100, 4, 90);

        pSC.x += (sSP.x / 2) - (sSC.x / 2);        // Allinea il lato z dei due usando lasse x
        pSC.y += (sSP.y / 2) + (sSC.y / 2) + 70;   // Sormonta l'oggetto 
        pSC.z -= (sSP.z / 2) - (sSC.z / 2);        // Allinea il lato x dei due usando lasse z

        pSC = scrivania.transform.position = new Vector3(pSC.x, pSC.y, pSC.z);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
CamerettaUnity-0.0.1 Assets/Cameretta/Scrivania.cs