Exemplo n.º 1
0
    //public NEntity.NScript.EntityScriptReader reader;


    //public NEntity.NScript.LoadNetworkPrefab loadRocketModel;
    //public NEntity.NScript.MoveForward move;
    //public NEntity.NScript.LoadNetworkPrefab loadExplosionModel;
    //public NEntity.NScript.LoadPrefab loadExplosionPlayer;
    //public NEntity.NScript.GameObjectDestroy destroyNetworkObject;

    public void init(
        NetworkPrefabLoader loader,
        GameData.TEAM team, EntityPlayer entity, Rigidbody krigidBody,
        Vector3 position, Vector3 to)
    {
        PhysicsLayer.SET_ATTACK(m_prefab, team);
        m_team          = team;
        m_networkloader = loader;
        m_networkloader.RpcLoadPrefab_ParentMe(PREFAB_ID.GRENADE, team);
        krigidBody.AddForce(entity.transform.rotation * m_initialForce, ForceMode.Impulse);
        //krigidBody.isKinematic = false;
        //m_explosion.gameObject.SetActive(false);
        m_entity    = entity;
        m_rigidbody = krigidBody;
        //Debug.Log(m_rigidbody);
        m_networkloader           = loader;
        m_triggerEnter.m_isRepeat = true;
        m_triggerEnter.resetCollisionCheck();
        m_triggerEnter.addHdr(onCollision);
        m_prefab.setLayer(PhysicsLayer.GET_LAYER(
                              (team == GameData.TEAM.RED) ? PHYSICS_LAYER.LAYER_RED_ATTACK : PHYSICS_LAYER.LAYER_BLUE_ATTACK));
    }