topical media & game development

talk show tell print

lib-unity-future-HouseOfTheFuture-Assets-Scripts-Elevator.js / js



  /* 
  * This file is part of the "House of the Future" showcase project by M2H (http://www.M2H.nl)
  *  The original author of this code Mike Hergaarden.
  *  Feel free to use this code for your own projects, drop me a line if you made something exciting! 
  */
  //Elevator: parenting to the aniamted elevator
  #pragma strict
  
  private var myParent : Transform;
  
  function Awake(){
          myParent=transform.parent;
  }
  
  function OnTriggerEnter (other : Collider) {
          if(other.transform.tag=="MainCamera"){
                  other.transform.root.parent=transform;
          }
  }
  
  function OnTriggerExit (other : Collider) {
          if(other.transform.tag=="MainCamera"){
                  other.transform.parent=null;
          }
  }


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.