raycast example, readme and changelog

This commit is contained in:
2016-04-29 22:10:49 +06:00
parent 642e508274
commit b1155d8284
7 changed files with 304 additions and 114 deletions

View File

@@ -0,0 +1,21 @@
using UnityEngine;
using System.Collections;
namespace IsoTools.Examples {
public class AlienDestroyer : MonoBehaviour {
void Update () {
var iso_world = IsoWorld.Instance;
if ( iso_world && Input.GetMouseButtonDown(0) ) {
var iso_mouse_pos = iso_world.MouseIsoPosition();
var ray_from_iso_camera = iso_world.RayFromIsoCameraToIsoPoint(iso_mouse_pos);
var hits = iso_world.RaycastAll(ray_from_iso_camera);
foreach ( var hit in hits ) {
var alien_go = hit.collider.gameObject;
if ( alien_go.GetComponent<AlienBallController>() ) {
Destroy(alien_go);
}
}
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5c7f5e2e35176448aa6e6cb2215e904d
timeCreated: 1461944264
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: