/*public Dictionary<GameObject, worldProp> worldProps { * get { return _worldProps; } * }*/ #endregion #region PublicMethods public void init() { _levelPropDefs = new List <propDef> (); PropsList propList = Resources.Load <PropsList> ("Data/" + Globals.propListName); int i, len = propList.props.Count; for (i = 0; i < len; ++i) { PropDefinition propDef = propList.props [i]; if (propDef.prefab != null) { propDef p = new propDef(); p.id = propDef.id; p.name = propDef.propName; p.prefab = propDef.prefab; p.useCollider = propDef.isUsingCollider; p.useGravity = propDef.isUsingGravity; _levelPropDefs.Add(p); } } _iSelectedItem = 0; //_worldProps = new Dictionary<GameObject, worldProp> (); }
protected virtual void Awake() { PropsList.Add(this); Rigidbody = GetComponent <Rigidbody>(); Rigidbody.isKinematic = false; Rigidbody.freezeRotation = true; Collider = GetComponent <Collider>(); }
protected virtual void OnDestroy() { PropsList.Remove(this); }