Exemplo n.º 1
0
        /*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> ();
        }
Exemplo n.º 2
0
    protected virtual void Awake()
    {
        PropsList.Add(this);
        Rigidbody                = GetComponent <Rigidbody>();
        Rigidbody.isKinematic    = false;
        Rigidbody.freezeRotation = true;

        Collider = GetComponent <Collider>();
    }
Exemplo n.º 3
0
 protected virtual void OnDestroy()
 {
     PropsList.Remove(this);
 }