Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class ReplaceObjectOnClickClass : MonoBehaviour
- {
- delegate void ReplaceObject();
- ReplaceObject myReplaceObject;
- void Start ()
- {
- myReplaceObject += ReplaceObjectWithSelected;
- myReplaceObject += TurnRed;
- if(myReplaceObject != null)
- {
- myReplaceObject();
- }
- }
- void ReplaceObjectWithSelected()
- {
- - get original object transform
- - get new object
- - set new object with orginanl trasform
- print ("Successfully replaced object!");
- }
- void ReplaceObjectHighlighter()
- {
- renderer.material.color = Color.red;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement