Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- using UnityEngine.UI;
- using UnityEditor;
- public class ImageCouch : MonoBehaviour, IPointerClickHandler {
- public GameObject target;
- public float speedtrans = 0.2f;
- public float moveSpeed = 10f;
- public float turnSpeed = 50f;
- private GameObject instance;
- private bool clickado = false;
- private bool true_delete = false;
- public void OnPointerClick(PointerEventData eventData)
- {
- instance = Instantiate(Resources.Load("Couch_1", typeof(GameObject))) as GameObject;
- instance.transform.parent = target.transform;
- instance.transform.localScale += new Vector3(30F, 30F, 30F);
- instance.transform.localPosition = new Vector3(0, 0, 0);
- clickado = true;
- }
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- }
- void OnGUI()
- {
- if (clickado == true)
- {
- if (GUILayout.Button("Del Couch"))
- {
- true_delete = true;
- }
- if (true_delete)
- {
- DestroyObject(instance);
- clickado = false;
- true_delete = false;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement