/// <summary> /// Single Hold Cutted Object instance in the game /// </summary> private void Awake() { if (instance != null) { Debug.LogWarning("More than one instance of holdCuttedObject"); return; } instance = this; }
//public Material slice_meterial // Use this for initialization void Start() { GameObject[] obj = (GameObject[])Object.FindObjectsOfType(typeof(GameObject)); for (int i = 0; i < obj.Length; i++) { if (obj[i].name == "Player") { player = obj[i]; } } hasPut = false; //ppu = player.GetComponent<pickUpObject>(); this.GetComponent <Renderer>().material = picked_material; hold_script = player.GetComponent <holdCuttedObject>(); }