public void PrefabSelection(object sender, OnSelectionEventArgs e)
    {
        objToPlace = (GameObject)e.clicked;
        if (objToPlacePreview != null)
        {
            GameObject.DestroyImmediate(objToPlacePreview);
        }

        objToPlacePreview = GameObject.Instantiate(objToPlace);
        objToPlacePreview.GetComponent <Collider>().enabled = false;

        objToPlacePreview.transform.SetParent(tileMap.transform);
    }
    private OnSelectionEventArgs CreateOnSelectionEvent(object clicked, Texture2D icon)
    {
        OnSelectionEventArgs e = new OnSelectionEventArgs(clicked, icon);

        return(e);
    }
Beispiel #3
0
 public void MaterialSelection(object sender, OnSelectionEventArgs e)
 {
     paintMaterial = (Material)e.clicked;
 }
Beispiel #4
0
 /// <summary>
 /// Override to handler Cell Double Clicked event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected virtual void OnCellDoubleClickedHandler(object sender, OnSelectionEventArgs e)
 {
 }